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 2019/10/31 16:27:49 UTC
[sling-org-apache-sling-jcr-repoinit] 02/07: SLING-8740 - remove
ProvisioningModelIT (redundant with
sling-org-apache-sling-launchpad-integration-tests/RepoinitPathTest) and
prepare for moving RepoInitTextIT to paxexam testing
This is an automated email from the ASF dual-hosted git repository.
bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git
commit bf54cebe5441b27d827fd1fcbfa952adde0de424
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Oct 31 15:07:09 2019 +0100
SLING-8740 - remove ProvisioningModelIT (redundant with sling-org-apache-sling-launchpad-integration-tests/RepoinitPathTest) and prepare for moving RepoInitTextIT to paxexam testing
---
pom.xml | 73 -------------------
.../sling/jcr/repoinit/it/ProvisioningModelIT.java | 83 ----------------------
.../sling/jcr/repoinit/it/RepoInitTextIT.java | 19 +++--
3 files changed, 8 insertions(+), 167 deletions(-)
diff --git a/pom.xml b/pom.xml
index 0f3156f..02a8802 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,8 +38,6 @@
<properties>
<jackrabbit.version>2.18.2</jackrabbit.version>
<oak.version>1.16.0</oak.version>
- <http.host>localhost</http.host>
- <sling.default.vm.options>-Xmx1024m -XX:MaxPermSize=256m -Djava.awt.headless=true</sling.default.vm.options>
</properties>
<scm>
@@ -60,71 +58,6 @@
</excludePackageNames>
</configuration>
</plugin>
- <plugin>
- <!-- Find free ports to run our server -->
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>reserve-server-port</id>
- <goals>
- <goal>reserve-network-port</goal>
- </goals>
- <phase>process-resources</phase>
- <configuration>
- <portNames>
- <!-- used port name must be stored in property because it must be used for the base url -->
- <portName>http.port</portName>
- </portNames>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.sling</groupId>
- <artifactId>slingstart-maven-plugin</artifactId>
- <extensions>true</extensions>
- <executions>
- <execution>
- <id>prepare-launchpad-package</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>prepare-package</goal>
- </goals>
- </execution>
- <execution>
- <id>build-launchpad-package</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>package</goal>
- </goals>
- </execution>
- <execution>
- <id>start-container-before-IT</id>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container-after-IT</id>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <usePomDependencies>true</usePomDependencies>
- <attachArtifact>false</attachArtifact>
- <disableExtendingMavenClasspath>true</disableExtendingMavenClasspath>
- <servers>
- <server>
- <id>singleinstance</id>
- <port>${http.port}</port>
- <vmOpts>${sling.vm.options}</vmOpts>
- </server>
- </servers>
- </configuration>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
@@ -144,12 +77,6 @@
</goals>
</execution>
</executions>
- <configuration>
- <systemPropertyVariables>
- <ClientSideTeleporter.baseUrl>http://${http.host}:${http.port}/</ClientSideTeleporter.baseUrl>
- <ClientSideTeleporter.testReadyTimeoutSeconds>20</ClientSideTeleporter.testReadyTimeoutSeconds>
- </systemPropertyVariables>
- </configuration>
</plugin>
</plugins>
</build>
diff --git a/src/test/java/org/apache/sling/jcr/repoinit/it/ProvisioningModelIT.java b/src/test/java/org/apache/sling/jcr/repoinit/it/ProvisioningModelIT.java
deleted file mode 100644
index ee95ee9..0000000
--- a/src/test/java/org/apache/sling/jcr/repoinit/it/ProvisioningModelIT.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.jcr.repoinit.it;
-
-import java.util.UUID;
-import javax.jcr.Session;
-import org.apache.sling.jcr.api.SlingRepository;
-import org.apache.sling.junit.rules.TeleporterRule;
-import org.junit.After;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-
-/** Integration test that verifies that repoinit statements
- * provided in a provisioning model are correctly applied.
- */
-public class ProvisioningModelIT {
-
- private Session session;
- private static final String TEST_PATH = "/repoinit/fromProvisioningModel";
- private static final String TEST_USER = "userFromProvisioningModel";
- private static final String SECOND_TEST_USER = "secondUserFromProvisioningModel";
- private static final String THIRD_TEST_USER = "thirdUserFromProvisioningModel";
- private final String uniqueID = UUID.randomUUID().toString();
-
- @Rule
- public TeleporterRule teleporter = TeleporterRule.forClass(getClass(), "IT");
-
- @Before
- public void setup() throws Exception {
- session = teleporter.getService(SlingRepository.class).loginAdministrative(null);
- }
-
- @After
- public void cleanup() {
- if(session != null) {
- session.logout();
- }
- }
-
- @Test
- public void usersCreated() throws Exception {
- assertTrue("Expecting user " + TEST_USER, U.userExists(session, TEST_USER));
- assertTrue("Expecting user " + SECOND_TEST_USER, U.userExists(session, SECOND_TEST_USER));
- assertTrue("Expecting user " + THIRD_TEST_USER, U.userExists(session, THIRD_TEST_USER));
- }
-
- @Test
- public void userDisabled() throws Exception {
- assertTrue(String.format("Expecting user %s to be disabled", THIRD_TEST_USER), U.userIsDisabled(session, THIRD_TEST_USER));
- assertFalse(String.format("Expecting user %s to be enabled", TEST_USER), U.userIsDisabled(session,TEST_USER));
- }
-
- @Test
- public void userAclSet() throws Exception {
- assertTrue("Expecting read access", U.canRead(session, TEST_USER, TEST_PATH));
- assertFalse("Expecting no write access", U.canWrite(session, TEST_USER, TEST_PATH));
- }
-
- @Test
- public void namespaceAndCndRegistered() throws Exception {
- final String nodeName = "ns-" + uniqueID;
- session.getRootNode().addNode(nodeName, "slingtest:unstructured");
- session.save();
- }
-}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/jcr/repoinit/it/RepoInitTextIT.java b/src/test/java/org/apache/sling/jcr/repoinit/it/RepoInitTextIT.java
index e9b35f8..856d040 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/it/RepoInitTextIT.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/it/RepoInitTextIT.java
@@ -45,29 +45,24 @@ public class RepoInitTextIT {
public static final String REPO_INIT_FILE = "/repoinit.txt";
- @Rule
- public TeleporterRule teleporter = TeleporterRule
- .forClass(getClass(), "IT")
- .withResources(REPO_INIT_FILE);
-
@Before
public void setup() throws Exception {
- session = teleporter.getService(SlingRepository.class).loginAdministrative(null);
+ session = null; // TODO
// Execute some repoinit statements
final InputStream is = getClass().getResourceAsStream(REPO_INIT_FILE);
assertNotNull("Expecting " + REPO_INIT_FILE, is);
try {
- final RepoInitParser parser = teleporter.getService(RepoInitParser.class);
- final JcrRepoInitOpsProcessor processor = teleporter.getService(JcrRepoInitOpsProcessor.class);
- processor.apply(session, parser.parse(new InputStreamReader(is, "UTF-8")));
- session.save();
+ //final RepoInitParser parser = teleporter.getService(RepoInitParser.class);
+ //final JcrRepoInitOpsProcessor processor = teleporter.getService(JcrRepoInitOpsProcessor.class);
+ //processor.apply(session, parser.parse(new InputStreamReader(is, "UTF-8")));
+ //session.save();
} finally {
is.close();
}
// The repoinit file causes those nodes to be created
- assertTrue("Expecting test nodes to be created", session.itemExists("/acltest/A/B"));
+ //assertTrue("Expecting test nodes to be created", session.itemExists("/acltest/A/B"));
}
@After
@@ -77,6 +72,7 @@ public class RepoInitTextIT {
}
}
+ /*
@Test
public void serviceUserCreated() throws Exception {
new Retry() {
@@ -111,4 +107,5 @@ public class RepoInitTextIT {
}
};
}
+ */
}
\ No newline at end of file