Author: rmannibucau Date: Wed Oct 26 21:22:41 2016 New Revision: 1766737 URL: http://svn.apache.org/viewvc?rev=1766737&view=rev Log: writing something on all pages, even not yet done ones
Modified: openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-gradle/index.adoc openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-maven/index.adoc openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/testing/index.adoc Modified: openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-gradle/index.adoc URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-gradle/index.adoc?rev=1766737&r1=1766736&r2=1766737&view=diff ============================================================================== --- openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-gradle/index.adoc (original) +++ openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-gradle/index.adoc Wed Oct 26 21:22:41 2016 @@ -7,4 +7,28 @@ :jbake-microwavecolor: body-pink :icons: font -TBD \ No newline at end of file +[source,groovy] +---- +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath "org.apache.microwave:microwave-gradle-plugin:${microwave.version}" + } +} + +group 'com.app' +version '1.0-SNAPSHOT' + +apply plugin: 'java' +apply plugin: 'org.apache.microwave.microwave' + +microwave { + httpPort = 9090 + // most of the microwave core configuration +} + +---- + +More coming soon, for now use gradle IDE integration or configuration documentation please. Modified: openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-maven/index.adoc URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-maven/index.adoc?rev=1766737&r1=1766736&r2=1766737&view=diff ============================================================================== --- openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-maven/index.adoc (original) +++ openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/microwave-maven/index.adoc Wed Oct 26 21:22:41 2016 @@ -7,4 +7,17 @@ :jbake-microwavecolor: body-pink :icons: font -TBD \ No newline at end of file +Coordinates: + +[source,xml] +---- +<plugin> + <groupId>org.apache.microwave</groupId> + <artifactId>microwave-maven-plugin</artifactId> + <version>${microwave.version}</version> +</plugin> +---- + +TIP: most of the configuration is inherited from microwave-core. + +More coming soon, for now use gradle IDE integration or configuration documentation please. Modified: openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/testing/index.adoc URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/testing/index.adoc?rev=1766737&r1=1766736&r2=1766737&view=diff ============================================================================== --- openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/testing/index.adoc (original) +++ openwebbeans/microwave/trunk/microwave-doc/src/main/jbake/content/testing/index.adoc Wed Oct 26 21:22:41 2016 @@ -9,8 +9,71 @@ == JUnit: rules and runners -TBD +Coordinates: + +[source,xml] +---- +<dependency> + <groupId>org.apache.microwave</groupId> + <artifactId>microwave-junit</artifactId> + <version>${microwave.version}</version> +</dependency> +---- + +Microwave provides two flavors of JUnit integration: mono or nor runners/rules. The mono one will +ensure there is a single container for the whole JVM where the other ones will follow JUnit lifecycle (per class or test). + +Here how to use the not mono rule: + +[source,java] +---- +public class MicrowaveRuleTest { + @ClassRule // started once for the class, @Rule would be per method + public static final MicrowaveRule RULE = new MicrowaveRule(); + + @Test + public void test() throws IOException { + // use "http://localhost:" + RULE.getConfiguration().getHttpPort() + } +} +---- + +And here for the mono version: + +[source,java] +---- +@RunWith(MonoMicrowave.Runner.class) +public class MonoMicrowaveRuleTest { + /* or + @ClassRule + public static final MonoMicrowave.Rule RULE = new MonoMicrowave.Rule(); + */ + + @MonoMicrowave.Runner.ConfigurationInject + private Microwave.Builder config; + + @Test + public void test() throws IOException { + // use "http://localhost:" + config.getHttpPort() + } +} +---- + +When using the mono runner, `@MonoMicrowave.Runner.ConfigurationInject` allows to still +access the configuration and random HTTP port. + == Arquillian Container -TBD +Container dependency: + +[source,xml] +---- +<dependency> + <groupId>org.apache.microwave</groupId> + <artifactId>microwave-arquillian</artifactId> + <version>${microwave.version}</version> +</dependency> +---- + +For the configuration check link:../microwave-core/configuration.html[Core configuration].