Repository: brooklyn-server Updated Branches: refs/heads/master a2148becf -> 56f7258e8
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java deleted file mode 100644 index 14ec1d2..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/AssemblyTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn; - -import static org.apache.brooklyn.KarafTestUtils.defaultOptionsWith; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import javax.inject.Inject; - -import org.apache.karaf.features.BootFinished; -import org.apache.karaf.features.FeaturesService; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.ops4j.pax.exam.util.Filter; -import org.osgi.framework.BundleContext; - -/** - * Tests the apache-brooklyn karaf runtime assembly. - * - * Keeping it a non-integration test so we have at least a basic OSGi sanity check. (takes 14 sec) - */ -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class AssemblyTest { - - @Inject - private BundleContext bc; - - @Inject - @Filter(timeout = 120000) - protected FeaturesService featuresService; - - /** - * To make sure the tests run only when the boot features are fully - * installed - */ - @Inject - @Filter(timeout = 120000) - BootFinished bootFinished; - - @Configuration - public static Option[] configuration() throws Exception { - return defaultOptionsWith( - // Uncomment this for remote debugging the tests on port 5005 - // KarafDistributionOption.debugConfiguration() - ); - } - - @Test - public void shouldHaveBundleContext() { - assertNotNull(bc); - } - - @Test - public void checkEventFeature() throws Exception { - assertTrue(featuresService.isInstalled(featuresService.getFeature("eventadmin"))); - } - - @Test - public void checkBrooklynCoreFeature() throws Exception { - featuresService.installFeature("brooklyn-core"); - assertTrue(featuresService.isInstalled(featuresService.getFeature("brooklyn-core"))); - } - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/KarafTestUtils.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/KarafTestUtils.java b/karaf/itest/src/test/java/org/apache/brooklyn/KarafTestUtils.java deleted file mode 100644 index d8920ef..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/KarafTestUtils.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn; - -import static org.ops4j.pax.exam.CoreOptions.junitBundles; -import static org.ops4j.pax.exam.CoreOptions.maven; -import static org.ops4j.pax.exam.MavenUtils.asInProject; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; - -import java.io.File; - -import org.apache.brooklyn.util.text.Identifiers; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel; -import org.ops4j.pax.exam.options.MavenArtifactUrlReference; -import org.ops4j.pax.exam.options.MavenUrlReference; - -import com.google.common.collect.ObjectArrays; - -public class KarafTestUtils { - public static final Option[] DEFAULT_OPTIONS = { - karafDistributionConfiguration() - .frameworkUrl(brooklynKarafDist()) - .unpackDirectory(new File("target/paxexam/unpack/")) - .useDeployFolder(false), - configureConsole().ignoreLocalConsole(), - logLevel(LogLevel.INFO), - features(karafStandardFeaturesRepository(), "eventadmin"), - junitBundles(), - editConfigurationFilePut("etc/org.apache.brooklyn.osgilauncher.cfg", "persistMode", "AUTO"), - editConfigurationFilePut("etc/org.apache.brooklyn.osgilauncher.cfg", "persistenceDir", new File("target/paxexam/persistence/" + Identifiers.makeRandomId(6) + "/").getAbsolutePath()), - }; - - public static MavenUrlReference karafStandardFeaturesRepository() { - return maven() - .groupId("org.apache.karaf.features") - .artifactId("standard") - .type("xml") - .classifier("features") - .version(asInProject()); - } - - - public static MavenArtifactUrlReference brooklynKarafDist() { - return maven() - .groupId("org.apache.brooklyn") - .artifactId("apache-brooklyn") - .type("zip") - .version(asInProject()); - } - - public static Option[] defaultOptionsWith(Option... options) { - return ObjectArrays.concat(DEFAULT_OPTIONS, options, Option.class); - } - - public static MavenUrlReference brooklynFeaturesRepository() { - return maven() - .groupId("org.apache.brooklyn") - .artifactId("brooklyn-features") - .type("xml") - .classifier("features") - .versionAsInProject(); - } -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScannerTest.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScannerTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScannerTest.java deleted file mode 100644 index 39f959c..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/CatalogBomScannerTest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.core.catalog.internal; - -import org.apache.brooklyn.api.catalog.CatalogItem; -import org.apache.brooklyn.api.mgmt.ManagementContext; -import org.apache.brooklyn.core.BrooklynVersion; -import org.apache.brooklyn.test.Asserts; -import org.apache.brooklyn.test.IntegrationTest; -import org.apache.brooklyn.util.collections.MutableMap; -import org.apache.brooklyn.util.time.Duration; -import org.apache.karaf.features.BootFinished; -import org.apache.karaf.features.FeaturesService; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerMethod; -import org.ops4j.pax.exam.util.Filter; -import org.osgi.service.cm.ConfigurationAdmin; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.inject.Inject; - -import java.util.Dictionary; - -import static org.apache.brooklyn.KarafTestUtils.defaultOptionsWith; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerMethod.class) -public class CatalogBomScannerTest { - - private static final Logger LOG = LoggerFactory.getLogger(CatalogBomScannerTest.class); - public static final String KARAF_INIT_BLUEPRINT_BOMSCANNER_PID = "org.apache.brooklyn.core.catalog.bomscanner"; - - @Inject - @Filter(timeout = 120000) - protected FeaturesService featuresService; - - @Inject - @Filter(timeout = 120000) - protected ConfigurationAdmin configAdmin; - - @Inject - @Filter(timeout = 120000) - protected ManagementContext managementContext; - - /** - * To make sure the tests run only when the boot features are fully - * installed - */ - @Inject - @Filter(timeout = 120000) - BootFinished bootFinished; - - - @Configuration - public static Option[] configuration() throws Exception { - return defaultOptionsWith( - // Uncomment this for remote debugging the tests on port 5005 -// , KarafDistributionOption.debugConfiguration() - ); - } - - @Test - @Category(IntegrationTest.class) - public void shouldFindWebAppCatalogExampleOnlyAfterItsFeatureIsInstalled() throws Exception { - - final CatalogItem<?, ?> catalogItem = managementContext.getCatalog() - .getCatalogItem("load-balancer", BrooklynVersion.get()); // from brooklyn-software-webapp - assertNull(catalogItem); - - featuresService.installFeature("brooklyn-software-webapp", BrooklynVersion.get()); - - Asserts.succeedsEventually(MutableMap.of("timeout", Duration.TEN_SECONDS), new Runnable() { - @Override - public void run() { - final CatalogItem<?, ?> lb = managementContext.getCatalog() - .getCatalogItem("load-balancer", BrooklynVersion.get()); - assertNotNull(lb); - } - }); - } - - @Test - @Category(IntegrationTest.class) - public void shouldNotFindNoSqlCatalogExampleIfItIsBlacklisted() throws Exception { - - // verify no NoSQL entities are loaded yet - final String riakTemplate = "bash-web-and-riak-template"; // from brooklyn-software-nosql - CatalogItem<?, ?> catalogItem = getCatalogItem(riakTemplate); - assertNull(catalogItem); - - final String redisStore = "org.apache.brooklyn.entity.nosql.redis.RedisStore"; // ditto - catalogItem = getCatalogItem(redisStore); - assertNull(catalogItem); - - // blacklist the org.apache.brooklyn.software-nosql bundle - final org.osgi.service.cm.Configuration bomScannerConfig = - configAdmin.getConfiguration(KARAF_INIT_BLUEPRINT_BOMSCANNER_PID); - final Dictionary<String, Object> bomProps = bomScannerConfig.getProperties(); - assertEquals(".*", bomProps.get("whiteList")); - assertEquals("", bomProps.get("blackList")); - - bomProps.put("blackList", ".*nosql.*"); - bomScannerConfig.update(bomProps); - - // install the NoSQL feature - featuresService.installFeature("brooklyn-software-nosql", BrooklynVersion.get()); - - // verify that the non-template entity org.apache.brooklyn.entity.nosql.redis.RedisStore gets added to catalog - verifyCatalogItemEventually(redisStore, true); - - // verify that the template application hasn't made it into the catalog (because it's blacklisted) - catalogItem = getCatalogItem(riakTemplate); - assertNull(catalogItem); - - // For completeness let's uninstall the bundle, un-blacklist nosql, and install again - featuresService.uninstallFeature("brooklyn-software-nosql", BrooklynVersion.get()); - - // verify it's gone away - verifyCatalogItemEventually(redisStore, false); - - // un-blacklist nosql - bomProps.put("blackList", ""); - bomScannerConfig.update(bomProps); - - // install it again - featuresService.installFeature("brooklyn-software-nosql", BrooklynVersion.get()); - - // now the application should make it into the catalog - verifyCatalogItemEventually(redisStore, true); - - } - - private void verifyCatalogItemEventually(final String redisStore, final boolean isItThere) { - Asserts.succeedsEventually(MutableMap.of("timeout", Duration.TEN_SECONDS), new Runnable() { - @Override - public void run() { - final CatalogItem<?, ?> redis = getCatalogItem(redisStore); - assertEquals(null != redis, isItThere); - } - }); - } - - private CatalogItem<?, ?> getCatalogItem(String itemName) { - return managementContext.getCatalog().getCatalogItem(itemName, BrooklynVersion.get()); - } - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/DefaultBomLoadTest.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/DefaultBomLoadTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/DefaultBomLoadTest.java deleted file mode 100644 index 31d500e..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/core/catalog/internal/DefaultBomLoadTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.core.catalog.internal; - - -import org.apache.brooklyn.api.catalog.CatalogItem; -import org.apache.brooklyn.api.mgmt.ManagementContext; -import org.apache.brooklyn.core.BrooklynVersion; -import org.apache.brooklyn.test.IntegrationTest; -import org.apache.karaf.features.BootFinished; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerMethod; -import org.ops4j.pax.exam.util.Filter; - -import javax.inject.Inject; - -import static org.apache.brooklyn.KarafTestUtils.defaultOptionsWith; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerMethod.class) -@Category(IntegrationTest.class) -public class DefaultBomLoadTest { - - /** - * To make sure the tests run only when the boot features are fully installed - */ - @Inject - @Filter(timeout = 120000) - BootFinished bootFinished; - - @Inject - @Filter(timeout = 120000) - protected ManagementContext managementContext; - - - @Configuration - public static Option[] configuration() throws Exception { - return defaultOptionsWith( - // Uncomment this for remote debugging the tests on port 5005 -// , KarafDistributionOption.debugConfiguration() - ); - } - - - @Test - @Category(IntegrationTest.class) - public void shouldHaveLoadedDefaultCatalogBom() throws Exception { - final CatalogItem<?, ?> catalogItem = managementContext.getCatalog() - .getCatalogItem("server-template", BrooklynVersion.get()); // from brooklyn-software-base catalog.bom - assertNotNull(catalogItem); - assertEquals("Template: Server", catalogItem.getDisplayName()); - } -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java deleted file mode 100644 index b825112..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.launcher.osgi; - -import static org.apache.brooklyn.KarafTestUtils.defaultOptionsWith; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; - -import java.io.IOException; - -import javax.inject.Inject; - -import org.apache.brooklyn.KarafTestUtils; -import org.apache.brooklyn.api.mgmt.ManagementContext; -import org.apache.brooklyn.test.Asserts; -import org.apache.brooklyn.test.IntegrationTest; -import org.apache.karaf.features.BootFinished; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.ops4j.pax.exam.util.Filter; -import org.osgi.service.cm.ConfigurationAdmin; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -@Category(IntegrationTest.class) -public class OsgiLauncherTest { - - private static final String TEST_VALUE_RUNTIME = "test.value"; - private static final String TEST_KEY_RUNTIME = "test.key"; - private static final String TEST_VALUE_IN_CFG = "test.cfg"; - private static final String TEST_KEY_IN_CFG = "test.key.in.cfg"; - - @Inject - @Filter(timeout = 120000) - protected ManagementContext mgmt; - - @Inject - @Filter(timeout = 120000) - protected ConfigurationAdmin configAdmin; - - /** - * To make sure the tests run only when the boot features are fully - * installed - */ - @Inject - @Filter(timeout = 120000) - BootFinished bootFinished; - - @Configuration - public static Option[] configuration() throws Exception { - return defaultOptionsWith( - editConfigurationFilePut("etc/org.apache.brooklyn.osgilauncher.cfg", "globalBrooklynPropertiesFile", ""), - editConfigurationFilePut("etc/org.apache.brooklyn.osgilauncher.cfg", "localBrooklynPropertiesFile", ""), - editConfigurationFilePut("etc/brooklyn.cfg", TEST_KEY_IN_CFG, TEST_VALUE_IN_CFG), - features(KarafTestUtils.brooklynFeaturesRepository(), "brooklyn-osgi-launcher") - // Uncomment this for remote debugging the tests on port 5005 - // ,KarafDistributionOption.debugConfiguration() - ); - } - - @Test - public void testConfig() throws IOException { - assertFalse(mgmt.getConfig().getAllConfig().containsKey(TEST_KEY_RUNTIME)); - org.osgi.service.cm.Configuration config = configAdmin.getConfiguration("brooklyn", null); - assertEquals(config.getProperties().get(TEST_KEY_IN_CFG), TEST_VALUE_IN_CFG); - config.getProperties().put(TEST_KEY_RUNTIME, TEST_VALUE_RUNTIME); - config.update(); - Asserts.succeedsEventually(new Runnable() { - @Override - public void run() { - assertEquals(TEST_VALUE_RUNTIME, mgmt.getConfig().getFirst(TEST_KEY_RUNTIME)); - } - }); - } -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTest.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTest.java deleted file mode 100644 index f182f98..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/rest/BrooklynRestApiLauncherTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.rest; - -import static org.apache.brooklyn.KarafTestUtils.defaultOptionsWith; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut; -import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features; - -import java.util.concurrent.Callable; - -import org.apache.brooklyn.KarafTestUtils; -import org.apache.brooklyn.entity.brooklynnode.BrooklynNode; -import org.apache.brooklyn.test.Asserts; -import org.apache.brooklyn.util.http.HttpAsserts; -import org.apache.brooklyn.util.http.HttpTool; -import org.apache.http.HttpStatus; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -@Ignore // TODO: re-enable after brooklyn is properly initialized within the OSGI environment -public class BrooklynRestApiLauncherTest { - - private static final String HTTP_PORT = "9998"; - private static final String ROOT_URL = "http://localhost:" + HTTP_PORT; - - @Configuration - public static Option[] configuration() throws Exception { - return defaultOptionsWith( - editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", HTTP_PORT), - features(KarafTestUtils.brooklynFeaturesRepository(), "brooklyn-software-base") - // Uncomment this for remote debugging the tests on port 5005 - // ,KarafDistributionOption.debugConfiguration() - ); - } - - @Test - public void testStart() throws Exception { - ensureBrooklynStarted(); - - final String testUrl = ROOT_URL + "/v1/catalog/entities"; - int code = Asserts.succeedsEventually(new Callable<Integer>() { - @Override - public Integer call() throws Exception { - int code = HttpTool.getHttpStatusCode(testUrl); - if (code == HttpStatus.SC_FORBIDDEN) { - throw new RuntimeException("Retry request"); - } else { - return code; - } - } - }); - HttpAsserts.assertHealthyStatusCode(code); - HttpAsserts.assertContentContainsText(testUrl, BrooklynNode.class.getSimpleName()); - } - - private void ensureBrooklynStarted() { - final String upUrl = ROOT_URL + "/v1/server/up"; - HttpAsserts.assertContentEventuallyMatches(upUrl, "true"); - } -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/security/CustomSecurityProvider.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/security/CustomSecurityProvider.java b/karaf/itest/src/test/java/org/apache/brooklyn/security/CustomSecurityProvider.java deleted file mode 100644 index ca9ac0e..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/security/CustomSecurityProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.security; - -import javax.servlet.http.HttpSession; - -import org.apache.brooklyn.rest.security.provider.AbstractSecurityProvider; -import org.apache.brooklyn.rest.security.provider.SecurityProvider; - -public class CustomSecurityProvider extends AbstractSecurityProvider implements SecurityProvider { - - @Override - public boolean authenticate(HttpSession session, String user, String password) { - return "custom".equals(user); - } - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/security/CustomSecurityProviderTest.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/security/CustomSecurityProviderTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/security/CustomSecurityProviderTest.java deleted file mode 100644 index 3856c80..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/security/CustomSecurityProviderTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.security; - -import static org.apache.brooklyn.KarafTestUtils.defaultOptionsWith; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertEquals; -import static org.ops4j.pax.exam.CoreOptions.streamBundle; - -import java.io.IOException; - -import javax.inject.Inject; -import javax.security.auth.Subject; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.FailedLoginException; -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -import org.apache.brooklyn.api.mgmt.ManagementContext; -import org.apache.brooklyn.core.internal.BrooklynProperties; -import org.apache.brooklyn.rest.BrooklynWebConfig; -import org.apache.brooklyn.rest.security.jaas.BrooklynLoginModule; -import org.apache.brooklyn.test.Asserts; -import org.apache.brooklyn.test.IntegrationTest; -import org.apache.karaf.features.BootFinished; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.ops4j.pax.exam.util.Filter; -import org.ops4j.pax.tinybundles.core.TinyBundles; -import org.osgi.framework.Constants; - -import com.google.common.collect.ImmutableSet; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -@Category(IntegrationTest.class) -public class CustomSecurityProviderTest { - private static final String WEBCONSOLE_REALM = "webconsole"; - - /** - * To make sure the tests run only when the boot features are fully - * installed - */ - @Inject - @Filter(timeout = 120000) - BootFinished bootFinished; - - @Inject - @Filter(timeout = 120000) - ManagementContext managementContext; - - @Configuration - public static Option[] configuration() throws Exception { - return defaultOptionsWith( - streamBundle(TinyBundles.bundle() - .add(CustomSecurityProvider.class) - .add("OSGI-INF/blueprint/security.xml", CustomSecurityProviderTest.class.getResource("/custom-security-bp.xml")) - .set(Constants.BUNDLE_MANIFESTVERSION, "2") // defaults to 1 which doesn't work - .set(Constants.BUNDLE_SYMBOLICNAME, "org.apache.brooklyn.test.security") - .set(Constants.BUNDLE_VERSION, "1.0.0") - .set(Constants.DYNAMICIMPORT_PACKAGE, "*") - .set(Constants.EXPORT_PACKAGE, CustomSecurityProvider.class.getPackage().getName()) - .build()) - // Uncomment this for remote debugging the tests on port 5005 - // ,KarafDistributionOption.debugConfiguration() - ); - } - - @Before - public void setUp() { - // Works only before initializing the security provider (i.e. before first use) - // TODO Dirty hack to inject the needed properties. Improve once managementContext is configurable. - // Alternatively re-register a test managementContext service (how?) - BrooklynProperties brooklynProperties = (BrooklynProperties)managementContext.getConfig(); - brooklynProperties.put(BrooklynWebConfig.SECURITY_PROVIDER_CLASSNAME.getName(), CustomSecurityProvider.class.getCanonicalName()); - } - - @Test(expected = FailedLoginException.class) - public void checkLoginFails() throws LoginException { - assertRealmRegisteredEventually(WEBCONSOLE_REALM); - doLogin("invalid", "auth"); - } - - @Test - public void checkLoginSucceeds() throws LoginException { - assertRealmRegisteredEventually(WEBCONSOLE_REALM); - String user = "custom"; - LoginContext lc = doLogin(user, "password"); - Subject subject = lc.getSubject(); - assertNotNull(subject); - assertEquals(subject.getPrincipals(), ImmutableSet.of( - new BrooklynLoginModule.UserPrincipal(user), - new BrooklynLoginModule.RolePrincipal("users"))); - } - - private LoginContext doLogin(final String username, final String password) throws LoginException { - assertRealmRegisteredEventually(WEBCONSOLE_REALM); - LoginContext lc = new LoginContext(WEBCONSOLE_REALM, new CallbackHandler() { - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - for (int i = 0; i < callbacks.length; i++) { - Callback callback = callbacks[i]; - if (callback instanceof PasswordCallback) { - PasswordCallback passwordCallback = (PasswordCallback)callback; - passwordCallback.setPassword(password.toCharArray()); - } else if (callback instanceof NameCallback) { - NameCallback nameCallback = (NameCallback)callback; - nameCallback.setName(username); - } - } - } - }); - lc.login(); - return lc; - } - - private void assertRealmRegisteredEventually(final String userPassRealm) { - // Need to wait a bit for the realm to get registered, any OSGi way to do this? - Asserts.succeedsEventually(new Runnable() { - @Override - public void run() { - javax.security.auth.login.Configuration initialConfig = javax.security.auth.login.Configuration.getConfiguration(); - AppConfigurationEntry[] realm = initialConfig.getAppConfigurationEntry(userPassRealm); - assertNotNull(realm); - } - }); - } - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/security/StockSecurityProviderTest.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/security/StockSecurityProviderTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/security/StockSecurityProviderTest.java deleted file mode 100644 index 8ef5ceb..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/security/StockSecurityProviderTest.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.security; - -import static org.apache.brooklyn.KarafTestUtils.defaultOptionsWith; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.IOException; -import java.util.concurrent.Callable; - -import javax.inject.Inject; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.AppConfigurationEntry; -import javax.security.auth.login.FailedLoginException; -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -import org.apache.brooklyn.api.mgmt.ManagementContext; -import org.apache.brooklyn.core.internal.BrooklynProperties; -import org.apache.brooklyn.rest.BrooklynWebConfig; -import org.apache.brooklyn.rest.security.provider.ExplicitUsersSecurityProvider; -import org.apache.brooklyn.test.Asserts; -import org.apache.brooklyn.test.IntegrationTest; -import org.apache.http.HttpStatus; -import org.apache.http.auth.AuthScope; -import org.apache.http.auth.UsernamePasswordCredentials; -import org.apache.http.client.ClientProtocolException; -import org.apache.http.client.CredentialsProvider; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.BasicCredentialsProvider; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.karaf.features.BootFinished; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.ops4j.pax.exam.util.Filter; - -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -@Category(IntegrationTest.class) -public class StockSecurityProviderTest { - - private static final String WEBCONSOLE_REALM = "webconsole"; - private static final String USER = "admin"; - private static final String PASSWORD = "password"; - - /** - * To make sure the tests run only when the boot features are fully - * installed - */ - @Inject - @Filter(timeout = 120000) - BootFinished bootFinished; - - @Inject - @Filter(timeout = 120000) - ManagementContext managementContext; - - @Configuration - public static Option[] configuration() throws Exception { - return defaultOptionsWith( - // Uncomment this for remote debugging the tests on port 5005 - // KarafDistributionOption.debugConfiguration() - ); - } - - @Before - public void setUp() { - //Works only before initializing the security provider (i.e. before first use) - addUser(USER, PASSWORD); - } - - @Test(expected = FailedLoginException.class) - public void checkLoginFails() throws LoginException { - doLogin("invalid", "auth"); - } - - @Test - public void checkLoginSucceeds() throws LoginException { - LoginContext lc = doLogin(USER, PASSWORD); - assertNotNull(lc.getSubject()); - } - - @Test - public void checkRestSecurityFails() throws IOException { - checkRestSecurity(null, null, HttpStatus.SC_UNAUTHORIZED); - } - - @Test - public void checkRestSecuritySucceeds() throws IOException { - checkRestSecurity(USER, PASSWORD, HttpStatus.SC_OK); - } - - private void checkRestSecurity(String username, String password, final int code) throws IOException { - CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); - if (username != null && password != null) { - credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password)); - } - try(CloseableHttpClient client = - HttpClientBuilder.create().setDefaultCredentialsProvider(credentialsProvider).build()) { - Asserts.succeedsEventually(new Callable<Void>() { - @Override - public Void call() throws Exception { - assertResponseEquals(client, code); - return null; - } - }); - } - } - - private void assertResponseEquals(CloseableHttpClient httpclient, int code) throws IOException, ClientProtocolException { - // TODO get this dynamically (from CXF service?) - // TODO port is static, should make it dynamic - HttpGet httpGet = new HttpGet("http://localhost:8081/v1/server/ha/state"); - try (CloseableHttpResponse response = httpclient.execute(httpGet)) { - assertEquals(code, response.getStatusLine().getStatusCode()); - } - } - - - private void addUser(String username, String password) { - // TODO Dirty hack to inject the needed properties. Improve once managementContext is configurable. - // Alternatively re-register a test managementContext service (how?) - BrooklynProperties brooklynProperties = (BrooklynProperties)managementContext.getConfig(); - brooklynProperties.put(BrooklynWebConfig.SECURITY_PROVIDER_CLASSNAME.getName(), ExplicitUsersSecurityProvider.class.getCanonicalName()); - brooklynProperties.put(BrooklynWebConfig.USERS.getName(), username); - brooklynProperties.put(BrooklynWebConfig.PASSWORD_FOR_USER(username), password); - } - - private LoginContext doLogin(final String username, final String password) throws LoginException { - assertRealmRegisteredEventually(WEBCONSOLE_REALM); - LoginContext lc = new LoginContext(WEBCONSOLE_REALM, new CallbackHandler() { - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - for (int i = 0; i < callbacks.length; i++) { - Callback callback = callbacks[i]; - if (callback instanceof PasswordCallback) { - PasswordCallback passwordCallback = (PasswordCallback)callback; - passwordCallback.setPassword(password.toCharArray()); - } else if (callback instanceof NameCallback) { - NameCallback nameCallback = (NameCallback)callback; - nameCallback.setName(username); - } - } - } - }); - lc.login(); - return lc; - } - - private void assertRealmRegisteredEventually(final String userPassRealm) { - // Need to wait a bit for the realm to get registered, any OSGi way to do this? - Asserts.succeedsEventually(new Runnable() { - @Override - public void run() { - javax.security.auth.login.Configuration initialConfig = javax.security.auth.login.Configuration.getConfiguration(); - AppConfigurationEntry[] realm = initialConfig.getAppConfigurationEntry(userPassRealm); - assertNotNull(realm); - } - }); - } - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/java/org/apache/brooklyn/test/IntegrationTest.java ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/java/org/apache/brooklyn/test/IntegrationTest.java b/karaf/itest/src/test/java/org/apache/brooklyn/test/IntegrationTest.java deleted file mode 100644 index 9f5fb43..0000000 --- a/karaf/itest/src/test/java/org/apache/brooklyn/test/IntegrationTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.test; - -/** - * Used by junit for grouping tests - */ -public class IntegrationTest { - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/resources/custom-security-bp.xml ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/resources/custom-security-bp.xml b/karaf/itest/src/test/resources/custom-security-bp.xml deleted file mode 100644 index ace4454..0000000 --- a/karaf/itest/src/test/resources/custom-security-bp.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -Copyright 2015 The Apache Software Foundation. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0" - xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws" - xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs" - xmlns:cxf="http://cxf.apache.org/blueprint/core" - xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0" - xsi:schemaLocation=" - http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd - http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd - http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd - http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd - http://karaf.apache.org/xmlns/jaas/v1.0.0 http://karaf.apache.org/xmlns/jaas/v1.0.0 - "> - - <jaas:config name="webconsole" rank="1"> - <jaas:module className="org.apache.brooklyn.rest.security.jaas.BrooklynLoginModule" - flags="required"> - brooklyn.webconsole.security.provider.symbolicName=org.apache.brooklyn.test.security - brooklyn.webconsole.security.provider.version=1.0.0 - brooklyn.webconsole.security.provider.role=users - </jaas:module> - </jaas:config> -</blueprint> http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/resources/exam.properties ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/resources/exam.properties b/karaf/itest/src/test/resources/exam.properties deleted file mode 100644 index d516df6..0000000 --- a/karaf/itest/src/test/resources/exam.properties +++ /dev/null @@ -1,21 +0,0 @@ -################################################################################ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -################################################################################ - -pax.exam.logging = none -pax.exam.service.timeout = 5000 http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/itest/src/test/resources/logback.xml ---------------------------------------------------------------------- diff --git a/karaf/itest/src/test/resources/logback.xml b/karaf/itest/src/test/resources/logback.xml deleted file mode 100644 index 7c08bb7..0000000 --- a/karaf/itest/src/test/resources/logback.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<configuration> - - <!-- log to System.out on console --> - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <encoder> - <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> - </encoder> - </appender> - - <!-- log to file test.log --> - <appender name="TEST_LOG" class="ch.qos.logback.core.FileAppender"> - <file>test.log</file> - <encoder> - <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> - </encoder> - </appender> - - <root level="INFO"> - <appender-ref ref="STDOUT" /> - <appender-ref ref="TEST_LOG" /> - </root> - <logger name="org.ops4j.pax.exam" level="INFO" /> - -</configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a2f6cb5f/karaf/pom.xml ---------------------------------------------------------------------- diff --git a/karaf/pom.xml b/karaf/pom.xml index 256d868..4574bf2 100644 --- a/karaf/pom.xml +++ b/karaf/pom.xml @@ -34,7 +34,7 @@ <properties> - <org.osgi.compendium.version>5.0.0</org.osgi.compendium.version> + <org.osgi.compendium.version>5.0.0</org.osgi.compendium.version> <!-- duplicate in brooklyn-dist/dist-karaf/pom.xml --> <lifecycle-mapping-plugin.version>1.0.0</lifecycle-mapping-plugin.version> @@ -57,8 +57,6 @@ <module>jetty-config</module> <module>features</module> <module>commands</module> - <module>apache-brooklyn</module> - <module>itest</module> </modules> <dependencyManagement>
