Author: olli
Date: Fri Feb 26 12:27:52 2016
New Revision: 1732467

URL: http://svn.apache.org/viewvc?rev=1732467&view=rev
Log:
SLING-5562 Provide NoSQL features

add NoSQL features (and tests):

* sling-nosql-generic
* sling-nosql-couchbase
* sling-nosql-mongodb
* sling-launchpad-nosql-couchbase
* sling-launchpad-nosql-mongodb

Added:
    
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingLaunchpadNosqlCouchbaseIT.java
    
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingLaunchpadNosqlMongoIT.java
    
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlCouchbaseIT.java
    
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlGenericIT.java
    
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlMongoIT.java
Modified:
    
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-distribution/pom.xml
    
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-features/src/main/feature/feature.xml

Modified: 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-distribution/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-distribution/pom.xml?rev=1732467&r1=1732466&r2=1732467&view=diff
==============================================================================
--- 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-distribution/pom.xml
 (original)
+++ 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-distribution/pom.xml
 Fri Feb 26 12:27:52 2016
@@ -168,6 +168,13 @@
             <feature>sling-extension-resourcemerger</feature>
             <feature>sling-extension-security</feature>
             <feature>sling-extension-urlrewriter</feature>
+            <!-- Apache Sling Launchpad (contrib) -->
+            <feature>sling-launchpad-nosql-couchbase</feature>
+            <feature>sling-launchpad-nosql-mongodb</feature>
+            <!-- Apache Sling NoSQL (contrib) -->
+            <feature>sling-nosql-generic</feature>
+            <feature>sling-nosql-couchbase</feature>
+            <feature>sling-nosql-mongodb</feature>
             <!-- Apache Sling Scripting (contrib) -->
             <feature>sling-scripting-groovy</feature>
             <feature>sling-scripting-java</feature>

Modified: 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-features/src/main/feature/feature.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-features/src/main/feature/feature.xml?rev=1732467&r1=1732466&r2=1732467&view=diff
==============================================================================
--- 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-features/src/main/feature/feature.xml
 (original)
+++ 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-features/src/main/feature/feature.xml
 Fri Feb 26 12:27:52 2016
@@ -487,6 +487,50 @@
     <feature version="${feature.version}">sling</feature>
     <bundle 
dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.urlrewritefilter/4.0.4_1</bundle>
   </feature>
+  <!-- Apache Sling Launchpad (contrib) -->
+  <feature name="sling-launchpad-nosql-couchbase" version="${feature.version}">
+    <config 
name="org.apache.sling.nosql.couchbase.resourceprovider.CouchbaseNoSqlResourceProviderFactory.factory.config">
+      provider.roots=["/"]
+    </config>
+    <config 
name="org.apache.sling.nosql.couchbase.client.CouchbaseClient.factory.config">
+      clientId=sling-resourceprovider-couchbase
+      couchbaseHosts=localhost:8091
+      bucketName=sling
+      enabled=B"true"
+    </config>
+    <!-- dependencies -->
+    <feature version="${feature.version}">sling-nosql-couchbase</feature>
+  </feature>
+  <feature name="sling-launchpad-nosql-mongodb" version="${feature.version}">
+    <config 
name="org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResourceProviderFactory.factory.config">
+      provider.roots=["/"]
+      connectionString=localhost:27017
+      database=sling
+      collection=resources
+    </config>
+    <!-- dependencies -->
+    <feature version="${feature.version}">sling-nosql-mongodb</feature>
+  </feature>
+  <!-- Apache Sling NoSQL (contrib) -->
+  <feature name="sling-nosql-generic" version="${feature.version}">
+    <bundle>mvn:org.apache.sling/org.apache.sling.nosql.generic/1.0.0</bundle>
+    <!-- dependencies -->
+    <feature version="${feature.version}">sling</feature>
+    <bundle dependency="true">mvn:org.apache.commons/commons-lang3/3.4</bundle>
+  </feature>
+  <feature name="sling-nosql-couchbase" version="${feature.version}">
+    
<bundle>mvn:org.apache.sling/org.apache.sling.nosql.couchbase-client/1.0.0</bundle>
+    
<bundle>mvn:org.apache.sling/org.apache.sling.nosql.couchbase-resourceprovider/1.0.0</bundle>
+    <!-- dependencies -->
+    <feature version="${feature.version}">sling-nosql-generic</feature>
+    <bundle 
dependency="true">mvn:io.wcm.osgi.wrapper/io.wcm.osgi.wrapper.rxjava/1.0.14-0000</bundle>
+  </feature>
+  <feature name="sling-nosql-mongodb" version="${feature.version}">
+    
<bundle>mvn:org.apache.sling/org.apache.sling.nosql.mongodb-resourceprovider/1.0.0</bundle>
+    <!-- dependencies -->
+    <feature version="${feature.version}">sling-nosql-generic</feature>
+    <bundle dependency="true">mvn:org.mongodb/mongo-java-driver/3.2.2</bundle>
+  </feature>
   <!-- Apache Sling Scripting (contrib) -->
   <feature name="sling-scripting-groovy" version="${feature.version}">
     
