Using Maven build helper to attach core test code to Netty code
</dependencies>
<build>
- <testSourceDirectory>${project.build.directory}/test-sources</testSourceDirectory>
- <testResources>
- <testResource>
- <directory>${project.build.directory}/test-resources</directory>
- </testResource>
- </testResources>
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
- <id>copy-test-resources</id>
- <phase>generate-test-resources</phase>
+ <id>add-test-source</id>
+ <phase>generate-test-sources</phase>
<goals>
- <goal>copy-resources</goal>
+ <goal>add-test-source</goal>
</goals>
<configuration>
- <outputDirectory>${project.build.directory}/test-resources</outputDirectory>
- <resources>
- <resource>
- <directory>${projectRoot}/sshd-core/src/test/resources</directory>
- </resource>
- </resources>
+ <sources>
+ <source>${projectRoot}/sshd-core/src/test/java</source>
+ </sources>
</configuration>
</execution>
<execution>
- <id>copy-test-sources</id>
- <phase>generate-test-sources</phase>
+ <id>add-test-resource</id>
+ <phase>generate-test-resources</phase>
<goals>
- <goal>copy-resources</goal>
+ <goal>add-test-resource</goal>
</goals>
<configuration>
- <outputDirectory>${project.build.directory}/test-sources</outputDirectory>
<resources>
<resource>
- <directory>${projectRoot}/sshd-core/src/test/java</directory>
- <excludes>
- <exclude>**/ProxyTest.java</exclude>
- <exclude>**/PortForwardingTest.java</exclude>
- <exclude>**/PortForwardingLoadTest.java</exclude>
- </excludes>
+ <directory>${projectRoot}/sshd-core/src/test/resources</directory>
+ <targetPath>${project.build.testOutputDirectory}</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <testExcludes>
+ <!-- These tests use MINA explicitly -->
+ <testExclude>**/PortForwarding*Test.java</testExclude>
+ <testExclude>**/ProxyTest.java</testExclude>
+ </testExcludes>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<org.apache.sshd.common.io.IoServiceFactoryFactory>org.apache.sshd.netty.NettyIoServiceFactoryFactory</org.apache.sshd.common.io.IoServiceFactoryFactory>
</systemProperties>
<excludes>
- <!-- These tests use NIO explicitly -->
+ <!-- These tests use NIO and/or MINA explicitly -->
<exclude>**/*LoadTest.java</exclude>
+ <exclude>**/PortForwarding*Test.java</exclude>
<exclude>**/ProxyTest.java</exclude>
<exclude>**/Nio2ServiceTest.java</exclude>
- <!-- TODO need some more research as to why this fails on MINA but not on NIO2 -->
+
+ <!-- TODO need some more research as to why this fails on Netty but not on NIO2 -->
<exclude>**/ClientDeadlockTest.java</exclude>
<exclude>**/ApacheServer*Test.java</exclude>
<exclude>**/ClientTest.java</exclude>
