• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maven not running Spring Integration Samples

 
Greenhorn
Posts: 21
Mac Scala VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1051
5
Hibernate Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Caspar, yes either of your solutions would work. But as H indicated, renaming the class is probably the easiest.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic