From bc52f866dbe17c095a4e7e33e3f07783d0d120db Mon Sep 17 00:00:00 2001 From: John Ament Date: Sun, 6 Mar 2011 20:53:05 -0500 Subject: [PATCH 1/3] SEAMJCR-14 - Provide basic configuration setup. Updated test cases to use this class as well. --- .../java/org/jboss/seam/jcr/ConfigParams.java | 30 +++++++++++++++++++ .../jcr/events/JcrCDIEventListenerTest.java | 4 ++- .../RepositorySessionProducerTest.java | 7 +++-- .../jcr/events/JcrCDIEventListenerTest.java | 4 ++- .../jcr/producers/RepositoryInjectTest.java | 5 ++-- 5 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 api/src/main/java/org/jboss/seam/jcr/ConfigParams.java diff --git a/api/src/main/java/org/jboss/seam/jcr/ConfigParams.java b/api/src/main/java/org/jboss/seam/jcr/ConfigParams.java new file mode 100644 index 0000000..fa88fd2 --- /dev/null +++ b/api/src/main/java/org/jboss/seam/jcr/ConfigParams.java @@ -0,0 +1,30 @@ +/* + JBoss, Home of Professional Open Source + Copyright [2010], Red Hat, Inc., and individual contributors + by the @authors tag. See the copyright.txt in the distribution for a + full listing of individual contributors. + + Licensed 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.jboss.seam.jcr; + +/** + * A set of ConfigParams for both Jackrabbit and ModeShape to avoid duplicating the setting value. + * + * @author johnament + */ +public abstract class ConfigParams { + private ConfigParams() { } + + public static final String JACKRABBIT_REPOSITORY_CONF = "org.apache.jackrabbit.repository.conf"; + public static final String JACKRABBIT_REPOSITORY_HOME = "org.apache.jackrabbit.repository.home"; + public static final String MODESHAPE_URL = "org.modeshape.jcr.URL"; +} diff --git a/tests/jackrabbit/src/test/java/org/jboss/seam/jcr/events/JcrCDIEventListenerTest.java b/tests/jackrabbit/src/test/java/org/jboss/seam/jcr/events/JcrCDIEventListenerTest.java index b9567ea..a2ec0b4 100644 --- a/tests/jackrabbit/src/test/java/org/jboss/seam/jcr/events/JcrCDIEventListenerTest.java +++ b/tests/jackrabbit/src/test/java/org/jboss/seam/jcr/events/JcrCDIEventListenerTest.java @@ -39,6 +39,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import static org.jboss.seam.jcr.ConfigParams.*; + /** * Test case for {@link JcrCDIEventListener} * @@ -54,7 +56,7 @@ public class JcrCDIEventListenerTest { @Inject - @JcrRepository(name = "org.apache.jackrabbit.repository.home", value = "target") + @JcrRepository(name = JACKRABBIT_REPOSITORY_HOME, value = "target") private Repository repository; @Inject diff --git a/tests/jackrabbit/src/test/java/org/jboss/seam/jcr/producers/RepositorySessionProducerTest.java b/tests/jackrabbit/src/test/java/org/jboss/seam/jcr/producers/RepositorySessionProducerTest.java index b8a50c1..36a0d9f 100644 --- a/tests/jackrabbit/src/test/java/org/jboss/seam/jcr/producers/RepositorySessionProducerTest.java +++ b/tests/jackrabbit/src/test/java/org/jboss/seam/jcr/producers/RepositorySessionProducerTest.java @@ -24,6 +24,7 @@ import org.jboss.arquillian.api.Deployment; import org.jboss.arquillian.junit.Arquillian; +import org.jboss.seam.jcr.ConfigParams; import org.jboss.seam.jcr.annotations.JcrRepository; import org.jboss.shrinkwrap.api.ArchivePaths; import org.jboss.shrinkwrap.api.ShrinkWrap; @@ -33,6 +34,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import static org.jboss.seam.jcr.ConfigParams.*; + /** * Test case for {@link RepositorySessionProducer} * @@ -47,11 +50,11 @@ public class RepositorySessionProducerTest { @Inject - @JcrRepository(name = "org.apache.jackrabbit.repository.home", value = "target") + @JcrRepository(name = JACKRABBIT_REPOSITORY_HOME, value = "target") private Repository repository; @Inject - @JcrRepository(name = "org.apache.jackrabbit.repository.home", value = "target") + @JcrRepository(name = JACKRABBIT_REPOSITORY_HOME, value = "target") private Session session; @Deployment diff --git a/tests/modeshape/src/test/java/org/jboss/seam/jcr/events/JcrCDIEventListenerTest.java b/tests/modeshape/src/test/java/org/jboss/seam/jcr/events/JcrCDIEventListenerTest.java index d5aa102..664d3c7 100644 --- a/tests/modeshape/src/test/java/org/jboss/seam/jcr/events/JcrCDIEventListenerTest.java +++ b/tests/modeshape/src/test/java/org/jboss/seam/jcr/events/JcrCDIEventListenerTest.java @@ -40,6 +40,8 @@ import org.junit.Test; import org.junit.runner.RunWith; +import static org.jboss.seam.jcr.ConfigParams.*; + /** * Test case for {@link JcrCDIEventListener} * @@ -57,7 +59,7 @@ public class JcrCDIEventListenerTest @Inject private EventCounterListener counter; - @Inject @JcrRepository(name="org.modeshape.jcr.URL",value="file:target/test-classes/modeshape.xml?repositoryName=CarRepo") + @Inject @JcrRepository(name=MODESHAPE_URL,value="file:target/test-classes/modeshape.xml?repositoryName=CarRepo") private Session session; @Inject BeanManager beanManager; diff --git a/tests/modeshape/src/test/java/org/jboss/seam/jcr/producers/RepositoryInjectTest.java b/tests/modeshape/src/test/java/org/jboss/seam/jcr/producers/RepositoryInjectTest.java index d2fe797..66f0ee9 100644 --- a/tests/modeshape/src/test/java/org/jboss/seam/jcr/producers/RepositoryInjectTest.java +++ b/tests/modeshape/src/test/java/org/jboss/seam/jcr/producers/RepositoryInjectTest.java @@ -30,6 +30,7 @@ import org.junit.Test; import org.junit.runner.RunWith; +import static org.jboss.seam.jcr.ConfigParams.*; /** * * @author johnament @@ -42,10 +43,10 @@ public static JavaArchive createArchive() return ShrinkWrap.create(JavaArchive.class).addPackage(RepositorySessionProducer.class.getPackage()).addManifestResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml")); } - @Inject @JcrRepository(name="org.modeshape.jcr.URL",value="file:target/test-classes/modeshape.xml?repositoryName=CarRepo") + @Inject @JcrRepository(name=MODESHAPE_URL,value="file:target/test-classes/modeshape.xml?repositoryName=CarRepo") Repository carRepo; - @Inject @JcrRepository(name="org.modeshape.jcr.URL",value="file:target/test-classes/modeshape.xml?repositoryName=CarRepo") + @Inject @JcrRepository(name=MODESHAPE_URL,value="file:target/test-classes/modeshape.xml?repositoryName=CarRepo") Session carSession; @Test From 9d2eb40e62bd6ccec5271043efed9a3bfb953964 Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Tue, 8 Mar 2011 23:08:26 -0300 Subject: [PATCH 2/3] Changed Jackrabbit config --- docs/src/main/docbook/en-US/jackrabbit.xml | 112 ++++++++++----------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/docs/src/main/docbook/en-US/jackrabbit.xml b/docs/src/main/docbook/en-US/jackrabbit.xml index 1cf62b1..8a5d738 100644 --- a/docs/src/main/docbook/en-US/jackrabbit.xml +++ b/docs/src/main/docbook/en-US/jackrabbit.xml @@ -1,56 +1,56 @@ - - - - - Seam JCR - JackRabbit Integration - -
- JackRabbit Integration Installation - - In order to activate JackRabbit support within your application, you need to include JackRabbit on your classpath. At a minimum, the following - maven dependency must be satisfied. - - - org.apache.jackrabbit - jackrabbit-core - ${jackrabbit.version} -]]> - - - - Substitute ${jackrabbit.version} for the JackRabbit version you are running against. Currently, Seam JCR tests against 2.2.4. Please review JackRabbit documentation to determine any additional dependencies. - - -
-
- Usage - - In order to use JackRabbit's Repository and Session objects in your application, you must define an injection point using the JcrRepository annotation based on JackRabbit's required configuration parameters. - - -
- - -
+ + + + + Seam JCR - JackRabbit Integration + +
+ JackRabbit Integration Installation + + In order to activate JackRabbit support within your application, you need to include JackRabbit on your classpath. At a minimum, the following + maven dependency must be satisfied. + + + org.apache.jackrabbit + jackrabbit-core + ${jackrabbit.version} +]]> + + + + Substitute ${jackrabbit.version} for the JackRabbit version you are running against. Currently, Seam JCR tests against 2.2.4. Please review JackRabbit documentation to determine any additional dependencies. + + +
+
+ Usage + + In order to use JackRabbit's Repository and Session objects in your application, you must define an injection point using the JcrRepository annotation based on JackRabbit's required configuration parameters. + + +
+ + +
From 2a6970e36250f2dca696c46d5d12630bcaf7ca02 Mon Sep 17 00:00:00 2001 From: "mgencur@redhat.com" Date: Fri, 11 Mar 2011 10:19:04 +0100 Subject: [PATCH 3/3] code coverage measuring --- impl/pom.xml | 38 +++++++++++++++++++++---- pom.xml | 31 +++++++++++++++++++++ tests/jackrabbit/pom.xml | 7 ++++- tests/modeshape/pom.xml | 60 +++++++++++++++++++++++++++++++++++++++- tests/pom.xml | 2 +- 5 files changed, 130 insertions(+), 8 deletions(-) diff --git a/impl/pom.xml b/impl/pom.xml index 4d33832..bab3f95 100644 --- a/impl/pom.xml +++ b/impl/pom.xml @@ -46,14 +46,42 @@ org.codehaus.mojo emma-maven-plugin + + + instrumentation + process-classes + + instrument + + + true + + + org.apache.maven.plugins - maven-surefire-plugin - - - org.sonatype.maven.plugin - emma4it-maven-plugin + maven-antrun-plugin + + + complete-classpath-for-tests + process-classes + + run + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index d1c0788..d420cd4 100644 --- a/pom.xml +++ b/pom.xml @@ -30,6 +30,7 @@ 3.0.0.CR1 1.0.0.CR1 2.0 + 2.0.5312 @@ -147,6 +148,36 @@ + + code-coverage + + + emma + emma + ${emma.version} + + + + + + maven-clean-plugin + + + + ${basedir}/ + + **/*.ec + **/*.em + **/transaction.log + + false + + + + + + + diff --git a/tests/jackrabbit/pom.xml b/tests/jackrabbit/pom.xml index f66a9f9..9bb97f6 100644 --- a/tests/jackrabbit/pom.xml +++ b/tests/jackrabbit/pom.xml @@ -27,4 +27,9 @@ ${jackrabbit.core.version} - \ No newline at end of file + + + code-coverage + + + diff --git a/tests/modeshape/pom.xml b/tests/modeshape/pom.xml index 173f800..557608a 100644 --- a/tests/modeshape/pom.xml +++ b/tests/modeshape/pom.xml @@ -28,4 +28,62 @@ test - \ No newline at end of file + + + code-coverage + + + + org.sonatype.maven.plugin + emma4it-maven-plugin + + + merge + post-integration-test + + merge + + + ${project.parent.build.directory}/../../ + + + + report + verify + + report + + + + + ${project.parent.build.directory}/../../impl/src/main/java + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + retrieve-coverage-files + post-integration-test + + run + + + + + + + + + + + + + + diff --git a/tests/pom.xml b/tests/pom.xml index 152259a..ba5ff11 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -78,4 +78,4 @@ - \ No newline at end of file +