public static final String EOL = System.getProperty( "line.separator" );
public void testBasic()
throws Exception
{
Continuum continuum = getContinuum();
initializeCvsRoot();
progress( "Initializing Shell CVS project" );
File root = getItFile( "shell" );
initShellProject( root );
cvsImport( root, "shell", getCvsRoot() );
progress( "Adding CVS Shell project" );
Project p = new Project();
p.setScmUrl( "scm|cvs|local|" + getCvsRoot() + "|shell" );
p.setName( "Shell Project" );
// p.getNotifiers().add( makeMailNotifier( email ) );
p.setVersion( "3.0" );
BuildDefinition bd = new BuildDefinition();
bd.setArguments( "" );
bd.setBuildFile( getScriptName() );
bd.setDefaultForProject( true );
p.addBuildDefinition( bd );
int projectId = continuum.addProject( p, ShellBuildExecutor.ID );
waitForSuccessfulCheckout( projectId );
Project project = continuum.getProject( projectId );
assertProject( projectId, "Shell Project", "3.0", "", "shell", project );
progress( "Building Shell project" );
int buildId = buildProject( projectId, ContinuumProjectState.TRIGGER_SCHEDULED ).getId();
assertSuccessfulShellBuild( buildId, projectId, "" );
// Test project reconfiguration
// Test that a project will be built after a changed file is committed
progress( "Building Shell project with alternative configuration" );
File coDir = getTempCoDir();
cvsCheckout( getCvsRoot(), "shell", coDir );
addExtraPartInScript( root, coDir );
cvsCommit( coDir );
Project shellProject = continuum.getProjectWithAllDetails( projectId );
bd = (BuildDefinition) shellProject.getBuildDefinitions().iterator().next();
bd.setArguments( "a b" );
continuum.updateBuildDefinition( bd, shellProject.getId() );
// TODO: change all details to build details
shellProject = continuum.getProjectWithAllDetails( projectId );
// TODO: better way?
bd = (BuildDefinition) shellProject.getBuildDefinitions().iterator().next();
assertEquals( "Updated command line arguments doesn't match", "a b", bd.getArguments() );
buildId = buildProject( projectId, ContinuumProjectState.TRIGGER_SCHEDULED ).getId();