You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ri...@apache.org on 2007/01/19 10:30:25 UTC
svn commit: r497752 - in
/maven/continuum/branches/id-refactor/continuum-store/src:
main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
Author: rinku
Date: Fri Jan 19 01:30:25 2007
New Revision: 497752
URL: http://svn.apache.org/viewvc?view=rev&rev=497752
Log:
o ID (long) related updates to Store interface, impl and tests.
Modified:
maven/continuum/branches/id-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
maven/continuum/branches/id-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
Modified: maven/continuum/branches/id-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/id-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?view=diff&rev=497752&r1=497751&r2=497752
==============================================================================
--- maven/continuum/branches/id-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java (original)
+++ maven/continuum/branches/id-refactor/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java Fri Jan 19 01:30:25 2007
@@ -235,7 +235,7 @@
for ( Iterator j = projectsInGroup.iterator(); j.hasNext(); )
{
- Integer projectId = new Integer( ( (Project) j.next() ).getId() );
+ Long projectId = new Long( ( (Project) j.next() ).getId() );
if ( !aggregate.keySet().contains( projectId ) )
{
aggregate.put( projectId, projectGroupSource.get( projectGroupId ) );
@@ -427,7 +427,7 @@
pm.getFetchPlan().addGroup( PROJECT_WITH_BUILDS_FETCH_GROUP );
- Object objectId = pm.newObjectIdInstance( Project.class, new Integer( project.getId() ) );
+ Object objectId = pm.newObjectIdInstance( Project.class, new Long( project.getId() ) );
project = (Project) pm.getObjectById( objectId );
@@ -514,7 +514,7 @@
{
BuildResult br = (BuildResult) i.next();
- builds.put( new Integer( br.getProject().getId() ), br );
+ builds.put( new Long( br.getProject().getId() ), br );
}
return builds;
@@ -601,7 +601,7 @@
}
- public BuildDefinition getDefaultBuildDefinitionForProjectGroup( int projectGroupId )
+ public BuildDefinition getDefaultBuildDefinitionForProjectGroup( long projectGroupId )
throws ContinuumStoreException, ContinuumObjectNotFoundException
{
ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );
@@ -725,19 +725,19 @@
PlexusJdoUtils.rollbackIfActive( tx );
}
- public ProjectGroup getProjectGroup( int projectGroupId )
+ public ProjectGroup getProjectGroup( long projectGroupId )
throws ContinuumStoreException, ContinuumObjectNotFoundException
{
- return (ProjectGroup) getObjectById( ProjectGroup.class, projectGroupId );
+ return (ProjectGroup) getObjectById( ProjectGroup.class, projectGroupId , null);
}
- private Object getObjectById( Class clazz, int id )
+ private Object getObjectById( Class clazz, long id )
throws ContinuumStoreException, ContinuumObjectNotFoundException
{
return getObjectById( clazz, id, null );
}
- private Object getObjectById( Class clazz, int id, String fetchGroup )
+ private Object getObjectById( Class clazz, long id, String fetchGroup )
throws ContinuumStoreException, ContinuumObjectNotFoundException
{
try
@@ -904,7 +904,7 @@
return getAllObjectsDetached( Installation.class, "name ascending, version ascending", null );
}
- public List getAllBuildsForAProjectByDate( int projectId )
+ public List getAllBuildsForAProjectByDate( long projectId )
{
PersistenceManager pm = getPersistenceManager();
@@ -921,7 +921,7 @@
query.declareParameters( "Integer projectId" );
- List result = (List) query.execute( new Integer( projectId ) );
+ List result = (List) query.execute( new Long( projectId ) );
result = (List) pm.detachCopyAll( result );
@@ -935,10 +935,10 @@
}
}
- public Project getProject( int projectId )
+ public Project getProject( long projectId )
throws ContinuumStoreException, ContinuumObjectNotFoundException
{
- return (Project) getObjectById( Project.class, projectId );
+ return (Project) getObjectById( Project.class, projectId, null );
}
public void updateProject( Project project )
@@ -959,7 +959,7 @@
updateObject( schedule );
}
- public Project getProjectWithBuilds( int projectId )
+ public Project getProjectWithBuilds( long projectId )
throws ContinuumStoreException, ContinuumObjectNotFoundException
{
return (Project) getObjectById( Project.class, projectId, PROJECT_WITH_BUILDS_FETCH_GROUP );
@@ -975,13 +975,13 @@
removeObject( schedule );
}
- public Project getProjectWithCheckoutResult( int projectId )
+ public Project getProjectWithCheckoutResult( long projectId )
throws ContinuumObjectNotFoundException, ContinuumStoreException
{
return (Project) getObjectById( Project.class, projectId, PROJECT_WITH_CHECKOUT_RESULT_FETCH_GROUP );
}
- public BuildResult getBuildResult( int buildId )
+ public BuildResult getBuildResult( long buildId )
throws ContinuumObjectNotFoundException, ContinuumStoreException
{
return (BuildResult) getObjectById( BuildResult.class, buildId, BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
@@ -1104,7 +1104,7 @@
{
BuildResult br = (BuildResult) i.next();
- builds.put( new Integer( br.getProject().getId() ), br );
+ builds.put( new Long( br.getProject().getId() ), br );
}
return builds;
@@ -1179,13 +1179,13 @@
}
}
- public ProjectGroup getProjectGroupWithProjects( int projectGroupId )
+ public ProjectGroup getProjectGroupWithProjects( long projectGroupId )
throws ContinuumObjectNotFoundException, ContinuumStoreException
{
return (ProjectGroup) getObjectById( ProjectGroup.class, projectGroupId, PROJECTGROUP_PROJECTS_FETCH_GROUP );
}
- public ProjectGroup getProjectGroupWithBuildDetails( int projectGroupId )
+ public ProjectGroup getProjectGroupWithBuildDetails( long projectGroupId )
throws ContinuumObjectNotFoundException, ContinuumStoreException
{
return (ProjectGroup) getObjectById( ProjectGroup.class, projectGroupId, PROJECT_BUILD_DETAILS_FETCH_GROUP );
@@ -1201,19 +1201,19 @@
return getAllObjectsDetached( Project.class, "name ascending", PROJECT_ALL_DETAILS_FETCH_GROUP );
}
- public Project getProjectWithAllDetails( int projectId )
+ public Project getProjectWithAllDetails( long projectId )
throws ContinuumObjectNotFoundException, ContinuumStoreException
{
return (Project) getObjectById( Project.class, projectId, PROJECT_ALL_DETAILS_FETCH_GROUP );
}
- public Schedule getSchedule( int scheduleId )
+ public Schedule getSchedule( long scheduleId )
throws ContinuumObjectNotFoundException, ContinuumStoreException
{
return (Schedule) getObjectById( Schedule.class, scheduleId );
}
- public Profile getProfile( int profileId )
+ public Profile getProfile( long profileId )
throws ContinuumObjectNotFoundException, ContinuumStoreException
{
return (Profile) getObjectById( Profile.class, profileId );
Modified: maven/continuum/branches/id-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/id-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java?view=diff&rev=497752&r1=497751&r2=497752
==============================================================================
--- maven/continuum/branches/id-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java (original)
+++ maven/continuum/branches/id-refactor/continuum-store/src/test/java/org/apache/maven/continuum/store/AbstractContinuumStoreTestCase.java Fri Jan 19 01:30:25 2007
@@ -727,7 +727,7 @@
}
private static BuildResult createTestBuildResult( int trigger, boolean success, int state, int exitCode,
- String error, int buildNumber, long startTime, long endTime )
+ String error, long buildNumber, long startTime, long endTime )
{
BuildResult result = new BuildResult();
result.setBuildNumber( buildNumber );
@@ -761,7 +761,7 @@
schedule.getCronExpression(), schedule.isActive() );
}
- protected static Schedule createTestSchedule( String name, String description, int delay, String cronExpression,
+ protected static Schedule createTestSchedule( String name, String description, long delay, String cronExpression,
boolean active )
{
Schedule schedule = new Schedule();
@@ -818,7 +818,7 @@
project.getUrl(), project.getVersion(), project.getWorkingDirectory() );
}
- private static Project createTestProject( String artifactId, int buildNumber, String description, String groupId,
+ private static Project createTestProject( String artifactId, long buildNumber, String description, String groupId,
String name, String scmUrl, int state, String url, String version,
String workingDirectory )
{