Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven not running Spring Integration Samples

 
Kaspar Christenson
Greenhorn
Posts: 21
Mac Scala VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to run the FeedInboundChannelAdapterSample from the SpringSource-spring-integration-samples distribution.
When I run 'mvn test' it says There are no tests to run.
There's a method with the @Test annotation so why isn't mvn running this test?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that isn't a Spring question, it is a Maven question. Maybe the maven pom file isn't running tests, maybe it was run with your settings file having running tests not run them. Maybe the Test class isn't in the test directory that Maven is looking at.

Have you tried just running the test in your IDE? That is how I run all my tests.

I am going to move this to the Maven forum.

Thanks

Mark
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you tests defined? By default, the Surefire plugin runs tests that it finds in the src/test/java directory, and it only runs tests whose classnames begin or end with "Test". Thus, tests in this class would be run:

src/test/java/my/package/SomeTest.java

but tests in this class would not be run:

src/test/java/my/package/SomeTests.java

Check the "includes" parameters here: http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html
 
Kaspar Christenson
Greenhorn
Posts: 21
Mac Scala VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't write the test or the code. I'm just trying to run the a sample program provided in the SpringSource distribution of Spring Integration Samples.
I was hoping the someone else on the Spring Forum might know if these samples run as is or if they need tweaking.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kaspar

As indicated by Peter, where does the test class reside and what is it called?
 
Kaspar Christenson
Greenhorn
Posts: 21
Mac Scala VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The accursed class is in src/test/java/somepackage/FeedInboundChannelAdapterSample.java
It doesn't have Test or Tests in the name.

So I can either change the name of the class or configure the plugin in the pom?
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<includes>
<include>**/*Sample.java</include>
</includes>
</configuration>
</plugin>
</plugins>

I don't know squat about maven. Thanks for the help.
 
H Paul
Ranch Hand
Posts: 471
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Keep the source code downloaded as is.
2. Just rename public class FeedInboundChannelAdapterSample to public class FeedInboundChannelAdapterSampleTest
3. mvn test.

(P:S: I just happened and wanted to learn SI. and maven as well :-D)

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Caspar, yes either of your solutions would work. But as H indicated, renaming the class is probably the easiest.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic