Author: trygvis Date: Mon May 2 04:49:52 2005 New Revision: 165619 URL: http://svn.apache.org/viewcvs?rev=165619&view=rev Log: o Reorganizing the continuum module so it corresponds to the ContinuumXmlRpc interface. o Updating the continuum module with WRT the ContinuumXmlRpc interface: - Removing the addProjectFromScm/Url methods. - Adding addXXXProject(). o Updated the IT to use the new addXXXProject() methods.
Modified: maven/continuum/trunk/continuum-core-it/continuum.py maven/continuum/trunk/continuum-core-it/continuum_cli.py maven/continuum/trunk/continuum-core-it/it.py Modified: maven/continuum/trunk/continuum-core-it/continuum.py URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/continuum.py?rev=165619&r1=165618&r2=165619&view=diff ============================================================================== --- maven/continuum/trunk/continuum-core-it/continuum.py (original) +++ maven/continuum/trunk/continuum-core-it/continuum.py Mon May 2 04:49:52 2005 @@ -48,23 +48,13 @@ else: return "UNKNOWN STATE (" + state + ")." - -# Maven 2.x project - -def addMavenTwoProject( url ): - result = checkResult( server.continuum.addMavenTwoProject( url ) ) - - return result[ "projectId" ] - -def addProjectFromUrl( url, builderId ): - result = checkResult( server.continuum.addProjectFromUrl( url, builderId ) ) - - return result[ "projectId" ] - -def addProjectFromScm( scmUrl, builderId, name, nagEmailAddress, version, configuration ): - result = checkResult( server.continuum.addProjectFromScm( scmUrl, builderId, name, nagEmailAddress, version, configuration ) ) - - return result[ "projectId" ] +#################################################################### +# These methods correspods 1<=>1 with the ContinuumXmlRpc interface +#################################################################### + +#################################################################### +# Project handling +#################################################################### def getProject( projectId ): result = checkResult( server.continuum.getProject( projectId ) ) @@ -85,6 +75,10 @@ def removeProject( projectId ): checkResult( server.continuum.removeProject( projectId ) ) +#################################################################### +# Build handling +#################################################################### + def buildProject( projectId ): result = checkResult( server.continuum.buildProject( projectId ) ) @@ -113,6 +107,42 @@ return None return BuildResult( buildResult ) + +#################################################################### +# Maven 2.x project +#################################################################### + +def addMavenTwoProject( url ): + result = checkResult( server.continuum.addMavenTwoProject( url ) ) + + return result[ "projectId" ] + +#################################################################### +# Maven 1.x project +#################################################################### + +def addMavenOneProject( url ): + result = checkResult( server.continuum.addMavenOneProject( url ) ) + + return result[ "projectId" ] + +#################################################################### +# Ant project +#################################################################### + +def addAntProject( scmUrl, projectName, nagEmailAddress, version, configuration ): + result = checkResult( server.continuum.addAntProject( scmUrl, projectName, nagEmailAddress, version, configuration ) ) + + return result[ "projectId" ] + +#################################################################### +# Shell project +#################################################################### + +def addShellProject( scmUrl, projectName, nagEmailAddress, version, configuration ): + result = checkResult( server.continuum.addShellProject( scmUrl, projectName, nagEmailAddress, version, configuration ) ) + + return result[ "projectId" ] class Project: def __init__( self, map ): Modified: maven/continuum/trunk/continuum-core-it/continuum_cli.py URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/continuum_cli.py?rev=165619&r1=165618&r2=165619&view=diff ============================================================================== --- maven/continuum/trunk/continuum-core-it/continuum_cli.py (original) +++ maven/continuum/trunk/continuum-core-it/continuum_cli.py Mon May 2 04:49:52 2005 @@ -38,13 +38,22 @@ print "Version 1.0" - def do_addProject(self, args): - """Add a Continuum project. - Use this command to add a project to Continuum.""" + def do_addMavenTwoProject(self, args): + """Add a Maven 2.x project.""" - projectId = continuum.addProjectFromUrl( args[0], args[1] ) + projectId = continuum.addMavenTwoProject( args[0] ) print "Added project, id: " + projectId + + def do_addMavenOneProject(self, args): + """Add a Maven 1.x project.""" + + projectId = continuum.addMavenOneProject( args[0] ) + + print "Added project, id: " + projectId + + # TODO: addAntProject + # TODO: addShellProject def do_showProject(self, args): """Shows Continuum project. Modified: maven/continuum/trunk/continuum-core-it/it.py URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/it.py?rev=165619&r1=165618&r2=165619&view=diff ============================================================================== --- maven/continuum/trunk/continuum-core-it/it.py (original) +++ maven/continuum/trunk/continuum-core-it/it.py Mon May 2 04:49:52 2005 @@ -305,7 +305,7 @@ print "" print "NOTE:" print "When running these integration tests you will get some" -print "stacktraces related." +print "stacktraces. This is normal and expected." print "############################################################" print "" @@ -335,7 +335,7 @@ progress( "Initializing Maven 1 CVS project" ) initMaven1Project( maven1Project, "cvs", cvsroot, "maven-1" ) progress( "Adding Maven 1 project" ) - maven1Id = continuum.addProjectFromUrl( "file:" + maven1Project + "/project.xml", "maven-1" ) + maven1Id = continuum.addMavenOneProject( "file:" + maven1Project + "/project.xml" ) maven1 = continuum.getProject( maven1Id ) assertProject( maven1Id, "Maven 1 Project", email, continuum.STATE_NEW, "1.0", "maven-1", maven1 ) assertCheckedOutFiles( maven1, [ "/project.xml", "/src/main/java/Foo.java" ] ) @@ -371,7 +371,7 @@ progress( "Initializing Maven 2 CVS project" ) initMaven2Project( maven2Project, cvsroot, "maven-2" ) progress( "Adding Maven 2 project" ) - maven2Id = continuum.addProjectFromUrl( "file:" + maven2Project + "/pom.xml", "maven2" ) + maven2Id = continuum.addMavenTwoProject( "file:" + maven2Project + "/pom.xml" ) maven2 = continuum.getProject( maven2Id ) assertProject( maven2Id, "Maven 2 Project", email, continuum.STATE_NEW, "2.0-SNAPSHOT", "maven2", maven2 ) @@ -391,11 +391,11 @@ svnImport( antProject, svnroot, "ant-svn" ) progress( "Adding Ant SVN project" ) - antSvnId = continuum.addProjectFromScm( "scm:svn:file://" + svnroot + "/ant-svn", "ant", "Ant SVN Project", email, "3.0", - { - "executable": "ant", - "targets" : "clean, build" - } ) + antSvnId = continuum.addAntProject( "scm:svn:file://" + svnroot + "/ant-svn", "Ant SVN Project", email, "3.0", + { + "executable": "ant", + "targets" : "clean, build" + } ) antSvn = continuum.getProject( antSvnId ) assertProject( antSvnId, "Ant SVN Project", email, continuum.STATE_NEW, "3.0", "ant", antSvn ) progress( "Building SVN Ant project" ) @@ -408,8 +408,8 @@ progress( "Initializing Ant CVS project" ) initAntProject( antProject ) cvsImport( antProject, cvsroot, "ant-cvs" ) - antCvsId = continuum.addProjectFromScm( "scm:cvs:local:" + basedir + "/cvsroot:ant-cvs", "ant", "Ant CVS Project", email, "3.0", - { "executable": "ant", "targets" : "clean, build"} ) + antCvsId = continuum.addAntProject( "scm:cvs:local:" + basedir + "/cvsroot:ant-cvs", "Ant CVS Project", email, "3.0", + { "executable": "ant", "targets" : "clean, build"} ) antCvs = continuum.getProject( antCvsId ) assertProject( antCvsId, "Ant CVS Project", email, continuum.STATE_NEW, "3.0", "ant", antCvs ) progress( "Building CVS Ant project" ) @@ -423,8 +423,8 @@ cvsImport( shellProject, cvsroot, "shell" ) progress( "Adding CVS Shell project" ) - shellId = continuum.addProjectFromScm( "scm:cvs:local:" + basedir + "/cvsroot:shell", "shell", "Shell Project", email, "3.0", - { "executable": "script.sh", "arguments" : ""} ) + shellId = continuum.addShellProject( "scm:cvs:local:" + basedir + "/cvsroot:shell", "Shell Project", email, "3.0", + { "executable": "script.sh", "arguments" : ""} ) shell = continuum.getProject( shellId ) assertProject( shellId, "Shell Project", email, continuum.STATE_NEW, "3.0", "shell", shell )