You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2015/12/29 18:12:25 UTC

svn commit: r1722193 - in /sling/trunk/contrib/extensions/acldef: ./ it/ it/src/ it/src/main/ it/src/main/provisioning/ it/src/test/ it/src/test/java/ it/src/test/java/org/ it/src/test/java/org/apache/ it/src/test/java/org/apache/sling/ it/src/test/jav...

Author: bdelacretaz
Date: Tue Dec 29 17:12:23 2015
New Revision: 1722193

URL: http://svn.apache.org/viewvc?rev=1722193&view=rev
Log:
SLING-5355 - integration tests skeleton

Added:
    sling/trunk/contrib/extensions/acldef/it/   (with props)
    sling/trunk/contrib/extensions/acldef/it/pom.xml
    sling/trunk/contrib/extensions/acldef/it/src/
    sling/trunk/contrib/extensions/acldef/it/src/main/
    sling/trunk/contrib/extensions/acldef/it/src/main/provisioning/
    sling/trunk/contrib/extensions/acldef/it/src/main/provisioning/model.txt
    sling/trunk/contrib/extensions/acldef/it/src/test/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/acldef/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/acldef/it/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/acldef/it/ImmediateAclIT.java
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/junit/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/junit/teleporter/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/junit/teleporter/customizers/
    sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/junit/teleporter/customizers/ITCustomizer.java
    sling/trunk/contrib/extensions/acldef/it/src/test/resources/
    sling/trunk/contrib/extensions/acldef/it/src/test/resources/logback-test.xml
Modified:
    sling/trunk/contrib/extensions/acldef/pom.xml

Propchange: sling/trunk/contrib/extensions/acldef/it/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Dec 29 17:12:23 2015
@@ -0,0 +1,14 @@
+target
+bin
+derby.log
+*.iml
+*.ipr
+*.iws
+.settings
+.project
+.classpath
+.externalToolBuilders
+maven-eclipse.xml
+sling
+
+

Added: sling/trunk/contrib/extensions/acldef/it/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/acldef/it/pom.xml?rev=1722193&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/acldef/it/pom.xml (added)
+++ sling/trunk/contrib/extensions/acldef/it/pom.xml Tue Dec 29 17:12:23 2015
@@ -0,0 +1,198 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.sling</groupId>
+    <artifactId>sling</artifactId>
+    <version>25</version>
+    <relativePath/>
+  </parent>
+
+  <artifactId>org.apache.sling.acldef.it</artifactId>
+  <packaging>slingstart</packaging>
+  <version>0.0.1-SNAPSHOT</version>
+  <name>Apache Sling ACL Definitions Integration Tests</name>
+  <description>
+		Integration tests for the ACL definitions modules
+  </description>
+
+  <scm>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/it</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/it</developerConnection>
+    <url>https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/it</url>
+  </scm>
+
+ <properties>
+      <!-- Timeout when checking for Sling readyness before starting tests -->
+      <HttpTestBase.readyTimeoutSeconds>62</HttpTestBase.readyTimeoutSeconds>
+
+      <!-- path suffix for HTTP access to Sling -->
+      <http.base.path/>
+
+      <!-- path suffix for WebDAV access to the repository -->
+      <webdav.workspace.path/>
+
+      <!-- hostname for integration tests -->
+      <test.host>localhost</test.host>
+
+      <!--
+          Set this to true to stop mvn once the integration test Jetty instance is
+          started. Useful to manually test the integration testing webapp.
+      -->
+      <integration.test.wait>false</integration.test.wait>
+
+      <!--
+      if set to "true" this will start the launchpad with the following debug options:
+          -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
+
+      otherwise you can provide your own debug settings
+      -->
+      <debug.options/>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>reserve-network-port</id>
+            <goals>
+              <goal>reserve-network-port</goal>
+            </goals>
+            <phase>process-resources</phase>
+            <configuration>
+              <portNames>
+                <portName>http.port</portName>
+                <portName>sling.control.port</portName>
+              </portNames>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>integration-test</goal>
+              <goal>verify</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <runOrder>alphabetical</runOrder>
+          <systemPropertyVariables>
+            <launchpad.http.server.url>http://${test.host}:${http.port}/</launchpad.http.server.url>
+            <launchpad.webdav.server.url>http://${test.host}:${http.port}/${webdav.workspace.path}</launchpad.webdav.server.url>
+            <HttpTestBase.readyTimeoutSeconds>${HttpTestBase.readyTimeoutSeconds}</HttpTestBase.readyTimeoutSeconds>
+            <launchpad.ready.1>GET:/index.html:200:.*Welcome to the Sling Launchpad.*</launchpad.ready.1>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>slingstart-maven-plugin</artifactId>
+        <version>1.2.0</version>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <id>start-container</id>
+            <goals>
+              <goal>start</goal>
+              <goal>stop</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <servers>
+            <server>
+              <port>${http.port}</port>
+              <controlPort>${sling.control.port}</controlPort>
+              <runmode>jackrabbit</runmode>
+              <contextPath>${http.base.path}</contextPath>
+<!-- TODO activate when never slingstart plugin is available
+              <debug>${debug.options}</debug>
+-->
+            </server>
+          </servers>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <dependencies>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <version>1.7.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <version>1.9.5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.commons.testing</artifactId>
+      <version>2.0.18</version>
+      <exclusions>
+        <exclusion>
+          <groupId>junit</groupId>
+          <artifactId>junit-dep</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-simple</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>asm</groupId>
+          <artifactId>asm</artifactId>
+        </exclusion>
+      </exclusions>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sling</groupId>
+      <artifactId>org.apache.sling.junit.teleporter</artifactId>
+      <version>1.0.4</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Added: sling/trunk/contrib/extensions/acldef/it/src/main/provisioning/model.txt
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/acldef/it/src/main/provisioning/model.txt?rev=1722193&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/acldef/it/src/main/provisioning/model.txt (added)
+++ sling/trunk/contrib/extensions/acldef/it/src/main/provisioning/model.txt Tue Dec 29 17:12:23 2015
@@ -0,0 +1,29 @@
+#
+#  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.
+#
+[feature name=sling]
+
+[artifacts]
+  org.apache.sling/org.apache.sling.launchpad/8/slingstart
+  org.apache.sling/org.apache.sling.junit.core/1.0.14
+  org.apache.sling/org.apache.sling.acldef.oak-jcr/0.0.1-SNAPSHOT
+
+[configurations]
+
+[settings]
+  org.apache.sling.commons.log.julenabled=true

