[Design the new POJO MicroContainer] - Re: aop-mc-int tests with maven
by kabir.khan@jboss.com
"kabir.khan(a)jboss.com" wrote :
| In addition to the things I mentioned above, one thing that makes the console output impossible to read is that all the log messages/System.out.println()s from the tests appear in the console. With ant, the junit task would redirect these to to only appear in the log file. What maven-fu is needed to do that?
Here I mean running the tests.
| Running org.jboss.test.microcontainer.test.CreatedBeansLifecycleCallbackTestCase
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec
| Running org.jboss.test.microcontainer.test.BeanCallingMethodInCtorTestCase
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec
|
is a lot easier to parse for errors/success than
| Running org.jboss.test.microcontainer.test.CreatedBeansLifecycleCallbackTestCase
| 23859 DEBUG [CreatedBeansLifecycleCallbackTestCase] ==== setUp org.jboss.test.microcontainer.test.CreatedBeansLifecycleCallbackTestCase ====
| 23875 DEBUG [KernelFactory] Starting JBoss Kernel construction...
| 23875 DEBUG [KernelFactory] Completed JBoss Kernel construction. Duration: 0 milliseconds
| 23875 DEBUG [CreatedBeansLifecycleCallbackTestCase] No test specific deployment org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackTestCase-aop.xml
| 23875 DEBUG [CreatedBeansLifecycleCallbackTestCase] No test specific deployment org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackTestCase.xml
| 23875 DEBUG [CreatedBeansLifecycleCallbackTestCase] Security enabled: true
| 23875 DEBUG [CreatedBeansLifecycleCallbackTestCase] ==== Starting testLifecycleInterceptions ====
| 23875 DEBUG [CreatedBeansLifecycleCallbackTestCase] Deploying file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer-mvn/aop-mc-int/target/test-classes/org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackTestCaseNotAutomatic.xml
| =====> Adding lifecycle org.jboss.aop.microcontainer.lifecycle.LifecycleCallbackDefinition@f1770a:ControllerState@be6d81{Configured}
| 23937 DEBUG [CreatedBeansLifecycleCallbackTestCase] Undeploying file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer-mvn/aop-mc-int/target/test-classes/org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackTestCaseNotAutomatic.xml
| 23937 DEBUG [CreatedBeansLifecycleCallbackTestCase] testLifecycleInterceptions took 62ms
| 23937 DEBUG [CreatedBeansLifecycleCallbackTestCase] ==== Stopping testLifecycleInterceptions ====
| 23937 DEBUG [CreatedBeansLifecycleCallbackTestCase] ==== tornDown org.jboss.test.microcontainer.test.CreatedBeansLifecycleCallbackTestCase ====
| 23937 DEBUG [CreatedBeansLifecycleCallbackTestCase] Undeploying []
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec
| Running org.jboss.test.microcontainer.test.BeanCallingMethodInCtorTestCase
| 23937 DEBUG [BeanCallingMethodInCtorTestCase] ==== setUp org.jboss.test.microcontainer.test.BeanCallingMethodInCtorTestCase ====
| 23953 DEBUG [KernelFactory] Starting JBoss Kernel construction...
| 23953 DEBUG [KernelFactory] Completed JBoss Kernel construction. Duration: 0 milliseconds
| 23953 DEBUG [BeanCallingMethodInCtorTestCase] No test specific deployment org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase-aop.xml
| 23953 DEBUG [BeanCallingMethodInCtorTestCase] Deploying file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer-mvn/aop-mc-int/target/test-classes/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.xml
| 23969 DEBUG [Aspect] Bound aspect InterceptedAdvice$Aspect; deployed:true
| 23984 DEBUG [AspectBinding] Bound binding ax6l-jgg29f-f0vbb4kk-1-f0vbblss-3e
| 23984 DEBUG [GenericBeanAspectFactory] Creating advice ax6l-jgg29f-f0vbb4kk-1-f0vbblsd-3d
| public
| private
| private
| 24015 DEBUG [BeanCallingMethodInCtorTestCase] Security enabled: true
| 24015 DEBUG [BeanCallingMethodInCtorTestCase] ==== Starting testIntercepted ====
| CalledInterceptor: [advisedMethod=public void org.jboss.test.microcontainer.support.BeanCallingMethodInCtor.publicMethod(), unadvisedMethod=public void org.jboss.test.microcontainer.support.BeanCallingMethodInCtor.publicMethod(), metadata=null, targetObject=org.jboss.test.microcontainer.support.BeanCallingMethodInCtor@1fc9484, arguments=null]
| public
| 24015 DEBUG [BeanCallingMethodInCtorTestCase] testIntercepted took 0ms
| 24015 DEBUG [BeanCallingMethodInCtorTestCase] ==== Stopping testIntercepted ====
| 24015 DEBUG [BeanCallingMethodInCtorTestCase] ==== tornDown org.jboss.test.microcontainer.test.BeanCallingMethodInCtorTestCase ====
| 24015 DEBUG [BeanCallingMethodInCtorTestCase] Undeploying [file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer-mvn/aop-mc-int/target/test-classes/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.xml]
| 24015 DEBUG [Aspect] Unbinding aspect InterceptedAdvice$Aspect
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.078 sec
| /code]
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040002#4040002
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4040002
18 years, 11 months
[Design the new POJO MicroContainer] - Re: aop-mc-int tests with maven
by kabir.khan@jboss.com
I'll try to dig out the old build-test.xml to add the tests, I'll let you know when I get stuck.
A few further questions:
I see we now have things like
| <plugin>
| <groupId>org.apache.maven.plugins</groupId>
| <artifactId>maven-surefire-plugin</artifactId>
| <executions>
| <execution>
| <id>weave</id>
| <phase>test</phase>
| <goals>
| <goal>test</goal>
| </goals>
| ....
| <execution>
| <id>weave-secure</id>
| <phase>test</phase>
| <goals>
| <goal>test</goal>
| </goals>
| ...
|
Is there a way to for example only run the weave-secure tests?
Some of the tests (those belonging to group 3) will be run 4 times, the others will be run twice. At the moment with the surefire plugin I assume that the last run will override the report for the previous run. With the old build they had a separate file generated for each security/weaving configuration, is that possible?
For example for the org.jboss.test.microcontainer.test.LifecycleTestCase test, you would get something like:
| TEST-org.jboss.test.microcontainer.test.LifecycleTestCase-weave.txt
| TEST-org.jboss.test.microcontainer.test.LifecycleTestCase-weave.xml
| TEST-org.jboss.test.microcontainer.test.LifecycleTestCase-weave-secure.txt
| TEST-org.jboss.test.microcontainer.test.LifecycleTestCase-weave-secure.xml
| TEST-org.jboss.test.microcontainer.test.LifecycleTestCase-no-weave.txt
| TEST-org.jboss.test.microcontainer.test.LifecycleTestCase-no-weave.xml
| TEST-org.jboss.test.microcontainer.test.LifecycleTestCase-no-weave-secure.txt
| TEST-org.jboss.test.microcontainer.test.LifecycleTestCase-no-weave-secure.xml
|
The extension would also get passed into junit and get picked out by the org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter and used as the title/identifier in the generated xml. An example of this can be found in the current aop cc runs
http://cruisecontrol.jboss.com/cc/artifacts/jboss-aop-testsuite/200704231..., and then if you click pretty much any package name you will see that the same test has been run under different configurations. Pretty useful if a test fails in some configurations and not others - like for example the tests in the org.jboss.test.aop.jdk15annotated package :-)
Also, with the old build it was possible to just run one single test for a certain weaving mode, e.g
| $ ant one-test-no-weave -Dtest=org.jboss.test.microcontainer.test.LifecycleTestCase
|
| Is that still doable somehow?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039989#4039989
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039989
18 years, 11 months