/*
 * 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.
 */
package org.apache.karaf.itests.features;

import org.apache.karaf.itests.KarafTestSupport;
import org.junit.Test;
import org.junit.runner.RunWith;
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)
public class StandardFeaturesTest extends KarafTestSupport {
	
	@Test
	/**
	 * Regression test for https://issues.apache.org/jira/browse/KARAF-2566
	 * @throws Exception
	 */
	public void checkInteractionOfHttpAndAriesAnnotationFeature() throws Exception {
		installAssertAndUninstallFeatures("aries-annotation", "pax-http");
		installAssertAndUninstallFeatures("pax-http", "aries-annotation");
    }

    @Test
    public void installAriesAnnotationFeature() throws Exception {
        installAssertAndUninstallFeatures("aries-annotation");
    }

    @Test
    public void installAriesBlueprintWebFeature() throws Exception {
        installAssertAndUninstallFeatures("blueprint-web");
    }
    
    @Test
    public void installWrapperFeature() throws Exception {
        installAssertAndUninstallFeatures("wrapper");
    }
    
    @Test
    public void installObrFeature() throws Exception {
        installAssertAndUninstallFeatures("obr");
    }

    @Test
    public void installConfigFeature() throws Exception {
        installAssertAndUninstallFeatures("config");
    }
    
    @Test
    public void installPackageFeature() throws Exception {
        installAssertAndUninstallFeatures("package");
    }

    @Test
    public void installHttpFeature() throws Exception {
        installAssertAndUninstallFeatures("http");
    }

    @Test
    public void installHttpWhiteboardFeature() throws Exception {
        installAssertAndUninstallFeatures("http-whiteboard");
    }

    @Test
    public void installWarFeature() throws Exception {
        installAssertAndUninstallFeatures("war");
    }
    
    @Test
    public void installKarFeature() throws Exception {
        installAssertAndUninstallFeatures("kar");
    }

    @Test
    public void installWebConsoleFeature() throws Exception {
        installAssertAndUninstallFeatures("webconsole");
    }

    @Test
    public void installSSHFeature() throws Exception {
        installAssertAndUninstallFeatures("ssh");
    }
    
    @Test
    public void installManagementFeature() throws Exception {
        installAssertAndUninstallFeatures("management");
    }
    
    @Test
    public void installSchedulerFeature() throws Exception {
        installAssertAndUninstallFeatures("scheduler");
    }

    @Test
    public void installEventAdminFeature() throws Exception {
        installAssertAndUninstallFeatures("eventadmin");
    }

    @Test
    public void installJasyptEncryptionFeature() throws Exception {
        installAssertAndUninstallFeatures("jasypt-encryption");
    }

    @Test
    public void installScrFeature() throws Exception {
        installAssertAndUninstallFeatures("scr");
    }

}

@@ -648,16 +648,41 @@
 upport;%0A
+import org.junit.Ignore;%0A
 import o
@@ -1001,16 +1001,826 @@
 upport %7B
+%0A%0A    @Test%0A    public void checkInstalledFeaturesBoot() throws Exception %7B%0A        assertFeatureInstalled(%22wrap%22);%0A        assertFeatureInstalled(%22aries-blueprint%22);%0A        assertFeatureInstalled(%22shell%22);%0A        assertFeatureInstalled(%22shell-compat%22);%0A        assertFeatureInstalled(%22jaas%22);%0A        assertFeatureInstalled(%22ssh%22);%0A        assertFeatureInstalled(%22management%22);%0A        assertFeatureInstalled(%22bundle%22);%0A        assertFeatureInstalled(%22config%22);%0A        assertFeatureInstalled(%22deployer%22);%0A        assertFeatureInstalled(%22diagnostic%22);%0A        assertFeatureInstalled(%22instance%22);%0A        assertFeatureInstalled(%22kar%22);%0A        assertFeatureInstalled(%22log%22);%0A        assertFeatureInstalled(%22package%22);%0A        assertFeatureInstalled(%22service%22);%0A        assertFeatureInstalled(%22system%22);%0A    %7D
 %0A%09%0A%09@Tes
@@ -2145,32 +2145,358 @@
 ation%22);%0A    %7D%0A%0A
+    @Test%0A    @Ignore(%22Waiting for KARAF-3181%22)%0A    public void installFrameworkSecurityFeature() throws Exception %7B%0A        installAssertAndUninstallFeatures(%22framework-security%22);%0A    %7D%0A%0A    public void installServiceSecurityFeature() throws Exception %7B%0A        installAssertAndUninstallFeatures(%22service-security%22);%0A    %7D%0A%0A
     @Test%0A    pu
@@ -3036,270 +3036,8 @@
  %7D%0A%0A
-    @Test%0A    public void installConfigFeature() throws Exception %7B%0A        installAssertAndUninstallFeatures(%22config%22);%0A    %7D%0A    %0A    @Test%0A    public void installPackageFeature() throws Exception %7B%0A        installAssertAndUninstallFeatures(%22package%22);%0A    %7D%0A%0A
     
@@ -3414,36 +3414,32 @@
 s(%22war%22);%0A    %7D%0A
-    
 %0A    @Test%0A    p
@@ -3456,19 +3456,21 @@
  install
-Kar
+Jetty
 Feature(
@@ -3533,19 +3533,21 @@
 atures(%22
-kar
+jetty
 %22);%0A    
@@ -3687,270 +3687,8 @@
    %7D
-%0A%0A    @Test%0A    public void installSSHFeature() throws Exception %7B%0A        installAssertAndUninstallFeatures(%22ssh%22);%0A    %7D%0A    %0A    @Test%0A    public void installManagementFeature() throws Exception %7B%0A        installAssertAndUninstallFeatures(%22management%22);%0A    %7D
 %0A   

Extend standard features itest coverage