incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1513800 - in /sling/whiteboard/bdelacretaz/it-repository: ./ src/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/sling/ src/test/java/org/apache/sling/jcr/ src/test/java/org/apache/sling/jcr/...
Date Wed, 14 Aug 2013 10:37:08 GMT
Author: bdelacretaz
Date: Wed Aug 14 10:37:07 2013
New Revision: 1513800

URL: http://svn.apache.org/r1513800
Log:
SLING-3016 - OSGi-level integration tests for SlingRepository implementations, work in progress

Added:
    sling/whiteboard/bdelacretaz/it-repository/   (with props)
    sling/whiteboard/bdelacretaz/it-repository/pom.xml   (with props)
    sling/whiteboard/bdelacretaz/it-repository/src/
    sling/whiteboard/bdelacretaz/it-repository/src/test/
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/JackrabbitRepositoryIT.java
  (with props)
    sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
  (with props)

Propchange: sling/whiteboard/bdelacretaz/it-repository/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Aug 14 10:37:07 2013
@@ -0,0 +1,15 @@
+target
+sling
+bin
+logs
+jackrabbit
+derby.log
+*.iml
+*.ipr
+*.iws
+.settings
+.project
+.classpath
+.externalToolBuilders
+maven-eclipse.xml
+

Added: sling/whiteboard/bdelacretaz/it-repository/pom.xml
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/it-repository/pom.xml?rev=1513800&view=auto
==============================================================================
--- sling/whiteboard/bdelacretaz/it-repository/pom.xml (added)
+++ sling/whiteboard/bdelacretaz/it-repository/pom.xml Wed Aug 14 10:37:07 2013
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>16</version>
+        <relativePath>16</relativePath>
+    </parent>
+
+    <groupId>org.apache.sling</groupId>
+    <artifactId>org.apache.sling.jcr.repository.it</artifactId>
+    <packaging>jar</packaging>
+    <version>0.0.2-SNAPSHOT</version>
+
+    <name>SlingRepository Integration Tests</name>
+    <description>Tests various SlingRepository implementations</description>
+    <inceptionYear>2013</inceptionYear>
+
+    <properties>
+        <exam.version>3.2.0</exam.version>
+        <url.version>1.5.2</url.version>
+        <org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-failsafe-plugin</artifactId>
+                <executions>
+                  <execution>
+                    <goals>
+                      <goal>integration-test</goal>
+                      <goal>verify</goal>
+                    </goals>
+                  </execution>
+                </executions>
+                <configuration>
+                    <systemProperties>
+                        <property>
+                            <name>org.ops4j.pax.logging.DefaultServiceLog.level</name>
+                            <value>${org.ops4j.pax.logging.DefaultServiceLog.level}</value>
+                        </property>
+                        <property>
+                            <name>org.osgi.service.http.port</name>
+                            <value>${http.port}</value>
+                        </property>
+                    </systemProperties>
+                    <argLine>
+                        -Xmx1024m -XX:MaxPermSize=256m
+                    </argLine>
+                </configuration>
+            </plugin>
+            <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>pre-integration-test</phase>
+                        <configuration>
+                            <portNames>
+                                <portName>http.port</portName>
+                            </portNames>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>            
+            <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <configuration>
+                    <filesets>
+                        <fileset>
+                            <directory>${basedir}</directory>
+                            <includes>
+                                <include>derby.log</include>
+                            </includes>
+                        </fileset>
+                        <fileset>
+                            <directory>jackrabbit</directory>
+                        </fileset>
+                    </filesets>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.6</source>
+                    <target>1.6</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.4.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.jcr-wrapper</artifactId>
+            <version>2.0.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tika</groupId>
+            <artifactId>tika-core</artifactId>
+            <version>1.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.base</artifactId>
+            <version>2.1.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.api</artifactId>
+            <version>2.1.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.logservice</artifactId>
+            <version>1.0.2</version>
+            <scope>optional</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.6.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+            <version>1.6.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.11</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-container-native</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-junit4</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.exam</groupId>
+            <artifactId>pax-exam-link-mvn</artifactId>
+            <version>${exam.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.ops4j.pax.url</groupId>
+            <artifactId>pax-url-aether</artifactId>
+            <version>${url.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.framework</artifactId>
+            <version>3.2.2</version>
+            <scope>test</scope>
+        </dependency>
+     </dependencies>
+</project>
\ No newline at end of file

Propchange: sling/whiteboard/bdelacretaz/it-repository/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/JackrabbitRepositoryIT.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/JackrabbitRepositoryIT.java?rev=1513800&view=auto
==============================================================================
--- sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/JackrabbitRepositoryIT.java
(added)
+++ sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/JackrabbitRepositoryIT.java
Wed Aug 14 10:37:07 2013
@@ -0,0 +1,116 @@
+/*
+ * 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 SF 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.jcr.repository.it;
+
+import static org.junit.Assert.assertEquals;
+import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.when;
+
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class JackrabbitRepositoryIT extends SlingRepositoryITBase {
+
+    @org.ops4j.pax.exam.Configuration
+    public Option[] config() {
+        final String localRepo = System.getProperty("maven.repo.local", "");
+
+        return options(
+                when( localRepo.length() > 0 ).useOptions(
+                        systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)
+                ),
+                mavenBundle("org.apache.sling", "org.apache.sling.fragment.xml", "1.0.2"),
+                mavenBundle("org.apache.sling", "org.apache.sling.fragment.transaction",
"1.0.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.fragment.activation", "1.0.2"),
+                mavenBundle("org.apache.sling", "org.apache.sling.fragment.ws", "1.0.2"),
+
+                mavenBundle("org.apache.sling", "org.apache.sling.commons.log", "3.0.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.commons.logservice", "1.0.2"),
+
+                mavenBundle("org.slf4j", "slf4j-api", "1.6.4"),
+                mavenBundle("org.slf4j", "jcl-over-slf4j", "1.6.4"),
+                mavenBundle("org.slf4j", "log4j-over-slf4j", "1.6.4"),
+
+                mavenBundle("commons-io", "commons-io", "1.4"),
+                mavenBundle("commons-fileupload", "commons-fileupload", "1.2.2"),
+                mavenBundle("commons-collections", "commons-collections", "3.2.1"),
+                mavenBundle("commons-codec", "commons-codec", "1.6"),
+                mavenBundle("commons-lang", "commons-lang", "2.5"),
+
+                mavenBundle("org.apache.geronimo.bundles", "commons-httpclient", "3.1_1"),
+                mavenBundle("org.apache.tika", "tika-core", "1.2"),
+                mavenBundle("org.apache.tika", "tika-bundle", "1.2"),
+
+                mavenBundle("org.apache.felix", "org.apache.felix.http.jetty", "2.2.0"),
+                mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.2.14"),
+                mavenBundle("org.apache.felix", "org.apache.felix.scr", "1.6.2"),
+                mavenBundle("org.apache.felix", "org.apache.felix.configadmin", "1.6.0"),
+                mavenBundle("org.apache.felix", "org.apache.felix.inventory", "1.0.0"),
+
+                mavenBundle("org.apache.sling", "org.apache.sling.commons.osgi", "2.2.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.commons.json", "2.0.6"),
+                mavenBundle("org.apache.sling", "org.apache.sling.commons.mime", "2.1.4"),
+                mavenBundle("org.apache.sling", "org.apache.sling.commons.classloader", "1.3.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.commons.scheduler", "2.3.4"),
+                mavenBundle("org.apache.sling", "org.apache.sling.commons.threads", "3.1.0"),
+
+                mavenBundle("org.apache.sling", "org.apache.sling.launchpad.api", "1.1.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.auth.core", "1.1.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.discovery.api", "1.0.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.discovery.standalone",
"1.0.0"),
+
+                mavenBundle("org.apache.sling", "org.apache.sling.api", "2.4.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.settings", "1.2.2"),
+                mavenBundle("org.apache.sling", "org.apache.sling.resourceresolver", "1.0.6"),
+                mavenBundle("org.apache.sling", "org.apache.sling.adapter", "2.1.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.jcr.resource", "2.2.6"),
+                mavenBundle("org.apache.sling", "org.apache.sling.jcr.classloader", "3.1.12"),
+                mavenBundle("org.apache.sling", "org.apache.sling.jcr.contentloader", "2.1.2"),
+                mavenBundle("org.apache.sling", "org.apache.sling.engine", "2.2.6"),
+
+                mavenBundle("org.apache.sling", "org.apache.sling.jcr.jcr-wrapper", "2.0.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.jcr.api", "2.1.0"),
+                mavenBundle("org.apache.sling", "org.apache.sling.jcr.base", "2.1.2"),
+                mavenBundle("org.apache.jackrabbit", "jackrabbit-api", "2.4.2"),
+                mavenBundle("org.apache.jackrabbit", "jackrabbit-jcr-commons", "2.4.2"),
+                mavenBundle("org.apache.jackrabbit", "jackrabbit-spi", "2.4.2"),
+                mavenBundle("org.apache.jackrabbit", "jackrabbit-spi-commons", "2.4.2"),
+                mavenBundle("org.apache.jackrabbit", "jackrabbit-jcr-rmi", "2.4.2"),
+                mavenBundle("org.apache.derby", "derby", "10.5.3.0_1"),
+                mavenBundle("org.apache.sling", "org.apache.sling.jcr.jackrabbit.server",
"2.1.2"),
+
+                mavenBundle("org.apache.sling", "org.apache.sling.testing.tools", "1.0.6"),
+                mavenBundle("org.apache.httpcomponents", "httpcore-osgi", "4.1.2"),
+                mavenBundle("org.apache.httpcomponents", "httpclient-osgi", "4.1.2"),
+
+                junitBundles()
+           );
+    }
+
+    protected void doCheckRepositoryDescriptors() {
+        assertEquals("Jackrabbit", repository.getDescriptor("jcr.repository.name"));
+    }
+}

Propchange: sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/JackrabbitRepositoryIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/JackrabbitRepositoryIT.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Added: sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java?rev=1513800&view=auto
==============================================================================
--- sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
(added)
+++ sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
Wed Aug 14 10:37:07 2013
@@ -0,0 +1,83 @@
+/*
+ * 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 SF 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.jcr.repository.it;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import javax.inject.Inject;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.sling.jcr.api.SlingRepository;
+import org.junit.Test;
+
+/** Base class for SlingRepository tests, contains tests
+ *  that apply to all implementations.
+ *  PaxExamParameterized could also be used in theory to
+ *  have single class that tests all implementations, but
+ *  in a quick test that didn't work well with variable
+ *  @Config annotations.
+ */
+public abstract class SlingRepositoryITBase {
+
+    @Inject
+    protected SlingRepository repository;
+    
+    /** Check some repository descriptors to make sure we're
+     *  testing the expected implementation. */ 
+    protected abstract void doCheckRepositoryDescriptors();
+    
+    @Test
+    public void testRepositoryPresent() {
+        assertNotNull(repository);
+    }
+    
+    @Test
+    public void testLogin() throws RepositoryException {
+        final Session s = repository.loginAdministrative(null);
+        assertNotNull(s);
+        s.logout();
+    }
+
+    @Test
+    public void testCreateRetrieveNode() throws RepositoryException {
+        Session s = repository.loginAdministrative(null);
+        try {
+            final Node root = s.getRootNode();
+            final String name = "TEST_" + System.currentTimeMillis();
+            final String propName = "PN_" + name;
+            final String propValue = "PV_" + name;
+            root.addNode(name).setProperty(propName, propValue);
+            s.save();
+            s.logout();
+            s = repository.loginAdministrative(null);
+            final Node n = s.getNode("/" + name);
+            assertNotNull(n);
+            assertEquals(propValue, n.getProperty(propName).getString());
+        } finally {
+            s.logout();
+        }
+    }
+
+    @Test
+    public final void checkRepositoryDescriptors() {
+        doCheckRepositoryDescriptors();
+    }
+}
\ No newline at end of file

Propchange: sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/bdelacretaz/it-repository/src/test/java/org/apache/sling/jcr/repository/it/SlingRepositoryITBase.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL



Mime
View raw message