Author: chris.laprun(a)jboss.com
Date: 2011-05-18 09:51:58 -0400 (Wed, 18 May 2011)
New Revision: 6483
Added:
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/registration/
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/registration/JCRRegistrationPersistenceManagerTestCase.java
Modified:
components/wsrp/trunk/jcr-impl/pom.xml
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java
Log:
- Added JCRRegistrationPersistenceManagerTestCase.
Modified: components/wsrp/trunk/jcr-impl/pom.xml
===================================================================
--- components/wsrp/trunk/jcr-impl/pom.xml 2011-05-18 13:49:07 UTC (rev 6482)
+++ components/wsrp/trunk/jcr-impl/pom.xml 2011-05-18 13:51:58 UTC (rev 6483)
@@ -22,7 +22,8 @@
~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
-<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/xsd/maven-4.0.0.xsd">
+<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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>wsrp-parent</artifactId>
<groupId>org.gatein.wsrp</groupId>
@@ -90,6 +91,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-producer-lib</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
<!-- JBoss dependencies -->
<dependency>
<groupId>org.jboss</groupId>
Added:
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/registration/JCRRegistrationPersistenceManagerTestCase.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/registration/JCRRegistrationPersistenceManagerTestCase.java
(rev 0)
+++
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/registration/JCRRegistrationPersistenceManagerTestCase.java 2011-05-18
13:51:58 UTC (rev 6483)
@@ -0,0 +1,62 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.wsrp.registration;
+
+import org.chromattic.api.ChromatticBuilder;
+import org.gatein.registration.AbstractRegistrationPersistenceManagerTestCase;
+import org.gatein.registration.RegistrationPersistenceManager;
+import org.gatein.wsrp.jcr.BaseChromatticPersister;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class JCRRegistrationPersistenceManagerTestCase extends
AbstractRegistrationPersistenceManagerTestCase
+{
+ JCRRegistrationPersistenceManager persistenceManager;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ String workspaceName = "/wsrp-jcr-test" + Math.round(Math.abs(100000 *
Math.random()));
+ BaseChromatticPersister persister = new BaseChromatticPersister(workspaceName)
+ {
+ @Override
+ protected void setBuilderOptions(ChromatticBuilder builder)
+ {
+ builder.setOptionValue(ChromatticBuilder.ROOT_NODE_PATH, workspaceName);
+ builder.setOptionValue(ChromatticBuilder.ROOT_NODE_TYPE,
"nt:unstructured");
+ builder.setOptionValue(ChromatticBuilder.CREATE_ROOT_NODE, true);
+ }
+ };
+ persister.initializeBuilderFor(JCRRegistrationPersistenceManager.mappingClasses);
+ persistenceManager = new JCRRegistrationPersistenceManager(persister);
+ }
+
+ @Override
+ public RegistrationPersistenceManager getManager() throws Exception
+ {
+ return persistenceManager;
+ }
+}
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java
===================================================================
---
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java 2011-05-18
13:49:07 UTC (rev 6482)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java 2011-05-18
13:51:58 UTC (rev 6483)
@@ -44,7 +44,7 @@
/** . */
private Map<QName, Object> registrationProperties;
- public abstract RegistrationPersistenceManager getManager();
+ public abstract RegistrationPersistenceManager getManager() throws Exception;
public void startInteraction()
{
@@ -80,7 +80,7 @@
stopInteraction();
}
- public void testCreateConsumer() throws RegistrationException
+ public void testCreateConsumer() throws Exception
{
startInteraction();
Consumer consumer = getManager().createConsumer("Bar", "Bar");
@@ -95,7 +95,7 @@
stopInteraction();
}
- public void testCreateGroup() throws RegistrationException
+ public void testCreateGroup() throws Exception
{
startInteraction();
ConsumerGroup group = getManager().createConsumerGroup("Foo");