You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by pi...@apache.org on 2012/04/26 13:08:42 UTC

svn commit: r1330774 - /karaf/trunk/tooling/exam/regression/src/test/java/org/apache/karaf/tooling/exam/regression/MixFeatureAndDeployFolderFalseTest.java

Author: pieber
Date: Thu Apr 26 11:08:42 2012
New Revision: 1330774

URL: http://svn.apache.org/viewvc?rev=1330774&view=rev
Log:
[KARAF-1406,KARAF-1407] Add itest to prove fixes

Signed-off-by: Andreas Pieber <an...@gmail.com>

Added:
    karaf/trunk/tooling/exam/regression/src/test/java/org/apache/karaf/tooling/exam/regression/MixFeatureAndDeployFolderFalseTest.java

Added: karaf/trunk/tooling/exam/regression/src/test/java/org/apache/karaf/tooling/exam/regression/MixFeatureAndDeployFolderFalseTest.java
URL: http://svn.apache.org/viewvc/karaf/trunk/tooling/exam/regression/src/test/java/org/apache/karaf/tooling/exam/regression/MixFeatureAndDeployFolderFalseTest.java?rev=1330774&view=auto
==============================================================================
--- karaf/trunk/tooling/exam/regression/src/test/java/org/apache/karaf/tooling/exam/regression/MixFeatureAndDeployFolderFalseTest.java (added)
+++ karaf/trunk/tooling/exam/regression/src/test/java/org/apache/karaf/tooling/exam/regression/MixFeatureAndDeployFolderFalseTest.java Thu Apr 26 11:08:42 2012
@@ -0,0 +1,68 @@
+/*
+ * 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.karaf.tooling.exam.regression;
+
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+import static org.apache.karaf.tooling.exam.options.KarafDistributionOption.editConfigurationFilePut;
+import static org.apache.karaf.tooling.exam.options.KarafDistributionOption.karafDistributionConfiguration;
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
+
+import javax.inject.Inject;
+
+import org.apache.karaf.features.FeaturesService;
+import org.apache.karaf.tooling.exam.options.configs.FeaturesCfg;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.junit.ExamReactorStrategy;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory;
+
+/**
+ * This test should validate if the versionAsInProject tags work as expected.
+ */
+@RunWith(JUnit4TestRunner.class)
+@ExamReactorStrategy(AllConfinedStagedReactorFactory.class)
+public class MixFeatureAndDeployFolderFalseTest {
+
+    @Inject
+    private FeaturesService featuresService;
+
+    @Configuration
+    public Option[] config() {
+        return new Option[]{
+            karafDistributionConfiguration()
+                .frameworkUrl(
+                    maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip")
+                        .versionAsInProject())
+                .useDeployFolder(false), editConfigurationFilePut(FeaturesCfg.BOOT,
+                "config,standard,region,package,ssh"),
+            scanFeatures(maven().groupId("org.apache.karaf.features").artifactId("standard").type("xml")
+                .classifier("features").versionAsInProject(), "kar").start() };
+    }
+
+    @Test
+    public void test() throws Exception {
+        assertFalse(featuresService.isInstalled(featuresService.getFeature("management")));
+        assertTrue(featuresService.isInstalled(featuresService.getFeature("kar")));
+    }
+
+}