<bundle>mvn:org.apache.sling/org.apache.sling.scripting.groovy/1.0.2</bundle>

Added: 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingLaunchpadNosqlCouchbaseIT.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/bootstrap/SlingLaunchpadNosqlCouchbaseIT.java?rev=1732467&view=auto
==============================================================================
--- 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingLaunchpadNosqlCouchbaseIT.java
 (added)
+++ 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingLaunchpadNosqlCouchbaseIT.java
 Fri Feb 26 12:27:52 2016
@@ -0,0 +1,69 @@
+/*
+ * 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.bootstrap;
+
+import java.io.IOException;
+
+import javax.inject.Inject;
+
+import de.flapdoodle.embed.process.runtime.Network;
+import org.apache.sling.api.resource.ResourceProviderFactory;
+import org.apache.sling.launchpad.karaf.testing.KarafTestSupport;
+import org.junit.Ignore;
+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.OptionUtils;
+import org.ops4j.pax.exam.junit.PaxExam;
+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.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static 
org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingLaunchpadNosqlCouchbaseIT extends KarafTestSupport {
+
+    @Inject
+    @Filter(timeout = 300000)
+    public ResourceProviderFactory resourceProviderFactory;
+
+    @Configuration
+    public Option[] configuration() throws IOException {
+        final int port = Network.getFreeServerPort();
+        // TODO find a way to start CouchDB with this port and do real tests
+        final String couchbaseHosts = String.format("localhost:%s", port);
+        return OptionUtils.combine(baseConfiguration(),
+            
editConfigurationFilePut("etc/org.apache.sling.nosql.couchbase.client.CouchbaseClient.factory.config.cfg",
 "couchbaseHosts", couchbaseHosts),
+            addSlingFeatures("sling-launchpad-nosql-couchbase")
+        );
+    }
+
+    @Test
+    @Ignore
+    public void testResourceProviderFactory() {
+        assertNotNull(resourceProviderFactory);
+        
assertEquals("org.apache.sling.nosql.couchbase.resourceprovider.impl.CouchbaseNoSqlResourceProviderFactory",
 resourceProviderFactory.getClass().getName());
+    }
+
+}

Added: 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingLaunchpadNosqlMongoIT.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/bootstrap/SlingLaunchpadNosqlMongoIT.java?rev=1732467&view=auto
==============================================================================
--- 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingLaunchpadNosqlMongoIT.java
 (added)
+++ 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingLaunchpadNosqlMongoIT.java
 Fri Feb 26 12:27:52 2016
@@ -0,0 +1,103 @@
+/*
+ * 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.bootstrap;
+
+import java.io.IOException;
+
+import javax.inject.Inject;
+
+import de.flapdoodle.embed.mongo.MongodExecutable;
+import de.flapdoodle.embed.mongo.MongodProcess;
+import de.flapdoodle.embed.mongo.MongodStarter;
+import de.flapdoodle.embed.mongo.config.IMongodConfig;
+import de.flapdoodle.embed.mongo.config.MongodConfigBuilder;
+import de.flapdoodle.embed.mongo.config.Net;
+import de.flapdoodle.embed.mongo.distribution.Version;
+import de.flapdoodle.embed.process.runtime.Network;
+import org.apache.sling.api.resource.ResourceProviderFactory;
+import org.apache.sling.launchpad.karaf.testing.KarafTestSupport;
+import org.junit.AfterClass;
+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.OptionUtils;
+import org.ops4j.pax.exam.junit.PaxExam;
+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.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
+import static 
org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingLaunchpadNosqlMongoIT extends KarafTestSupport {
+
+    private static MongodExecutable executable;
+
+    private static MongodProcess process;
+
+    @Inject
+    @Filter(timeout = 300000)
+    public ResourceProviderFactory resourceProviderFactory;
+
+    protected void startMongo(final int port) throws IOException {
+        final MongodStarter starter = MongodStarter.getDefaultInstance();
+        final Net net = new Net(port, Network.localhostIsIPv6());
+        final IMongodConfig mongodConfig = new 
MongodConfigBuilder().version(Version.Main.PRODUCTION).net(net).build();
+        executable = starter.prepare(mongodConfig);
+        process = executable.start();
+    }
+
+    @AfterClass // TODO does it work? (no - not supported by Pax Exam)
+    public static void stopMongo() throws Exception {
+        if (executable != null) {
+            executable.stop();
+        }
+    }
+
+    @Configuration
+    public Option[] configuration() throws IOException {
+        final int port = Network.getFreeServerPort();
+        startMongo(port);
+        final String connectionString = String.format("localhost:%s", port);
+        return OptionUtils.combine(baseConfiguration(),
+            editConfigurationFilePut("etc/org.apache.karaf.features.cfg", 
"featuresBoot", "(wrap)"),
+            
editConfigurationFilePut("etc/org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResourceProviderFactory.factory.config.cfg",
 "connectionString", connectionString),
+            
wrappedBundle(mavenBundle().groupId("de.flapdoodle.embed").artifactId("de.flapdoodle.embed.mongo").versionAsInProject()),
+            
wrappedBundle(mavenBundle().groupId("de.flapdoodle.embed").artifactId("de.flapdoodle.embed.process").versionAsInProject()),
+            
wrappedBundle(mavenBundle().groupId("net.java.dev.jna").artifactId("jna").versionAsInProject()),
+            
wrappedBundle(mavenBundle().groupId("net.java.dev.jna").artifactId("jna-platform").versionAsInProject()),
+            
mavenBundle().groupId("org.apache.commons").artifactId("commons-compress").versionAsInProject(),
+            
mavenBundle().groupId("org.apache.commons").artifactId("commons-lang3").versionAsInProject(),
+            addSlingFeatures("sling-launchpad-nosql-mongodb")
+        );
+    }
+
+    @Test
+    public void testResourceProviderFactory() {
+        assertNotNull(resourceProviderFactory);
+        
assertEquals("org.apache.sling.nosql.mongodb.resourceprovider.impl.MongoDBNoSqlResourceProviderFactory",
 resourceProviderFactory.getClass().getName());
+    }
+
+}

Added: 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlCouchbaseIT.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/bootstrap/SlingNosqlCouchbaseIT.java?rev=1732467&view=auto
==============================================================================
--- 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlCouchbaseIT.java
 (added)
+++ 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlCouchbaseIT.java
 Fri Feb 26 12:27:52 2016
@@ -0,0 +1,60 @@
+/*
+ * 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.bootstrap;
+
+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.OptionUtils;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.osgi.framework.Bundle;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingNosqlCouchbaseIT extends KarafTestSupport {
+
+    @Configuration
+    public Option[] configuration() {
+        return OptionUtils.combine(baseConfiguration(),
+            addSlingFeatures("sling-nosql-couchbase")
+        );
+    }
+
+    @Test
+    public void testOrgApacheSlingNosqlCouchbaseClient() {
+        final Bundle bundle = 
findBundle("org.apache.sling.nosql.couchbase-client");
+        assertNotNull(bundle);
+        assertEquals(Bundle.ACTIVE, bundle.getState());
+    }
+
+    @Test
+    public void testOrgApacheSlingNosqlCouchbaseResourceprovider() {
+        final Bundle bundle = 
findBundle("org.apache.sling.nosql.couchbase-resourceprovider");
+        assertNotNull(bundle);
+        assertEquals(Bundle.ACTIVE, bundle.getState());
+    }
+
+}

Added: 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlGenericIT.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/bootstrap/SlingNosqlGenericIT.java?rev=1732467&view=auto
==============================================================================
--- 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlGenericIT.java
 (added)
+++ 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlGenericIT.java
 Fri Feb 26 12:27:52 2016
@@ -0,0 +1,53 @@
+/*
+ * 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.bootstrap;
+
+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.OptionUtils;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.osgi.framework.Bundle;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingNosqlGenericIT extends KarafTestSupport {
+
+    @Configuration
+    public Option[] configuration() {
+        return OptionUtils.combine(baseConfiguration(),
+            addSlingFeatures("sling-nosql-generic")
+        );
+    }
+
+    @Test
+    public void testOrgApacheSlingNosqlGeneric() {
+        final Bundle bundle = findBundle("org.apache.sling.nosql.generic");
+        assertNotNull(bundle);
+        assertEquals(Bundle.ACTIVE, bundle.getState());
+    }
+
+}

Added: 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlMongoIT.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/bootstrap/SlingNosqlMongoIT.java?rev=1732467&view=auto
==============================================================================
--- 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlMongoIT.java
 (added)
+++ 
sling/trunk/contrib/launchpad/karaf/org.apache.sling.launchpad.karaf-integration-tests/src/test/java/org/apache/sling/launchpad/karaf/tests/bootstrap/SlingNosqlMongoIT.java
 Fri Feb 26 12:27:52 2016
@@ -0,0 +1,53 @@
+/*
+ * 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.bootstrap;
+
+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.OptionUtils;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.osgi.framework.Bundle;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class SlingNosqlMongoIT extends KarafTestSupport {
+
+    @Configuration
+    public Option[] configuration() {
+        return OptionUtils.combine(baseConfiguration(),
+            addSlingFeatures("sling-nosql-mongodb")
+        );
+    }
+
+    @Test
+    public void testOrgApacheSlingNosqlGeneric() {
+        final Bundle bundle = findBundle("org.apache.sling.nosql.generic");
+        assertNotNull(bundle);
+        assertEquals(Bundle.ACTIVE, bundle.getState());
+    }
+
+}


Reply via email to