Repository: camel Updated Branches: refs/heads/master 6e845a537 -> fcf63a214
CAMEL-7844: Fix the broken OSGi tests as well as polish the codebase a bit Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fcf63a21 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fcf63a21 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fcf63a21 Branch: refs/heads/master Commit: fcf63a21447b5fbb2b4476479218f880f3ebe394 Parents: 6e845a5 Author: Babak Vahdat <[email protected]> Authored: Sat Nov 29 23:56:59 2014 +0100 Committer: Babak Vahdat <[email protected]> Committed: Sat Nov 29 23:56:59 2014 +0100 ---------------------------------------------------------------------- parent/pom.xml | 2 +- tests/camel-itest-osgi/pom.xml | 13 +++++-------- .../camel/itest/osgi/core/log/LogRouteTest.java | 4 ++-- .../log/LogRouteWithLoggersPresentInRegistryTest.java | 14 ++++++-------- .../core/log/LogRouteWithNonDefaultLoggerTest.java | 14 ++++++-------- .../camel/itest/osgi/util/jsse/JsseUtilTest.java | 2 +- 6 files changed, 21 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/fcf63a21/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index abd987c..6bd2c28 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -279,7 +279,7 @@ <jt400-bundle-version>6.7_1</jt400-bundle-version> <juel-bundle-version>2.1.3_1</juel-bundle-version> <juel-version>2.1.3</juel-version> - <junit-bundle-version>4.11_1</junit-bundle-version> + <junit-bundle-version>4.11_2</junit-bundle-version> <junit-version>4.11</junit-version> <jython-version>2.5.3</jython-version> <jzlib-version>1.1.3</jzlib-version> http://git-wip-us.apache.org/repos/asf/camel/blob/fcf63a21/tests/camel-itest-osgi/pom.xml ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/pom.xml b/tests/camel-itest-osgi/pom.xml index 9d19ab6..c51f199 100644 --- a/tests/camel-itest-osgi/pom.xml +++ b/tests/camel-itest-osgi/pom.xml @@ -29,14 +29,6 @@ <name>Camel :: Integration Tests :: OSGi</name> <description>Performs OSGi compliance integration tests</description> - <repositories> - <!--repository> - <id>hapi</id> - <name>HAPI Maven Repository</name> - <url>http://hl7api.sourceforge.net/m2/</url> - </repository--> - </repositories> - <dependencies> <dependency> <groupId>org.osgi</groupId> @@ -199,6 +191,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-netty</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-hazelcast</artifactId> <scope>test</scope> </dependency> http://git-wip-us.apache.org/repos/asf/camel/blob/fcf63a21/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java index 160d6b0..40718af 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java @@ -43,9 +43,9 @@ public class LogRouteTest extends OSGiIntegrationTestSupport { public void testSendMessageToBadLevel() throws Exception { try { template.sendBody("log:org.apache.camel.TEST?level=noSuchLevel", "<level>noSuchLevel</level>"); - fail("Shoudl have failed!"); + fail("Should have failed!"); } catch (Exception e) { - LOG.debug("Caught expected exception: " + e, e); + LOG.debug("Caught the expected exception: {}", e); } } http://git-wip-us.apache.org/repos/asf/camel/blob/fcf63a21/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java index fcb473e..7de66a7 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithLoggersPresentInRegistryTest.java @@ -33,8 +33,6 @@ import org.ops4j.pax.exam.karaf.options.DoNotModifyLogOption; import org.ops4j.pax.exam.karaf.options.KarafDistributionConfigurationFileReplacementOption; import org.slf4j.LoggerFactory; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.not; import static org.ops4j.pax.exam.OptionUtils.combine; @RunWith(PaxExam.class) @@ -48,8 +46,8 @@ public class LogRouteWithLoggersPresentInRegistryTest extends OSGiIntegrationTes File logDir = new File(System.getProperty("karaf.base"), "data/log"); File[] files = logDir.listFiles(); - assertThat(files.length, equalTo(1)); - assertThat(files[0].getName(), equalTo(bundleContext.getBundle().getSymbolicName() + ".log")); + assertEquals(1, files.length); + assertEquals(bundleContext.getBundle().getSymbolicName() + ".log", files[0].getName()); } @Test @@ -60,8 +58,8 @@ public class LogRouteWithLoggersPresentInRegistryTest extends OSGiIntegrationTes File logDir = new File(System.getProperty("karaf.base"), "data/log"); File[] files = logDir.listFiles(); - assertThat(files.length, equalTo(1)); - assertThat(files[0].getName(), not(equalTo(bundleContext.getBundle().getSymbolicName() + ".log"))); + assertEquals(1, files.length); + assertNotEquals(bundleContext.getBundle().getSymbolicName() + ".log", files[0].getName()); } @Override @@ -71,8 +69,8 @@ public class LogRouteWithLoggersPresentInRegistryTest extends OSGiIntegrationTes @Override protected CamelContext createCamelContext() throws Exception { - LOG.info("Get the bundleContext is " + bundleContext); - LOG.info("Application installed as bundle id: " + bundleContext.getBundle().getBundleId()); + LOG.info("Get the bundleContext is {}", bundleContext); + LOG.info("Application installed as bundle id: {}", bundleContext.getBundle().getBundleId()); setThreadContextClassLoader(); http://git-wip-us.apache.org/repos/asf/camel/blob/fcf63a21/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java index a3f729f..0c61013 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteWithNonDefaultLoggerTest.java @@ -31,8 +31,6 @@ import org.ops4j.pax.exam.karaf.options.DoNotModifyLogOption; import org.ops4j.pax.exam.karaf.options.KarafDistributionConfigurationFileReplacementOption; import org.slf4j.LoggerFactory; - -import static org.hamcrest.CoreMatchers.equalTo; import static org.ops4j.pax.exam.OptionUtils.combine; @RunWith(PaxExam.class) @@ -46,8 +44,8 @@ public class LogRouteWithNonDefaultLoggerTest extends OSGiIntegrationTestSupport File logDir = new File(System.getProperty("karaf.base"), "data/log"); File[] files = logDir.listFiles(); - assertThat(files.length, equalTo(1)); - assertThat(files[0].getName(), equalTo(bundleContext.getBundle().getSymbolicName() + ".log")); + assertEquals(1, files.length); + assertEquals(bundleContext.getBundle().getSymbolicName() + ".log", files[0].getName()); } @Test @@ -58,8 +56,8 @@ public class LogRouteWithNonDefaultLoggerTest extends OSGiIntegrationTestSupport File logDir = new File(System.getProperty("karaf.base"), "data/log"); File[] files = logDir.listFiles(); - assertThat(files.length, equalTo(1)); - assertThat(files[0].getName(), equalTo(bundleContext.getBundle().getSymbolicName() + ".log")); + assertEquals(1, files.length); + assertEquals(bundleContext.getBundle().getSymbolicName() + ".log", files[0].getName()); } @Override @@ -69,8 +67,8 @@ public class LogRouteWithNonDefaultLoggerTest extends OSGiIntegrationTestSupport @Override protected CamelContext createCamelContext() throws Exception { - LOG.info("Get the bundleContext is " + bundleContext); - LOG.info("Application installed as bundle id: " + bundleContext.getBundle().getBundleId()); + LOG.info("Get the bundleContext is {}", bundleContext); + LOG.info("Application installed as bundle id: {}", bundleContext.getBundle().getBundleId()); setThreadContextClassLoader(); http://git-wip-us.apache.org/repos/asf/camel/blob/fcf63a21/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/util/jsse/JsseUtilTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/util/jsse/JsseUtilTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/util/jsse/JsseUtilTest.java index d37d2d0..a067056 100644 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/util/jsse/JsseUtilTest.java +++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/util/jsse/JsseUtilTest.java @@ -74,7 +74,7 @@ public class JsseUtilTest extends OSGiIntegrationSpringTestSupport { assertNotNull(ks.getCertificate("server")); File file = new File("../../../test-classes/org/apache/camel/itest/osgi/util/jsse/localhost.ks"); - LOG.info("the file is " + file.getAbsolutePath()); + LOG.info("the file is {}", file.getAbsolutePath()); ksp.setResource(file.getAbsolutePath()); ks = ksp.createKeyStore(); assertNotNull(ks.getCertificate("server"));
