Return-Path: Delivered-To: apmail-maven-continuum-commits-archive@www.apache.org Received: (qmail 75289 invoked from network); 19 Jan 2007 09:31:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jan 2007 09:31:31 -0000 Received: (qmail 49450 invoked by uid 500); 19 Jan 2007 09:31:38 -0000 Delivered-To: apmail-maven-continuum-commits-archive@maven.apache.org Received: (qmail 49418 invoked by uid 500); 19 Jan 2007 09:31:37 -0000 Mailing-List: contact continuum-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: continuum-dev@maven.apache.org Delivered-To: mailing list continuum-commits@maven.apache.org Received: (qmail 49405 invoked by uid 99); 19 Jan 2007 09:31:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jan 2007 01:31:37 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jan 2007 01:31:30 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 0E8AE1A981D; Fri, 19 Jan 2007 01:30:26 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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 Date: Fri, 19 Jan 2007 09:30:25 -0000 To: continuum-commits@maven.apache.org From: rinku@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070119093026.0E8AE1A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 ) {