Author: rombert
Date: Mon May 26 09:18:10 2014
New Revision: 1597534
URL: http://svn.apache.org/r1597534
Log:
SLING-3081 - Do not re-publish modules when starting the launchpad for
the first time
Update all tests to write content after the module is deployed, in
preparation for the main change.
Modified:
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentDeploymentTest.java
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrPartialCoverageAggregatesDeploymentTest.java
Modified:
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentDeploymentTest.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentDeploymentTest.java?rev=1597534&r1=1597533&r2=1597534&view=diff
==============================================================================
---
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentDeploymentTest.java
(original)
+++
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentDeploymentTest.java
Mon May 26 09:18:10 2014
@@ -33,7 +33,6 @@ import javax.jcr.RepositoryException;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.URIException;
-import org.apache.commons.io.IOUtils;
import org.apache.sling.ide.test.impl.helpers.DisableDebugStatusHandlers;
import org.apache.sling.ide.test.impl.helpers.ExternalSlingLaunchpad;
import org.apache.sling.ide.test.impl.helpers.LaunchpadConfig;
@@ -85,15 +84,15 @@ public class ContentDeploymentTest {
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures(JavaCore.NATURE_ID,
"org.eclipse.wst.common.project.facet.core.nature");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.txt"),
new ByteArrayInputStream(
- "hello, world".getBytes()));
-
// install bundle facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.txt"),
new ByteArrayInputStream(
+ "hello, world".getBytes()));
+
// verify that file is created
final RepositoryAccessor repo = new RepositoryAccessor(config);
Poller poller = new Poller();
@@ -142,15 +141,15 @@ public class ContentDeploymentTest {
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.txt"),
- new ByteArrayInputStream("hello, world".getBytes()));
-
// install bundle facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.txt"),
new ByteArrayInputStream(
+ "hello, world".getBytes()));
+
// verifications
final RepositoryAccessor repo = new RepositoryAccessor(config);
Poller poller = new Poller();
@@ -176,15 +175,15 @@ public class ContentDeploymentTest {
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures(JavaCore.NATURE_ID,
"org.eclipse.wst.common.project.facet.core.nature");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.esp"),
new ByteArrayInputStream(
- "// not really javascript".getBytes()));
-
// install bundle facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.esp"),
new ByteArrayInputStream(
+ "// not really javascript".getBytes()));
+
// verify that file is created
final RepositoryAccessor repo = new RepositoryAccessor(config);
Poller poller = new Poller();
Modified:
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java?rev=1597534&r1=1597533&r2=1597534&view=diff
==============================================================================
---
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java
(original)
+++
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java
Mon May 26 09:18:10 2014
@@ -69,18 +69,18 @@ public class ContentImportTest {
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures(JavaCore.NATURE_ID,
"org.eclipse.wst.common.project.facet.core.nature");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en/hello.txt"),
- new ByteArrayInputStream("hello, world".getBytes()));
-
-
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
getClass()
- .getResourceAsStream("filter-only-content-test-root-en.xml"));
-
// install bundle facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en/hello.txt"),
+ new ByteArrayInputStream("hello, world".getBytes()));
+
+
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
getClass()
+ .getResourceAsStream("filter-only-content-test-root-en.xml"));
+
// create server-side content
RepositoryAccessor repo = new RepositoryAccessor(config);
repo.createNode("/content/test-root/en", "nt:folder");
@@ -105,18 +105,18 @@ public class ContentImportTest {
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures(JavaCore.NATURE_ID,
"org.eclipse.wst.common.project.facet.core.nature");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en/hello.txt"),
- new ByteArrayInputStream("hello, world".getBytes()));
-
-
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
getClass()
- .getResourceAsStream("filter-only-content-test-root-en.xml"));
-
// install bundle facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en/hello.txt"),
+ new ByteArrayInputStream("hello, world".getBytes()));
+
+
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
getClass()
+ .getResourceAsStream("filter-only-content-test-root-en.xml"));
+
// create server-side content
RepositoryAccessor repo = new RepositoryAccessor(config);
repo.createNode("/content/test-root/de", "nt:folder");
@@ -140,18 +140,18 @@ public class ContentImportTest {
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures(JavaCore.NATURE_ID,
"org.eclipse.wst.common.project.facet.core.nature");
-
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
getClass()
- .getResourceAsStream("filter-only-content-test-root-en.xml"));
-
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/.vltignore"),
- new ByteArrayInputStream("en\n".getBytes()));
-
// install bundle facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
getClass()
+ .getResourceAsStream("filter-only-content-test-root-en.xml"));
+
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/.vltignore"),
+ new ByteArrayInputStream("en\n".getBytes()));
+
// create server-side content
RepositoryAccessor repo = new RepositoryAccessor(config);
repo.createNode("/content/test-root/en", "nt:folder");
@@ -175,6 +175,12 @@ public class ContentImportTest {
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures(JavaCore.NATURE_ID,
"org.eclipse.wst.common.project.facet.core.nature");
+ // install bundle facet
+ project.installFacet("sling.content", "1.0");
+
+ ServerAdapter server = new ServerAdapter(wstServer.getServer());
+ server.installModule(contentProject);
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/hello.txt"),
new ByteArrayInputStream(
"hello, world".getBytes()));
@@ -184,12 +190,6 @@ public class ContentImportTest {
project.createOrUpdateFile(Path.fromPortableString("jcr_root/.vltignore"), new
ByteArrayInputStream(
"content/test-root/en\n".getBytes()));
- // install bundle facet
- project.installFacet("sling.content", "1.0");
-
- ServerAdapter server = new ServerAdapter(wstServer.getServer());
- server.installModule(contentProject);
-
// create server-side content
RepositoryAccessor repo = new RepositoryAccessor(config);
repo.createNode("/content/test-root/en", "nt:folder");
Modified:
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java?rev=1597534&r1=1597533&r2=1597534&view=diff
==============================================================================
---
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java
(original)
+++
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java
Mon May 26 09:18:10 2014
@@ -80,16 +80,16 @@ public class JcrFullCoverageAggregatesDe
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
- // create .content.xml structure
- InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
-
// install content facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+ // create .content.xml structure
+ InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
+
Matcher<Node> postConditions = allOf(hasPath("/content/test-root/en"),
hasPrimaryType("sling:Folder"),
hasMixinTypes("mix:language"), hasChildrenCount(3));
@@ -115,16 +115,16 @@ public class JcrFullCoverageAggregatesDe
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
- // create .content.xml structure
- InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
-
// install content facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+ // create .content.xml structure
+ InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
+
Matcher<Node> postConditions = allOf(hasPath("/content/test-root/en"),
hasPrimaryType("sling:Folder"),
hasMixinTypes("mix:language"), hasChildrenCount(3));
@@ -166,16 +166,16 @@ public class JcrFullCoverageAggregatesDe
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
- // create .content.xml structure
- InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
-
// install content facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+ // create .content.xml structure
+ InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
+
Matcher<Node> postConditions = allOf(hasPath("/content/test-root/en"),
hasPrimaryType("sling:Folder"),
hasMixinTypes("mix:language"), hasChildrenCount(3));
@@ -217,16 +217,16 @@ public class JcrFullCoverageAggregatesDe
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
- // create .content.xml structure
- InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
-
// install content facet
project.installFacet("sling.content", "1.0");
ServerAdapter server = new ServerAdapter(wstServer.getServer());
server.installModule(contentProject);
+ // create .content.xml structure
+ InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
+
Matcher<Node> postConditions = allOf(hasPath("/content/test-root/en"),
hasPrimaryType("sling:Folder"),
hasMixinTypes("mix:language"), hasChildrenNames("message",
"error", "warning"));
@@ -269,24 +269,24 @@ public class JcrFullCoverageAggregatesDe
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
- // create filter.xml
- InputStream filterXml =
getClass().getResourceAsStream("filter-only-content-test-root-en.xml");
-
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
filterXml);
-
- // create .content.xml structure
- InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
-
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
-
// install content facet
project.installFacet("sling.content", "1.0");
+ ServerAdapter server = new ServerAdapter(wstServer.getServer());
+ server.installModule(contentProject);
+
// create prerequisite data
final RepositoryAccessor repo = new RepositoryAccessor(config);
repo.createNode("/content", "sling:Folder");
repo.createNode("/content/test-root", "sling:Folder");
- ServerAdapter server = new ServerAdapter(wstServer.getServer());
- server.installModule(contentProject);
+ // create filter.xml
+ InputStream filterXml =
getClass().getResourceAsStream("filter-only-content-test-root-en.xml");
+
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
filterXml);
+
+ // create .content.xml structure
+ InputStream contentXml =
getClass().getResourceAsStream("content-nested-structure.xml");
+
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
contentXml);
Matcher<Node> postConditions = allOf(hasPath("/content/test-root/en"),
hasPrimaryType("sling:Folder"),
hasMixinTypes("mix:language"), hasChildrenCount(3));
Modified:
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrPartialCoverageAggregatesDeploymentTest.java
URL:
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrPartialCoverageAggregatesDeploymentTest.java?rev=1597534&r1=1597533&r2=1597534&view=diff
==============================================================================
---
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrPartialCoverageAggregatesDeploymentTest.java
(original)
+++
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrPartialCoverageAggregatesDeploymentTest.java
Mon May 26 09:18:10 2014
@@ -78,6 +78,12 @@ public class JcrPartialCoverageAggregate
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
+ // install content facet
+ project.installFacet("sling.content", "1.0");
+
+ ServerAdapter server = new ServerAdapter(wstServer.getServer());
+ server.installModule(contentProject);
+
// create a sling:Folder at /content/test-root
InputStream contentXml =
getClass().getResourceAsStream("sling-folder-nodetype.xml");
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/.content.xml"),
contentXml);
@@ -87,12 +93,6 @@ public class JcrPartialCoverageAggregate
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/nested/.content.xml"),
childContentXml);
- // install content facet
- project.installFacet("sling.content", "1.0");
-
- ServerAdapter server = new ServerAdapter(wstServer.getServer());
- server.installModule(contentProject);
-
Matcher<Node> postConditions = allOf(hasPath("/content/test-root"),
hasPrimaryType("sling:Folder"),
hasChildrenCount(1));
@@ -132,6 +132,12 @@ public class JcrPartialCoverageAggregate
ProjectAdapter project = new ProjectAdapter(contentProject);
project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
+ // install content facet
+ project.installFacet("sling.content", "1.0");
+
+ ServerAdapter server = new ServerAdapter(wstServer.getServer());
+ server.installModule(contentProject);
+
// create a sling:Folder at /content/test-root
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/.content.xml"),
getClass()
.getResourceAsStream("sling-folder-nodetype.xml"));
@@ -144,12 +150,6 @@ public class JcrPartialCoverageAggregate
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/nested/nested/.content.xml"),
getClass().getResourceAsStream("nt-unstructured-nodetype.xml"));
- // install content facet
- project.installFacet("sling.content", "1.0");
-
- ServerAdapter server = new ServerAdapter(wstServer.getServer());
- server.installModule(contentProject);
-
Matcher<Node> postConditions =
allOf(hasPath("/content/test-root/nested"), hasPrimaryType("nt:unstructured"),
hasChildrenCount(1));