incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r1528821 - in /sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests: ./ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/sling/ src/main/java/org/apache/sling/l...
Date Thu, 03 Oct 2013 12:02:42 GMT
Author: olli
Date: Thu Oct  3 12:02:41 2013
New Revision: 1528821

URL: http://svn.apache.org/r1528821
Log:
SLING-3017 improve Karaf integration tests

- separate testing support and test into own packages and jars
- use Maven Failsafe Plugin for tests
- update Pax Exam to 3.2.0
- enable test (remove Ignore annotation)
- increase timeouts to 300000 ms

Added:
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/launchpad/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/launchpad/karaf/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/launchpad/karaf/testing/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/launchpad/karaf/testing/KarafTestSupport.java
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/BootstrapIT.java
Removed:
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/BootstrapTest.java
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/KarafTestSupport.java
Modified:
    sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/pom.xml

Modified: sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/pom.xml?rev=1528821&r1=1528820&r2=1528821&view=diff
==============================================================================
--- sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/pom.xml
(original)
+++ sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/pom.xml
Thu Oct  3 12:02:41 2013
@@ -30,6 +30,7 @@
 
   <artifactId>org.apache.sling.launchpad.karaf-integration-tests</artifactId>
   <version>0.1.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
 
   <name>Apache Sling Launchpad Karaf - Integration Tests</name>
   <description>Integration Tests for Apache Sling Launchpad Karaf</description>
@@ -37,11 +38,24 @@
   <dependencies>
     <!-- javax -->
     <dependency>
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <version>1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
       <groupId>javax.jcr</groupId>
       <artifactId>jcr</artifactId>
       <version>2.0</version>
       <scope>test</scope>
     </dependency>
+    <!-- Apache Karaf -->
+    <dependency>
+      <groupId>org.apache.karaf.features</groupId>
+      <artifactId>org.apache.karaf.features.core</artifactId>
+      <version>3.0.0.RC1</version>
+      <scope>provided</scope>
+    </dependency>
     <!-- Apache Sling -->
     <dependency>
       <groupId>org.apache.sling</groupId>
@@ -59,14 +73,13 @@
     <!-- testing -->
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-junit4</artifactId>
-      <version>3.1.0</version>
-      <scope>test</scope>
+      <artifactId>pax-exam-container-karaf</artifactId>
+      <version>3.2.0</version>
     </dependency>
     <dependency>
       <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-container-karaf</artifactId>
-      <version>3.1.0</version>
+      <artifactId>pax-exam-junit4</artifactId>
+      <version>3.2.0</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -96,4 +109,46 @@
     </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>2.4.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Bundle-Category>sling</Bundle-Category>
+            <Bundle-Description>${project.description}</Bundle-Description>
+            <Bundle-DocURL>http://sling.apache.org</Bundle-DocURL>
+            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+            <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
+          </instructions>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.1</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <version>2.15</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>integration-test</goal>
+              <goal>verify</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
 </project>

Added: sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/launchpad/karaf/testing/KarafTestSupport.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/launchpad/karaf/testing/KarafTestSupport.java?rev=1528821&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/launchpad/karaf/testing/KarafTestSupport.java
(added)
+++ sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/main/java/org/apache/sling/launchpad/karaf/testing/KarafTestSupport.java
Thu Oct  3 12:02:41 2013
@@ -0,0 +1,59 @@
+/*
+ * 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.sling.launchpad.karaf.testing;
+
+import javax.inject.Inject;
+
+import org.apache.karaf.features.BootFinished;
+import org.ops4j.pax.exam.util.Filter;
+
+public abstract class KarafTestSupport {
+
+    public static final String KARAF_GROUP_ID = "org.apache.karaf";
+
+    public static final String KARAF_ARTIFACT_ID = "apache-karaf";
+
+    public static final String KARAF_VERSION = "3.0.0.RC1";
+
+    public static final String KARAF_NAME = "Apache Karaf";
+
+    @Inject
+    @Filter(timeout = 300000)
+    BootFinished bootFinished;
+
+    protected KarafTestSupport() {
+    }
+
+    public String karafGroupId() {
+        return KARAF_GROUP_ID;
+    }
+
+    public String karafArtifactId() {
+        return KARAF_ARTIFACT_ID;
+    }
+
+    public String karafVersion() {
+        return KARAF_VERSION;
+    }
+
+    public String karafName() {
+        return KARAF_NAME;
+    }
+
+}

Added: sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/BootstrapIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/BootstrapIT.java?rev=1528821&view=auto
==============================================================================
--- sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/BootstrapIT.java
(added)
+++ sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/BootstrapIT.java
Thu Oct  3 12:02:41 2013
@@ -0,0 +1,72 @@
+/*
+ * 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.sling.launchpad.karaf.tests;
+
+import java.io.File;
+
+import javax.inject.Inject;
+
+import org.apache.sling.jcr.api.SlingRepository;
+import org.apache.sling.launchpad.karaf.testing.KarafTestSupport;
+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.karaf.options.LogLevelOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.exam.util.Filter;
+
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.bundle;
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFileExtend;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class BootstrapIT extends KarafTestSupport {
+
+    @Inject
+    @Filter(timeout = 300000)
+    public SlingRepository slingRepository;
+
+    @Configuration
+    public Option[] configuration() {
+        return new Option[]{
+            karafDistributionConfiguration().frameworkUrl(maven().groupId(karafGroupId()).artifactId(karafArtifactId()).version(karafVersion()).type("tar.gz")).karafVersion(karafVersion()).name(karafName()).unpackDirectory(new
File("target/paxexam/")),
+            keepRuntimeFolder(),
+            logLevel(LogLevelOption.LogLevel.INFO),
+            editConfigurationFileExtend("etc/org.apache.karaf.features.cfg", "featuresRepositories",
",mvn:org.apache.sling/org.apache.sling.launchpad.karaf-features/0.1.0-SNAPSHOT/xml/features"),
+            editConfigurationFileExtend("etc/org.apache.karaf.features.cfg", "featuresBoot",
",sling-karaf"),
+            editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j.rootLogger",
"log4j.rootLogger=DEBUG, sift, osgi:*"),
+            bundle("file:target/org.apache.sling.launchpad.karaf-integration-tests-0.1.0-SNAPSHOT.jar")
+        };
+    }
+
+    @Test
+    public void testSlingRepository() throws Exception {
+        assertNotNull(slingRepository);
+    }
+
+}



Mime
View raw message