Added: sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/acldef/it/ImmediateAclIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/acldef/it/ImmediateAclIT.java?rev=1722193&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/acldef/it/ImmediateAclIT.java (added)
+++ sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/acldef/it/ImmediateAclIT.java Tue Dec 29 17:12:23 2015
@@ -0,0 +1,33 @@
+/*
+ * 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.acldef.it;
+
+import org.apache.sling.junit.rules.TeleporterRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.osgi.service.cm.ConfigurationAdmin;
+
+public class ImmediateAclIT {
+    
+    @Rule
+    public TeleporterRule teleporter = TeleporterRule.forClass(getClass(), "IT");
+    
+    @Test
+    public void testNotMuchForNow() {
+        teleporter.getService(ConfigurationAdmin.class);
+    }
+}

Added: sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/junit/teleporter/customizers/ITCustomizer.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/junit/teleporter/customizers/ITCustomizer.java?rev=1722193&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/junit/teleporter/customizers/ITCustomizer.java (added)
+++ sling/trunk/contrib/extensions/acldef/it/src/test/java/org/apache/sling/junit/teleporter/customizers/ITCustomizer.java Tue Dec 29 17:12:23 2015
@@ -0,0 +1,31 @@
+/*
+ * 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.junit.teleporter.customizers;
+
+import org.apache.sling.junit.rules.TeleporterRule;
+import org.apache.sling.testing.teleporter.client.ClientSideTeleporter;
+
+public class ITCustomizer implements TeleporterRule.Customizer {
+
+    public static final String BASE_URL_PROP = "launchpad.http.server.url";
+    @Override
+    public void customize(TeleporterRule t, String options) {
+        final ClientSideTeleporter cst = (ClientSideTeleporter)t;
+        cst.setBaseUrl(System.getProperty(BASE_URL_PROP, BASE_URL_PROP + "_IS_NOT_SET"));
+        cst.setServerCredentials("admin", "admin");
+    }
+}

Added: sling/trunk/contrib/extensions/acldef/it/src/test/resources/logback-test.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/acldef/it/src/test/resources/logback-test.xml?rev=1722193&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/acldef/it/src/test/resources/logback-test.xml (added)
+++ sling/trunk/contrib/extensions/acldef/it/src/test/resources/logback-test.xml Tue Dec 29 17:12:23 2015
@@ -0,0 +1,49 @@
+<?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>
+
+    <appender name="file" class="ch.qos.logback.core.FileAppender">
+        <file>target/sling-tests.log</file>
+        <encoder>
+            <pattern>%date{HH:mm:ss.SSS} %-5level %-40([%thread] %F:%L) %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="sift" class="ch.qos.logback.classic.sift.SiftingAppender">
+        <discriminator>
+            <Key>testclass</Key>
+            <DefaultValue>junit</DefaultValue>
+        </discriminator>
+        <sift>
+            <appender name="FILE-${testname}" class="ch.qos.logback.core.FileAppender">
+                <File>target/surefire-reports/${testclass}.log</File>
+                <layout class="ch.qos.logback.classic.PatternLayout">
+                    <Pattern>%date{HH:mm:ss.SSS} %-5level %-40([%thread] %F:%L) %msg%n</Pattern>
+                </layout>
+            </appender>
+        </sift>
+    </appender>
+
+    <logger name="org.apache.sling.launchpad" level="DEBUG" />
+
+    <root level="INFO">
+        <appender-ref ref="file" />
+        <appender-ref ref="sift" />
+    </root>
+
+</configuration>

Modified: sling/trunk/contrib/extensions/acldef/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/acldef/pom.xml?rev=1722193&r1=1722192&r2=1722193&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/acldef/pom.xml (original)
+++ sling/trunk/contrib/extensions/acldef/pom.xml Tue Dec 29 17:12:23 2015
@@ -37,5 +37,6 @@
     <module>parser</module>
     <module>oak-jcr</module>
     <module>provisioning</module>
+    <module>it</module>
   </modules>
 </project>