continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ri...@apache.org
Subject svn commit: r493273 - 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/jdo/ test/resources/ test/resources/db/
Date Sat, 06 Jan 2007 02:29:51 GMT
Author: rinku
Date: Fri Jan  5 18:29:50 2007
New Revision: 493273

URL: http://svn.apache.org/viewvc?view=rev&rev=493273
Log:
o  yesss! now we cooking :-)
o  updated test data and fixed unit tests.

Modified:
    maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectStore.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/jdo/JdoProjectStoreTestCase.java
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/schema.sql
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/testData.sql
    maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/log4j.xml

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectStore.java?view=diff&rev=493273&r1=493272&r2=493273
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectStore.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/jdo/JdoProjectStore.java
Fri Jan  5 18:29:50 2007
@@ -17,7 +17,6 @@
  */
 
 import org.apache.maven.continuum.key.GroupProjectKey;
-import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
 import org.apache.maven.continuum.store.ContinuumStoreException;
@@ -73,13 +72,14 @@
         {
             tx.begin();
 
-            Extent extent = pm.getExtent( BuildResult.class, true );
+            Extent extent = pm.getExtent( Project.class, true );
 
             Query query = pm.newQuery( extent );
 
             query.declareParameters( "String groupKey, String projectKey" );
 
-            query.setFilter( "this.project.groupKey == groupKey && this.project.key
== projectKey" );
+            // XXX: Why do we have a 'groupKey' column set up in Project table?
+            query.setFilter( "this.projectGroup.key == groupKey && this.key == projectKey"
);
 
             List result = (List) query.execute( key.getGroupKey(), key.getProjectKey() );
 

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=493273&r1=493272&r2=493273
==============================================================================
--- 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
Fri Jan  5 18:29:50 2007
@@ -49,8 +49,8 @@
         GroupProjectKey key = new GroupProjectKey( "Default", null );
         ProjectGroup group = store.lookupProjectGroup( key );
         assertNotNull( group );
-        assertEquals( 1L, group.getId() );
-        assertEquals( "Default Group", group.getDescription() );
+        assertEquals( 100L, group.getId() );
+        assertEquals( "Default Group Desc.", group.getDescription() );
         assertEquals( "default", group.getGroupId() );
         assertEquals( "Default", group.getKey() );
         assertEquals( "Default Group", group.getName() );
@@ -88,6 +88,7 @@
 
         group = store.saveProjectGroup( group );
         assertNotNull( group );
+        assertTrue( group.getId() > 0 );
     }
 
 }

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectStoreTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectStoreTestCase.java?view=diff&rev=493273&r1=493272&r2=493273
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectStoreTestCase.java
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/jdo/JdoProjectStoreTestCase.java
Fri Jan  5 18:29:50 2007
@@ -73,24 +73,24 @@
         assertNotNull( group );
 
         // verify group properties
-        assertEquals( 1L, group.getId() );
-        assertEquals( "Default Group", group.getDescription() );
+        assertEquals( 100L, group.getId() );
+        assertEquals( "Default Group Desc.", group.getDescription() );
         assertEquals( "default", group.getGroupId() );
         assertEquals( "Default", group.getKey() );
         assertEquals( "Default Group", group.getName() );
 
         // verify project properties
         assertEquals( 1L, project.getId() );
