Running unit tests in a specific order
Hey folks, I am using the surefire plugin to run through JUnit tests. I am facing some cross-test dependencies issues and thus would like to investigate how tests perform when ran in a specific order. I have tried using the' test' flag, as in: mvn -Dtest=ATest,BTest,CTest test However, this does not necessarily execute the tests in the specified order (eg. CTest is executed before ATest or BTest). Is it possible to specify a strict order, through which unit tests should be executed? Cheers Michel - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
AW: Running unit tests in a specific order
Hey Michael, Afaics there is no way to define the order of tests with the surefire plugin. Maybe another plugin could help you. But IMHO i would suggest to remove the dependencies of your tests. E.g. using the @Before annotation. Otherwise you can never be sure that your tests are working after changing one of your dependent tests. This is more an advice than an useful hint. But i'm pretty sure that the surefire plugin itself wont help you defining the order of your tests. Harald -Ursprüngliche Nachricht- Von: Michel Barakat [mailto:bmic...@gmail.com] Gesendet: Donnerstag, 7. Januar 2010 12:24 An: users@maven.apache.org Betreff: Running unit tests in a specific order Hey folks, I am using the surefire plugin to run through JUnit tests. I am facing some cross-test dependencies issues and thus would like to investigate how tests perform when ran in a specific order. I have tried using the' test' flag, as in: mvn -Dtest=ATest,BTest,CTest test However, this does not necessarily execute the tests in the specified order (eg. CTest is executed before ATest or BTest). Is it possible to specify a strict order, through which unit tests should be executed? Cheers Michel - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Running unit tests in a specific order
Use TestNG, it's @Test annotationhttp://testng.org/doc/documentation-main.html#annotationshas dependsOnMethods and dependsOnGroups attributes which allow you to express such test dependencies in tests themselves. Regards, Stevo. On Thu, Jan 7, 2010 at 1:07 PM, Entner Harald entner.har...@afb.de wrote: Hey Michael, Afaics there is no way to define the order of tests with the surefire plugin. Maybe another plugin could help you. But IMHO i would suggest to remove the dependencies of your tests. E.g. using the @Before annotation. Otherwise you can never be sure that your tests are working after changing one of your dependent tests. This is more an advice than an useful hint. But i'm pretty sure that the surefire plugin itself wont help you defining the order of your tests. Harald -Ursprüngliche Nachricht- Von: Michel Barakat [mailto:bmic...@gmail.com] Gesendet: Donnerstag, 7. Januar 2010 12:24 An: users@maven.apache.org Betreff: Running unit tests in a specific order Hey folks, I am using the surefire plugin to run through JUnit tests. I am facing some cross-test dependencies issues and thus would like to investigate how tests perform when ran in a specific order. I have tried using the' test' flag, as in: mvn -Dtest=ATest,BTest,CTest test However, this does not necessarily execute the tests in the specified order (eg. CTest is executed before ATest or BTest). Is it possible to specify a strict order, through which unit tests should be executed? Cheers Michel - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Running unit tests in a specific order
Can these tests in problem run by themselves standalone ? If so, I am guessing you are running into problem where one test is setting the data (like static or threadLocal etc) which is making the other tests to fail, You can run these tests in problem in a different execution set within the surefire plugin. Thanks Kumar On Thu, Jan 7, 2010 at 6:23 AM, Michel Barakat bmic...@gmail.com wrote: Hey folks, I am using the surefire plugin to run through JUnit tests. I am facing some cross-test dependencies issues and thus would like to investigate how tests perform when ran in a specific order. I have tried using the' test' flag, as in: mvn -Dtest=ATest,BTest,CTest test However, this does not necessarily execute the tests in the specified order (eg. CTest is executed before ATest or BTest). Is it possible to specify a strict order, through which unit tests should be executed? Cheers Michel - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Running unit tests in a specific order
Couldn't you use a TestSuite to do this? We use these to run tests in specified orders. http://junit.org/apidocs/junit/framework/TestSuite.html Adam http://www.mobilvox.com On Thu, Jan 7, 2010 at 9:18 AM, Kumar Ampani amp...@gmail.com wrote: Can these tests in problem run by themselves standalone ? If so, I am guessing you are running into problem where one test is setting the data (like static or threadLocal etc) which is making the other tests to fail, You can run these tests in problem in a different execution set within the surefire plugin. Thanks Kumar On Thu, Jan 7, 2010 at 6:23 AM, Michel Barakat bmic...@gmail.com wrote: Hey folks, I am using the surefire plugin to run through JUnit tests. I am facing some cross-test dependencies issues and thus would like to investigate how tests perform when ran in a specific order. I have tried using the' test' flag, as in: mvn -Dtest=ATest,BTest,CTest test However, this does not necessarily execute the tests in the specified order (eg. CTest is executed before ATest or BTest). Is it possible to specify a strict order, through which unit tests should be executed? Cheers Michel - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
reproducible builds with maven
Hi! 1.) to reproduce a maven build where poms contain intervals for dependencies it would be nice to have a list of ALL used dependencies and versions - even the used maven plugins and versions. We played around with the dependency plugin: We start with an empty local repo. After a mvn clean install we have many more artifacts and plugins in the local repo than are reported by the dependency plugin. How can we generate a complete 'used-deps-list'? 2.) Later we want to feed that used-deps-list into a maven call which shall reproduce the old build. We assume that all used old versions of dependencies and plugins are still in the repositories (our nexus). But very likely there are already newer versions which we don't want to use, too. Maven should be able to use the previously generated 'used-deps-list' as a white list filter: only the versions in the list will be used. More, Maven itself shall only use maven plugin versions which are in the list, too. Any newer versions must not be used. Is there someone already working on a similar reproducibility approach? Any suggestions? Many thanks, Stephan
RE: reproducible builds with maven
We avoid any snapshot or 'reanges' in our releases, everything is versioned. We also generate the Site report with it's dependency report which we find quite comprehensive. So from our point of view we haven't had any issues with reproducibility as is. We do also capture severy depency plugin reports during the build but they are for diagnostic purposes only and not reproducibility. === Curtis Yanko UHGIT Computer Services - ADIS Continuous Integration w860.702.9059 -Original Message- From: Weber, Stephan [mailto:stephan.we...@sap.com] Sent: Thursday, January 07, 2010 9:35 AM To: users@maven.apache.org Subject: reproducible builds with maven Hi! 1.) to reproduce a maven build where poms contain intervals for dependencies it would be nice to have a list of ALL used dependencies and versions - even the used maven plugins and versions. We played around with the dependency plugin: We start with an empty local repo. After a mvn clean install we have many more artifacts and plugins in the local repo than are reported by the dependency plugin. How can we generate a complete 'used-deps-list'? 2.) Later we want to feed that used-deps-list into a maven call which shall reproduce the old build. We assume that all used old versions of dependencies and plugins are still in the repositories (our nexus). But very likely there are already newer versions which we don't want to use, too. Maven should be able to use the previously generated 'used-deps-list' as a white list filter: only the versions in the list will be used. More, Maven itself shall only use maven plugin versions which are in the list, too. Any newer versions must not be used. Is there someone already working on a similar reproducibility approach? Any suggestions? Many thanks, Stephan This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Global dependencies report?
Hi We have a company-wide parent POM where all the versions of all dependencies are managed. Now it's very handy to have the Dependency Analysis in the site for each project, but we may have some dependencies declared in the company-wide parent POM which are never used in the projects. Is there any way to find them? Is there some sort of global overall dependency analysis? Best regards, Eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Global dependencies report?
Didn't you get my response to your mail sent on Jan 5? Did you try it? /Anders On Thu, Jan 7, 2010 at 16:26, Lewis, Eric eric.le...@ipi.ch wrote: Hi We have a company-wide parent POM where all the versions of all dependencies are managed. Now it's very handy to have the Dependency Analysis in the site for each project, but we may have some dependencies declared in the company-wide parent POM which are never used in the projects. Is there any way to find them? Is there some sort of global overall dependency analysis? Best regards, Eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
AW: Global dependencies report?
Hi Anders Sorry, I had some problems with the mailing list :-) I looked up your answer on Nabble, thanks for hint! I'll try it and check if it works. Best regards, Eric -Ursprüngliche Nachricht- Von: anders.g.ham...@gmail.com [mailto:anders.g.ham...@gmail.com] Im Auftrag von Anders Hammar Gesendet: Donnerstag, 7. Januar 2010 16:32 An: Maven Users List Betreff: Re: Global dependencies report? Didn't you get my response to your mail sent on Jan 5? Did you try it? /Anders On Thu, Jan 7, 2010 at 16:26, Lewis, Eric eric.le...@ipi.ch wrote: Hi We have a company-wide parent POM where all the versions of all dependencies are managed. Now it's very handy to have the Dependency Analysis in the site for each project, but we may have some dependencies declared in the company-wide parent POM which are never used in the projects. Is there any way to find them? Is there some sort of global overall dependency analysis? Best regards, Eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Multi Module: Deploy and failing modules
Hi, how do you solve that scenario: Multi module project that I try to deploy/install after a refactoring. Unfortunately one of the later modules fails. Now I have some sort of inconsistent snapshot repository. The artifacts within are no longer compatible. I'd prefer a method that first builds all modules and then deploys them together... Sincerly, Johannes - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
AW: Multi Module: Deploy and failing modules
Hi Johannes You may want to take a look at Hudson: It builds the project and the modules, and if any of them fails, it doesn't deploy anything. Best regards, Eric -Ursprüngliche Nachricht- Von: Johannes Schneider [mailto:maili...@cedarsoft.com] Gesendet: Donnerstag, 7. Januar 2010 17:04 An: Maven Users List Betreff: Multi Module: Deploy and failing modules Hi, how do you solve that scenario: Multi module project that I try to deploy/install after a refactoring. Unfortunately one of the later modules fails. Now I have some sort of inconsistent snapshot repository. The artifacts within are no longer compatible. I'd prefer a method that first builds all modules and then deploys them together... Sincerly, Johannes - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Multi Module: Deploy and failing modules
Le Thu, 07 Jan 2010 17:04:30 +0100, Johannes Schneider maili...@cedarsoft.com a écrit : Hi, how do you solve that scenario: Multi module project that I try to deploy/install after a refactoring. Unfortunately one of the later modules fails. Now I have some sort of inconsistent snapshot repository. The artifacts within are no longer compatible. I'd prefer a method that first builds all modules and then deploys them together... You can do a mvn install and if everything is ok then do a mvn deploy ? I don't think there is another way to do it... -- Tony Chemit tél: +33 (0) 2 40 50 29 28 email: che...@codelutin.com http://www.codelutin.com - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: maven ejb plugin --- 2 client jars
Is there a way to have the plugin produce 2 client jars with different client includes or excludes for each artifact? Includes and excludes is an ugly way to do this. Is there a good reason why you can't split your ejb up into 2 separate jars? Also, how would a consuming client use a classifier in the dependency declaration to pull down one client or the other? This is one good reason to separate your project. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: AW: Multi Module: Deploy and failing modules
On 01/07/2010 05:12 PM, Lewis, Eric wrote: You may want to take a look at Hudson: It builds the project and the modules, and if any of them fails, it doesn't deploy anything. I'd like to stick with Maven. I don't want to have to configure my stuff twice... I hope this will be resolved in Maven... Best regards, Eric -Ursprüngliche Nachricht- Von: Johannes Schneider [mailto:maili...@cedarsoft.com] Gesendet: Donnerstag, 7. Januar 2010 17:04 An: Maven Users List Betreff: Multi Module: Deploy and failing modules Hi, how do you solve that scenario: Multi module project that I try to deploy/install after a refactoring. Unfortunately one of the later modules fails. Now I have some sort of inconsistent snapshot repository. The artifacts within are no longer compatible. I'd prefer a method that first builds all modules and then deploys them together... Sincerly, Johannes - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Multi Module: Deploy and failing modules
On 01/07/2010 05:14 PM, Tony Chemit wrote: You can do a mvn install and if everything is ok then do a mvn deploy ? I don't think there is another way to do it... Hmm. great... Hope somebody will fix that in Maven... - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Multi Module: Deploy and failing modules
Johannes, As far as I know you pretty much HAVE to do this as a two step process. The way I do it is first call deploy like this: mvn -DaltDeploymentRepository=repo::default::file://C:\staging-repo deploy That builds everything to a temporary maven repo that's cleaned out between builds. I then perform this on a successful build: mvn org.codehaus.mojo:wagon-maven-plugin:1.0-beta-1:merge-maven-repos -Dwagon.source=file://C:\staging-repo -Dwagon.target=file://path to mavenrepo -Djava.io.tmpdir=deploytemp It's not graceful, but it works. YMMV. I also use Hudson in a couple of places (as another poster suggested) and use it's built in deploy feature which also works nicely. -Jim -Original Message- From: Johannes Schneider [mailto:maili...@cedarsoft.com] Sent: Thursday, January 07, 2010 10:05 AM To: Maven Users List Subject: Multi Module: Deploy and failing modules Hi, how do you solve that scenario: Multi module project that I try to deploy/install after a refactoring. Unfortunately one of the later modules fails. Now I have some sort of inconsistent snapshot repository. The artifacts within are no longer compatible. I'd prefer a method that first builds all modules and then deploys them together... Sincerly, Johannes - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Bootstrapping build?
I have a build where I need to apply overrides to a dependency. What I'd like the build to do is grab the existing dependency, add the overrides, and reuse the same dependency with a different/version (same groupId artifactId). This way in my top level pom's dependency management section I could just specify that all modules (except the one creating the override version) must use the new modified version. But how can I do this because then the module applying the overrides would want to start with the new version too. What I'm thinking might work is either: 1. A bootstrapping module/plugin where I can apply the overrides first before the rest of the build really starts. 2. A plugin that can inject the new artifact into the build in such a way that other dependent modules can specify if they want to use the old/previous version or the new one. Is anything like this possible?
Maven classpath question
Hi, I'm using an older version of Maven (1.1), but hopefully this question is still relevant. I have a test module that includes this dependency in its project.xml file ... dependency groupIdcom.caucho/groupId artifactIdresin/artifactId version3.0.9/version /dependency However, when I run my JUnit test, I get the ClassNotFoundException below. The reason it is strange is because that class exists within the dependency above. Can you think of some ways I can troubleshoot this problem further? Thanks, - Dave javax.naming.NoInitialContextException: Cannot instantiate class: com.caucho.naming.InitialContextFactoryImpl [Root exception is java.lang.ClassNotFoundException: com.caucho.naming.InitialContextFactoryImpl] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.init(InitialContext.java:175) at com.caucho.naming.Jndi.bindDeep(Jndi.java:57) at com.caucho.loader.EnvironmentClassLoader.initializeEnvironment(EnvironmentClassLoader.java:435) at com.caucho.loader.EnvironmentClassLoader.init(EnvironmentClassLoader.java:107) at com.caucho.java.InternalCompiler.executeInt(InternalCompiler.java:138) at com.caucho.java.InternalCompiler.compileInt(InternalCompiler.java:78) at com.caucho.java.AbstractJavaCompiler.run(AbstractJavaCompiler.java:101) at java.lang.Thread.run(Thread.java:613) Caused by: java.lang.ClassNotFoundException: com.caucho.naming.InitialContextFactoryImpl at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:316) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654) ... 10 more -- View this message in context: http://old.nabble.com/Maven-classpath-question-tp27066744p27066744.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven classpath question
However, when I run my JUnit test, I get the ClassNotFoundException below. The reason it is strange is because that class exists within the dependency above. Can you think of some ways I can troubleshoot this problem further? Download the jar and verify this file is inside the Jar before doing anything else. I've seen similar things posted on this list more than once, and several times it turned out the Jar simply did not contain the class file(s) they thought it did... Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Thanks
Thanks -- View this message in context: http://old.nabble.com/Thanks-tp27072139p27072139.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org