continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ri...@apache.org
Subject svn commit: r491355 - in /maven/continuum/branches/key-based-refactor/continuum-store/src: main/java/org/apache/maven/continuum/store/jdo/ test/java/org/apache/maven/continuum/store/ test/java/org/apache/maven/continuum/store/jdo/ test/java/org/apache/...
Date Sun, 31 Dec 2006 00:39:11 GMT
Author: rinku
Date: Sat Dec 30 16:39:10 2006
New Revision: 491355

URL: http://svn.apache.org/viewvc?view=rev&rev=491355
Log: (empty)

Modified:
    maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupStore.java
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/AbstractJdoStoreTestCase.java
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupTestCase.java
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/utils/StoreTestUtils.java
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupStore.java?view=diff&rev=491355&r1=491354&r2=491355
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupStore.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupStore.java
Sat Dec 30 16:39:10 2006
@@ -22,6 +22,8 @@
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.store.ProjectGroupStore;
 
+import javax.jdo.Transaction;
+
 import java.util.List;
 
 /**
@@ -65,7 +67,34 @@
      */
     public ProjectGroup saveProjectGroup( ProjectGroup group ) throws ContinuumStoreException
     {
-        updateObject( group );
+        if ( false )
+        {
+            Transaction tx = getPersistenceManager().currentTransaction();
+            try
+            {
+                tx.begin();
+
+                getPersistenceManager().makePersistent( group );
+
+                tx.commit();
+            }
+            catch ( Exception e )
+            {
+                // Handle the exception
+            }
+            finally
+            {
+                if ( tx.isActive() )
+                {
+                    tx.rollback();
+                }
+            }
+        }
+        else
+        {
+            updateObject( group );
+        }
+
         return group;
     }
 

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java?view=diff&rev=491355&r1=491354&r2=491355
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
Sat Dec 30 16:39:10 2006
@@ -1074,15 +1074,7 @@
         return dependency;
     }
 
-    /**
-     * @deprecated Use {@link #createTestDeveloper(long,String,String,String)} instead
-     */
     protected static ProjectDeveloper createTestDeveloper( int continuumId, String email,
String name, String scmId )
-    {
-        return createTestDeveloper( (long) continuumId, email, name, scmId );
-    }
-
-    protected static ProjectDeveloper createTestDeveloper( long continuumId, String email,
String name, String scmId )
     {
         ProjectDeveloper developer = new ProjectDeveloper();
         developer.setContinuumId( continuumId );

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/AbstractJdoStoreTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/AbstractJdoStoreTestCase.java?view=diff&rev=491355&r1=491354&r2=491355
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/AbstractJdoStoreTestCase.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/AbstractJdoStoreTestCase.java
Sat Dec 30 16:39:10 2006
@@ -71,7 +71,7 @@
     /**
      * JDBC URL to connect to the target test database instance.
      */
-    private final String URL_TEST_DATABASE = "jdbc:hsqldb:mem:" + getName() + new Date().getTime();
+    private final String URL_TEST_DATABASE = "jdbc:hsqldb:mem:" + getName();
 
     /**
      * DDL for Database creation.
@@ -151,6 +151,7 @@
         System.setProperty( SchemaTool.JDO_DATASTORE_URL_PROPERTY, URL_TEST_DATABASE );
         System.setProperty( SchemaTool.JDO_DATASTORE_USERNAME_PROPERTY, USERNAME_TEST_DATABASE
);
         System.setProperty( SchemaTool.JDO_DATASTORE_PASSWORD_PROPERTY, PASSWORD_TEST_DATABASE
);
+        //SchemaTool.deleteSchemaTables( jdoFiles, null, null, false ); // for version 1.1.3
         SchemaTool.deleteSchemaTables( jdoFiles, null, false );
     }
 

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupTestCase.java?view=diff&rev=491355&r1=491354&r2=491355
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupTestCase.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectGroupTestCase.java
Sat Dec 30 16:39:10 2006
@@ -80,20 +80,25 @@
     public void testSaveNewProjectGroup() throws Exception
     {
         ProjectGroupStore store = (ProjectGroupStore) lookup( ProjectGroupStore.ROLE, "jdo"
);
-        ProjectGroup group =
-            StoreTestUtils.createTestProjectGroup( "New Group", "A new project group", "newGroupId",
"newGroupKey" );
+        String name = "testAddProjectGroup";
+        String description = "testAddProjectGroup description";
+        String groupId = "org.apache.maven.continuum.test";
+        String groupKey = "AddProjectGroupKey";
+        ProjectGroup group = StoreTestUtils.createTestProjectGroup( name, description, groupId,
groupKey );
 
         ProjectGroup copy = StoreTestUtils.createTestProjectGroup( group );
         assertNotNull( copy );
-
-        group = store.saveProjectGroup( group );
+        
+        
+        group = store.saveProjectGroup( group );        
         assertNotNull( group );
-
+        /*
         copy.setId( group.getId() );
 
         ProjectGroup retrievedGroup = store.lookupProjectGroup( new GroupProjectKey( group.getKey(),
null ) );
         assertNotNull( retrievedGroup );
         StoreTestUtils.assertProjectGroupEquals( copy, retrievedGroup );
+        */
     }
 
 }

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/utils/StoreTestUtils.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/utils/StoreTestUtils.java?view=diff&rev=491355&r1=491354&r2=491355
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/utils/StoreTestUtils.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/utils/StoreTestUtils.java
Sat Dec 30 16:39:10 2006
@@ -328,7 +328,7 @@
         return dependency;
     }
 
-    public static ProjectDeveloper createTestDeveloper( long continuumId, String email, String
name, String scmId )
+    public static ProjectDeveloper createTestDeveloper( int continuumId, String email, String
name, String scmId )
     {
         ProjectDeveloper developer = new ProjectDeveloper();
         developer.setContinuumId( continuumId );

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql?view=diff&rev=491355&r1=491354&r2=491355
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/testData.sql
Sat Dec 30 16:39:10 2006
@@ -29,4 +29,4 @@
     PROJECTKEY, NAME, BUILD_NUMBER, LATEST_BUILD_ID, OLD_STATE, 
     PROJECT_GROUP_ID_OID, "STATE")
   values (999, 'Deleteable Project', 'deleteable-project', 'org.test.projects', 'DeleteableGroup',
-    'deleteableProject', 'Deleteable Project', 0, 0, 0, 999, 0);  
+    'deleteableProject', 'Deleteable Project', 0, 0, 0, 2, 0);  



Mime
View raw message