weaver 2004/10/29 07:06:21 Modified: components/registry/src/test/org/apache/jetspeed/components/portletregistry/direct TestRegistryDirectPart1b.java TestRegistryDirectPart2a.java TestRegistryDirectPart1a.java Log: see: http://nagoya.apache.org/jira/browse/JS2-144 - refactor of registry and entity DAO Revision Changes Path 1.2 +4 -26 jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1b.java Index: TestRegistryDirectPart1b.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1b.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestRegistryDirectPart1b.java 12 Oct 2004 20:05:50 -0000 1.1 +++ TestRegistryDirectPart1b.java 29 Oct 2004 14:06:20 -0000 1.2 @@ -18,8 +18,6 @@ import junit.framework.Test; import junit.framework.TestSuite; -import org.apache.jetspeed.components.persistence.store.Filter; -import org.apache.jetspeed.components.persistence.store.Transaction; import org.apache.jetspeed.components.portletregistry.AbstractRegistryTest; import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl; @@ -33,14 +31,6 @@ */ public class TestRegistryDirectPart1b extends AbstractRegistryTest { - /** - * - */ - public TestRegistryDirectPart1b() - { - super(); - // TODO Auto-generated constructor stub - } /* * (non-Javadoc) * @@ -61,14 +51,6 @@ // super.tearDown(); } - /** - * @param testName - */ - public TestRegistryDirectPart1b(String testName) - { - super(testName); - } - public static Test suite() { // All methods starting with "test" will be executed in the test suite. @@ -77,18 +59,14 @@ public void testUpdates() throws Exception { - Transaction tx = persistenceStore.getTransaction(); - tx.begin(); - Filter filter = persistenceStore.newFilter(); + PortletApplicationDefinitionImpl app = (PortletApplicationDefinitionImpl) registry.getPortletApplication("App_1"); assertNotNull("PA App_1 is NULL", app); app.addUserAttribute("user.pets.doggie", "Busby"); - registry.getPersistenceStore().lockForWrite(app); - - tx.commit(); - + registry.updatePortletApplication(app); + System.out.println("PA update test complete"); } 1.2 +3 -19 jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart2a.java Index: TestRegistryDirectPart2a.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart2a.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestRegistryDirectPart2a.java 12 Oct 2004 20:05:50 -0000 1.1 +++ TestRegistryDirectPart2a.java 29 Oct 2004 14:06:20 -0000 1.2 @@ -38,14 +38,6 @@ public class TestRegistryDirectPart2a extends AbstractRegistryTest { - /** - * - */ - public TestRegistryDirectPart2a() - { - super(); - // TODO Auto-generated constructor stub - } /* * (non-Javadoc) * @@ -73,7 +65,7 @@ protected void tearDown() throws Exception { - persistenceStore.getTransaction().begin(); + Iterator itr = registry.getPortletApplications().iterator(); while(itr.hasNext()) @@ -81,7 +73,7 @@ registry.removeApplication((PortletApplicationDefinition)itr.next()); } - persistenceStore.getTransaction().commit(); + super.tearDown(); } @@ -92,14 +84,6 @@ return new TestSuite(TestRegistryDirectPart2a.class); } - /** - * @param testName - */ - public TestRegistryDirectPart2a(String testName) - { - super(testName); - } - public void testData() throws Exception { verifyData(true); 1.2 +4 -20 jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1a.java Index: TestRegistryDirectPart1a.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/test/org/apache/jetspeed/components/portletregistry/direct/TestRegistryDirectPart1a.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestRegistryDirectPart1a.java 12 Oct 2004 20:05:50 -0000 1.1 +++ TestRegistryDirectPart1a.java 29 Oct 2004 14:06:20 -0000 1.2 @@ -57,15 +57,6 @@ public class TestRegistryDirectPart1a extends AbstractRegistryTest { - /** - * - */ - public TestRegistryDirectPart1a() - { - super(); - // TODO Auto-generated constructor stub - } - /* * (non-Javadoc) * @@ -99,13 +90,7 @@ // super.tearDown(); } - /** - * @param testName - */ - public TestRegistryDirectPart1a( String testName ) - { - super(testName); - } + /** * <p> @@ -119,7 +104,7 @@ { // Create an Application and a Web app - persistenceStore.getTransaction().begin(); + PortletApplicationDefinitionImpl app = new PortletApplicationDefinitionImpl(); app.setName("App_1"); app.setApplicationIdentifier("App_1"); @@ -177,8 +162,7 @@ portlet.addContentType(wml); app.setWebApplicationDefinition(webApp); - persistenceStore.makePersistent(app); - persistenceStore.getTransaction().commit(); + registry.registerPortletApplication(app); } private void addDublinCore( GenericMetadata metadata )
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]