Author: chris.laprun(a)jboss.com
Date: 2011-10-17 14:09:59 -0400 (Mon, 17 Oct 2011)
New Revision: 7753
Modified:
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java
Log:
- Added test to check getRegistration but running into detached vs. attached problem...
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-10-17
17:38:18 UTC (rev 7752)
+++
components/wsrp/trunk/producer/src/test/java/org/gatein/registration/AbstractRegistrationPersistenceManagerTestCase.java 2011-10-17
18:09:59 UTC (rev 7753)
@@ -328,6 +328,12 @@
String regId = reg1.getPersistentKey();
assertNotNull(regId);
assertEquals(consumer, reg1.getConsumer());
+
+ // contrary to intuition, consumer should not know about reg1 if there is a
persistence layer
+ // but if we retrieve it from persistence, it should now know it
+ consumer = getManager().getConsumerById("Bar");
+ assertEquals(reg1, consumer.getRegistration(regId));
+
Map expectedProps = new HashMap();
expectedProps.put(new QName("prop1"), "value1");
expectedProps.put(new QName("prop2"), "value2");
@@ -339,6 +345,7 @@
assertNotNull(registrations);
assertEquals(1, registrations.size());
Registration reg3 = (Registration)registrations.iterator().next();
+ assertEquals(reg1, reg3);
assertEquals(regId, reg3.getPersistentKey());
assertEquals(consumer, reg3.getConsumer());
assertEquals(expectedProps, reg3.getProperties());
Show replies by date