-        assertEquals( "Test Project 1", group.getDescription() );
-        assertEquals( "org.test.projects", group.getGroupId() );
-        assertEquals( "project1", group.getKey() );
-        assertEquals( "Project 1", group.getName() );
+        assertEquals( "Test Project 1", project.getDescription() );
+        assertEquals( "org.test.projects", project.getGroupId() );
+        assertEquals( "project1", project.getKey() );
+        assertEquals( "Project 1", project.getName() );
     }
 
     public void testDeleteProject() throws Exception
     {
         ProjectStore store = (ProjectStore) lookup( ProjectStore.ROLE, "jdo" );
-        GroupProjectKey key = new GroupProjectKey( "DeleteableGroup", "deleteableProject"
);
+        GroupProjectKey key = new GroupProjectKey( "Continuum", "deleteableProject" );
         Project project = store.lookupProject( key );
         assertNotNull( project );
 

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/schema.sql
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/schema.sql?view=diff&rev=493273&r1=493272&r2=493273
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/schema.sql
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/schema.sql
Fri Jan  5 18:29:50 2007
@@ -54,7 +54,7 @@
 
 CREATE TABLE CHANGESET
 (
-    CHANGESET_ID BIGINT NOT NULL,
+    CHANGESET_ID BIGINT NOT NULL ,
     AUTHOR VARCHAR(256) NULL,
     COMMENT VARCHAR(8192) NULL,
     "DATE" BIGINT NOT NULL,

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/testData.sql
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/testData.sql?view=diff&rev=493273&r1=493272&r2=493273
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/testData.sql
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/db/testData.sql
Fri Jan  5 18:29:50 2007
@@ -2,9 +2,9 @@
 
 # Set up Project Groups
 insert into PROJECTGROUP (ID, DESCRIPTION, GROUP_ID, GROUPKEY, NAME)
-  values (1, 'Default Group' , 'default', 'Default' , 'Default Group');
+  values (100, 'Default Group Desc.' , 'default', 'Default' , 'Default Group');
 insert into PROJECTGROUP (ID, DESCRIPTION, GROUP_ID, GROUPKEY, NAME)
-  values (2, 'Group 1' , 'org.apache.maven.continuum', 'Continuum' , 'Continuum Group');
+  values (200, 'Group 1' , 'org.apache.maven.continuum', 'Continuum' , 'Continuum Group');
 insert into PROJECTGROUP (ID, DESCRIPTION, GROUP_ID, GROUPKEY, NAME)
   values (999, 'Deleteable Group' , 'org.group.deleteable', 'DeleteableGroup' , 'Deleteable
Group');  
   
@@ -14,19 +14,19 @@
     PROJECTKEY, NAME, BUILD_NUMBER, LATEST_BUILD_ID, OLD_STATE, 
     PROJECT_GROUP_ID_OID, "STATE")
   values (1, 'Test Project 1', 'project-1',  'org.test.projects', 'Default',
-    'project1', 'Project 1', 0, 0, 0, 1, 0);
+    'project1', 'Project 1', 0, 0, 0, 100, 0);
 insert into PROJECT (ID, DESCRIPTION, ARTIFACT_ID, GROUP_ID, GROUP_KEY, 
     PROJECTKEY, NAME, BUILD_NUMBER, LATEST_BUILD_ID, 
     OLD_STATE, PROJECT_GROUP_ID_OID, "STATE")
   values (2, 'Test Project 2', 'project-2',  'org.test.projects', 'Group 1',
-    'project2', 'Project 2', 0, 0, 0, 2, 0);
+    'project2', 'Project 2', 0, 0, 0, 200, 0);
 insert into PROJECT (ID, DESCRIPTION, ARTIFACT_ID, GROUP_ID, GROUP_KEY, 
     PROJECTKEY, NAME, BUILD_NUMBER, LATEST_BUILD_ID, OLD_STATE, 
     PROJECT_GROUP_ID_OID, "STATE")
   values (3, 'Test Project 3', 'project-3', 'org.test.projects', 'Group 1',
-    'project3', 'Project 3', 0, 0, 0, 2, 0);
+    'project3', 'Project 3', 0, 0, 0, 200, 0);
 insert into PROJECT (ID, DESCRIPTION, ARTIFACT_ID, GROUP_ID, GROUP_KEY, 
     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, 2, 0);  
+  values (999, 'Deleteable Project', 'deleteable-project', 'org.test.projects', 'Continuum',
+    'deleteableProject', 'Deleteable Project', 0, 0, 0, 200, 0);  

Modified: maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/log4j.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/log4j.xml?view=diff&rev=493273&r1=493272&r2=493273
==============================================================================
--- maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/log4j.xml
(original)
+++ maven/continuum/branches/key-based-refactor/continuum-store/src/test/resources/log4j.xml
Fri Jan  5 18:29:50 2007
@@ -18,6 +18,21 @@
     <appender-ref ref="default"/>
   </category>
 
+  <category name="JPOX.JDO.QUERY">
+    <priority value="DEBUG"/>
+    <appender-ref ref="default"/>
+  </category>
+  
+  <category name="JPOX.RDBMS.DDL">
+    <priority value="ERROR"/>
+    <appender-ref ref="default"/>
+  </category>
+  
+  <category name="JPOX.RDBMS.SQL">
+    <priority value="DEBUG"/>
+    <appender-ref ref="default"/>
+  </category>
+  
   <root>
     <priority value="INFO"/>
     <appender-ref ref="default"/>



Mime
View raw message