Repository: karaf Updated Branches: refs/heads/master f03f84587 -> 0be7b13b1
Deploy hamcrest and awaitility and fix ConfigTest Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/0be7b13b Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/0be7b13b Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/0be7b13b Branch: refs/heads/master Commit: 0be7b13b1e978bcdaa53273d248006ec0b9f686c Parents: 4b42986 Author: Christian Schneider <[email protected]> Authored: Thu May 18 14:25:25 2017 +0200 Committer: Christian Schneider <[email protected]> Committed: Thu May 18 14:46:21 2017 +0200 ---------------------------------------------------------------------- itests/pom.xml | 6 ++++++ itests/src/test/java/org/apache/karaf/itests/ConfigTest.java | 8 ++++---- itests/src/test/java/org/apache/karaf/itests/JmsTest.java | 4 +--- .../test/java/org/apache/karaf/itests/KarafTestSupport.java | 4 ++++ 4 files changed, 15 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/0be7b13b/itests/pom.xml ---------------------------------------------------------------------- diff --git a/itests/pom.xml b/itests/pom.xml index 6f16ab9..d624d2c 100644 --- a/itests/pom.xml +++ b/itests/pom.xml @@ -117,6 +117,12 @@ <groupId>org.awaitility</groupId> <artifactId>awaitility</artifactId> </dependency> + <dependency> + <groupId>org.apache.servicemix.bundles</groupId> + <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId> + <version>1.3_1</version> + <scope>runtime</scope> + </dependency> <dependency> <groupId>org.apache.karaf.features</groupId> http://git-wip-us.apache.org/repos/asf/karaf/blob/0be7b13b/itests/src/test/java/org/apache/karaf/itests/ConfigTest.java ---------------------------------------------------------------------- diff --git a/itests/src/test/java/org/apache/karaf/itests/ConfigTest.java b/itests/src/test/java/org/apache/karaf/itests/ConfigTest.java index 39bc83e..4b24d60 100644 --- a/itests/src/test/java/org/apache/karaf/itests/ConfigTest.java +++ b/itests/src/test/java/org/apache/karaf/itests/ConfigTest.java @@ -13,10 +13,10 @@ */ package org.apache.karaf.itests; -import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasKey; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; import java.lang.management.ManagementFactory; import java.util.List; @@ -51,10 +51,10 @@ public class ConfigTest extends KarafTestSupport { MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName("org.apache.karaf:type=config,name=root"); List<String> configs = (List<String>) mbeanServer.getAttribute(name, "Configs"); - assertThat(configs, contains("org.apache.karaf.features")); + assertThat(configs, hasItem("org.apache.karaf.features")); Map<String, String> properties = (Map<String, String>) mbeanServer .invoke(name, "listProperties", new Object[]{"org.apache.karaf.features"}, new String[]{"java.lang.String"}); - assertTrue(properties.keySet().size() > 0); + assertThat(properties, hasKey("featuresRepositories")); } } http://git-wip-us.apache.org/repos/asf/karaf/blob/0be7b13b/itests/src/test/java/org/apache/karaf/itests/JmsTest.java ---------------------------------------------------------------------- diff --git a/itests/src/test/java/org/apache/karaf/itests/JmsTest.java b/itests/src/test/java/org/apache/karaf/itests/JmsTest.java index 7d51bde..f0068de 100644 --- a/itests/src/test/java/org/apache/karaf/itests/JmsTest.java +++ b/itests/src/test/java/org/apache/karaf/itests/JmsTest.java @@ -22,7 +22,6 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.composite; import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; import java.io.IOException; @@ -65,8 +64,7 @@ public class JmsTest extends KarafTestSupport { return new Option[] // { composite(super.config()), // - features(activeMqUrl, "jms", "activemq-broker-noweb"), - mavenBundle().groupId("org.awaitility").artifactId("awaitility").versionAsInProject() + features(activeMqUrl, "jms", "activemq-broker-noweb") }; } http://git-wip-us.apache.org/repos/asf/karaf/blob/0be7b13b/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java ---------------------------------------------------------------------- diff --git a/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java b/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java index e630f4a..009431e 100644 --- a/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java +++ b/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java @@ -15,6 +15,7 @@ package org.apache.karaf.itests; import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.maven; +import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureSecurity; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; @@ -66,6 +67,7 @@ import org.junit.runner.Description; import org.junit.runners.model.Statement; import org.ops4j.pax.exam.Configuration; +import org.ops4j.pax.exam.CoreOptions; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.ProbeBuilder; import org.ops4j.pax.exam.RerunTestException; @@ -195,6 +197,8 @@ public class KarafTestSupport { configureSecurity().disableKarafMBeanServerBuilder(), keepRuntimeFolder(), logLevel(LogLevel.INFO), + mavenBundle().groupId("org.awaitility").artifactId("awaitility").versionAsInProject(), + mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(), replaceConfigurationFile("etc/org.ops4j.pax.logging.cfg", getConfigFile("/etc/org.ops4j.pax.logging.cfg")), editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "updateSnapshots", "none"), editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", httpPort),
