ProjectNotifier testNotifier1 = createTestNotifier( 11, true, true, false, "type11" );
ProjectNotifier testNotifier2 = createTestNotifier( 12, false, false, true, "type12" );
ProjectNotifier testNotifier3 = createTestNotifier( 13, false, true, false, "type13" );
ProjectDeveloper testDeveloper1 = createTestDeveloper( 1, "email1", "name1", "scmId1" );
ProjectDeveloper testDeveloper2 = createTestDeveloper( 2, "email2", "name2", "scmId2" );
ProjectDeveloper testDeveloper3 = createTestDeveloper( 3, "email3", "name3", "scmId3" );
ProjectDependency testDependency1 = createTestDependency( "groupId1", "artifactId1", "version1" );
ProjectDependency testDependency2 = createTestDependency( "groupId2", "artifactId2", "version2" );
ProjectDependency testDependency3 = createTestDependency( "groupId3", "artifactId3", "version3" );
// TODO: simplify by deep copying the relationships in createTest... ?
long baseTime = System.currentTimeMillis();
testBuildResult1 = createTestBuildResult( 1, true, 1, 1, "error1", 1, baseTime, baseTime + 1000 );
BuildResult buildResult1 = createTestBuildResult( testBuildResult1 );
ScmResult scmResult = createTestScmResult( "commandOutput1", "providerMessage1", true, "1" );
buildResult1.setScmResult( scmResult );
ScmResult testBuildResult1ScmResult = createTestScmResult( scmResult, "1" );
testBuildResult1.setScmResult( testBuildResult1ScmResult );
testCheckoutResult1 = createTestScmResult( "commandOutputCO1", "providerMessageCO1", false, "CO1" );
ScmResult checkoutResult1 = createTestScmResult( testCheckoutResult1, "CO1" );
testProject1.setCheckoutResult( checkoutResult1 );
testProject1.addBuildResult( buildResult1 );
testBuildResult2 = createTestBuildResult( 2, false, 2, 2, "error2", 2, baseTime + 2000, baseTime + 3000 );
BuildResult buildResult2 = createTestBuildResult( testBuildResult2 );
testProject1.addBuildResult( buildResult2 );
testBuildResult3 = createTestBuildResult( 3, true, 3, 3, "error3", 3, baseTime + 4000, baseTime + 5000 );
BuildResult buildResult3 = createTestBuildResult( testBuildResult3 );
scmResult = createTestScmResult( "commandOutput3", "providerMessage3", true, "3" );
buildResult3.setScmResult( scmResult );
testBuildResult3.setScmResult( createTestScmResult( scmResult, "3" ) );
testProject2.addBuildResult( buildResult3 );
// TODO: better way? this assumes that some untested methods already work!
Schedule schedule2 = createTestSchedule( testSchedule2 );
if ( addToStore )
{
schedule2 = scheduleDao.addSchedule( schedule2 );
testSchedule2.setId( schedule2.getId() );
}
else
{
// from expected.xml, continuum-data-management
testSchedule2.setId( 1 );
}
Schedule schedule1 = createTestSchedule( testSchedule1 );
if ( addToStore )
{
schedule1 = scheduleDao.addSchedule( schedule1 );
testSchedule1.setId( schedule1.getId() );
}
else
{
// from expected.xml, continuum-data-management
testSchedule1.setId( 2 );
}
Schedule schedule3 = createTestSchedule( testSchedule3 );
if ( addToStore )
{
schedule3 = scheduleDao.addSchedule( schedule3 );
testSchedule3.setId( schedule3.getId() );
}
else
{
// from expected.xml, continuum-data-management
testSchedule3.setId( 3 );
}
Installation installationJava14 = createTestInstallation( testInstallationJava14 );
if ( addToStore )
{
installationJava14 = installationDao.addInstallation( installationJava14 );
}
else
{
installationJava14.setInstallationId( 1 );
}
Installation installationMaven20a3 = createTestInstallation( testInstallationMaven20a3 );
if ( addToStore )
{
installationMaven20a3 = installationDao.addInstallation( installationMaven20a3 );
}
else
{
installationMaven20a3.setInstallationId( 2 );
}
Installation installationJava13 = createTestInstallation( testInstallationJava13 );
if ( addToStore )
{
installationJava13 = installationDao.addInstallation( installationJava13 );
}
else
{
installationJava13.setInstallationId( 3 );
}
testProfile1 =
createTestProfile( "name1", "description1", 1, true, true, installationJava13, installationMaven20a3 );
testProfile2 =
createTestProfile( "name2", "description2", 2, false, true, installationJava14, installationMaven20a3 );
testProfile3 =
createTestProfile( "name3", "description3", 3, true, false, installationJava14, installationMaven20a3 );
Profile profile1 = createTestProfile( testProfile1 );
if ( addToStore )
{
profile1 = profileDao.addProfile( profile1 );
testProfile1.setId( profile1.getId() );
}
else
{
testProfile1.setId( 1 );
}
Profile profile2 = createTestProfile( testProfile2 );
if ( addToStore )
{
profile2 = profileDao.addProfile( profile2 );
testProfile2.setId( profile2.getId() );
}
else
{
testProfile2.setId( 2 );
}
Profile profile3 = createTestProfile( testProfile3 );
if ( addToStore )
{
profile3 = profileDao.addProfile( profile3 );
testProfile3.setId( profile3.getId() );
}
else
{
profile3.setId( 3 );
}
testRepoPurgeConfiguration1 =
createTestRepositoryPurgeConfiguration( true, 5, 50, false, schedule2, true, localRepository1 );
if ( addToStore )
{
testRepoPurgeConfiguration1 =
repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( testRepoPurgeConfiguration1 );
}
else
{
testRepoPurgeConfiguration1.setId( 1 );
}
testRepoPurgeConfiguration2 =
createTestRepositoryPurgeConfiguration( false, 10, 200, true, schedule1, true, localRepository2 );
if ( addToStore )
{
testRepoPurgeConfiguration2 =
repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( testRepoPurgeConfiguration2 );
}
else
{
testRepoPurgeConfiguration2.setId( 2 );
}
testRepoPurgeConfiguration3 =
createTestRepositoryPurgeConfiguration( false, 10, 200, true, schedule2, true, localRepository1 );
if ( addToStore )
{
testRepoPurgeConfiguration3 =
repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( testRepoPurgeConfiguration3 );
}
else
{
testRepoPurgeConfiguration3.setId( 3 );
}
testDirectoryPurgeConfig =
createTestDirectoryPurgeConfiguration( "location1", "directoryType1", true, 10, 50, schedule2, true );
if ( addToStore )
{
testDirectoryPurgeConfig =
directoryPurgeConfigurationDao.addDirectoryPurgeConfiguration( testDirectoryPurgeConfig );
}
else
{
testDirectoryPurgeConfig.setId( 1 );
}
BuildDefinition testGroupBuildDefinition1 =
createTestBuildDefinition( "arguments1", "buildFile1", "goals1", profile1, schedule2, false, false );
BuildDefinition testGroupBuildDefinition2 =
createTestBuildDefinition( "arguments2", "buildFile2", "goals2", profile1, schedule1, false, false );
BuildDefinition testGroupBuildDefinition3 =
createTestBuildDefinition( "arguments3", "buildFile3", "goals3", profile2, schedule1, false, false );
BuildDefinition testGroupBuildDefinition4 =
createTestBuildDefinition( null, null, "deploy", null, null, false, false );
BuildDefinition testBuildDefinition1 =
createTestBuildDefinition( "arguments11", "buildFile11", "goals11", profile2, schedule1, false, false );
BuildDefinition testBuildDefinition2 =
createTestBuildDefinition( "arguments12", "buildFile12", "goals12", profile2, schedule2, false, false );
BuildDefinition testBuildDefinition3 =
createTestBuildDefinition( "arguments13", "buildFile13", "goals13", profile1, schedule2, false, false );
BuildDefinition testBuildDefinition4 =
createTestBuildDefinition( null, null, "deploy", null, null, false, false );
ProjectGroup group = createTestProjectGroup( defaultProjectGroup );
Project project1 = createTestProject( testProject1 );
project1.addBuildResult( buildResult1 );
project1.addBuildResult( buildResult2 );
project1.setCheckoutResult( checkoutResult1 );
ProjectNotifier notifier1 = createTestNotifier( testNotifier1 );
project1.addNotifier( notifier1 );
testProject1.addNotifier( testNotifier1 );
BuildDefinition buildDefinition1 = createTestBuildDefinition( testBuildDefinition1 );
project1.addBuildDefinition( buildDefinition1 );
testProject1.addBuildDefinition( testBuildDefinition1 );
BuildDefinition buildDefinition2 = createTestBuildDefinition( testBuildDefinition2 );
project1.addBuildDefinition( buildDefinition2 );
testProject1.addBuildDefinition( testBuildDefinition2 );
ProjectDeveloper projectDeveloper1 = createTestDeveloper( testDeveloper1 );
project1.addDeveloper( projectDeveloper1 );
testProject1.addDeveloper( testDeveloper1 );
ProjectDependency projectDependency1 = createTestDependency( testDependency1 );
project1.addDependency( projectDependency1 );
testProject1.addDependency( testDependency1 );
ProjectDependency projectDependency2 = createTestDependency( testDependency2 );
project1.addDependency( projectDependency2 );
testProject1.addDependency( testDependency2 );
group.addProject( project1 );
defaultProjectGroup.addProject( project1 );
Project project2 = createTestProject( testProject2 );
project2.addBuildResult( buildResult3 );
ProjectNotifier notifier2 = createTestNotifier( testNotifier2 );
project2.addNotifier( notifier2 );
testProject2.addNotifier( testNotifier2 );
ProjectNotifier notifier3 = createTestNotifier( testNotifier3 );
project2.addNotifier( notifier3 );
testProject2.addNotifier( testNotifier3 );
BuildDefinition buildDefinition3 = createTestBuildDefinition( testBuildDefinition3 );
project2.addBuildDefinition( buildDefinition3 );
testProject2.addBuildDefinition( testBuildDefinition3 );
BuildDefinition buildDefinition4 = createTestBuildDefinition( testBuildDefinition4 );
project2.addBuildDefinition( buildDefinition4 );
testProject2.addBuildDefinition( testBuildDefinition4 );
ProjectDeveloper projectDeveloper2 = createTestDeveloper( testDeveloper2 );
project2.addDeveloper( projectDeveloper2 );
testProject2.addDeveloper( testDeveloper2 );
ProjectDeveloper projectDeveloper3 = createTestDeveloper( testDeveloper3 );
project2.addDeveloper( projectDeveloper3 );
testProject2.addDeveloper( testDeveloper3 );
ProjectDependency projectDependency3 = createTestDependency( testDependency3 );
project2.addDependency( projectDependency3 );