goToRepositoriesPage();
getSelenium().open( "/archiva/admin/addRepository.action" );
addManagedRepository( "managedrepo1", "Managed Repository Sample 1", getRepositoryDir() + "repository/", "",
- "Maven 2.x Repository", "0 0 * * * ?", "", "" );
+ "Maven 2.x Repository", "0 0 * * * ?", "", "", true );
clickButtonWithValue( "Save" );
assertTextPresent( "Managed Repository Sample 1" );
assertRepositoriesPage();
}
- @Test(dependsOnMethods = { "testAddManagedRepoValidValues" } )
+ @Test( dependsOnMethods = { "testAddManagedRepoValidValues" } )
public void testAddManagedRepoInvalidValues()
{
goToRepositoriesPage();
- getSelenium().open( "/archiva/admin/addRepository.action" ); ;
- addManagedRepository( "<> \\/~+[ ]'\"", "<>\\~+[]'\"" , "<> ~+[ ]'\"" , "<> ~+[ ]'\"", "Maven 2.x Repository", "", "-1", "101" );
- assertTextPresent( "Identifier must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
- assertTextPresent( "Directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
- assertTextPresent( "Repository Name must only contain alphanumeric characters, white-spaces(' '), forward-slashes(/), open-parenthesis('('), close-parenthesis(')'), underscores(_), dots(.), and dashes(-)." );
- assertTextPresent( "Index directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
- assertTextPresent( "Repository Purge By Retention Count needs to be between 1 and 100.");
- assertTextPresent( "Repository Purge By Days Older Than needs to be larger than 0.");
+ getSelenium().open( "/archiva/admin/addRepository.action" );
+ ;
+ addManagedRepository( "<> \\/~+[ ]'\"", "<>\\~+[]'\"", "<> ~+[ ]'\"", "<> ~+[ ]'\"", "Maven 2.x Repository", "",
+ "-1", "101", false );
+ assertTextPresent(
+ "Identifier must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
+ assertTextPresent(
+ "Directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+ assertTextPresent(
+ "Repository Name must only contain alphanumeric characters, white-spaces(' '), forward-slashes(/), open-parenthesis('('), close-parenthesis(')'), underscores(_), dots(.), and dashes(-)." );
+ assertTextPresent(
+ "Index directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+ assertTextPresent( "Repository Purge By Retention Count needs to be between 1 and 100." );
+ assertTextPresent( "Repository Purge By Days Older Than needs to be larger than 0." );
+ assertTextPresent( "Invalid cron expression." );
+ }
+
+ @Test( dependsOnMethods = { "testAddManagedRepoInvalidValues" } )
+ public void testAddManagedRepoInvalidIdentifier()
+ {
+ addManagedRepository( "<> \\/~+[ ]'\"", "name", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1",
+ "1", false );
+ assertTextPresent(
+ "Identifier must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
+ }
+
+ @Test( dependsOnMethods = { "testAddManagedRepoInvalidIdentifier" } )
+ public void testAddManagedRepoInvalidRepoName()
+ {
+ addManagedRepository( "identifier", "<>\\~+[]'\"", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?",
+ "1", "1", false );
+ assertTextPresent(
+ "Repository Name must only contain alphanumeric characters, white-spaces(' '), forward-slashes(/), open-parenthesis('('), close-parenthesis(')'), underscores(_), dots(.), and dashes(-)." );
+ }
+
+ @Test( dependsOnMethods = { "testAddManagedRepoInvalidRepoName" } )
+ public void testAddManagedRepoInvalidDirectory()
+ {
+ addManagedRepository( "identifier", "name", "<> ~+[ ]'\"", "/.index", "Maven 2.x Repository", "0 0 * * * ?",
+ "1", "1", false );
+ assertTextPresent(
+ "Directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+ }
+
+ @Test( dependsOnMethods = { "testAddManagedRepoInvalidDirectory" } )
+ public void testAddManagedRepoInvalidIndexDir()
+ {
+ addManagedRepository( "identifier", "name", "/home", "<> ~+[ ]'\"", "Maven 2.x Repository", "0 0 * * * ?", "1",
+ "1", false );
+ assertTextPresent(
+ "Index directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+ }
+
+ @Test( dependsOnMethods = { "testAddManagedRepoInvalidIndexDir" } )
+ public void testAddManagedRepoInvalidRetentionCount()
+ {
+ addManagedRepository( "identifier", "name", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1",
+ "101", true );
+ assertTextPresent( "Repository Purge By Retention Count needs to be between 1 and 100." );
+ }
+
+ @Test( dependsOnMethods = { "testAddManagedRepoInvalidRetentionCount" } )
+ public void testAddManagedRepoInvalidDaysOlder()
+ {
+ addManagedRepository( "identifier", "name", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "-1",
+ "1", true );
+ assertTextPresent( "Repository Purge By Days Older Than needs to be larger than 0." );
+ }
+
+ @Test( dependsOnMethods = { "testAddManagedRepoInvalidDaysOlder" } )
+ public void testAddManagedRepoBlankValues()
+ {
+ goToRepositoriesPage();
+ getSelenium().open( "/archiva/admin/addRepository.action" );
+
+ addManagedRepository( "", "", "", "", "Maven 2.x Repository", "", "", "", false );
+ assertTextPresent( "You must enter a repository identifier." );
+ assertTextPresent( "You must enter a repository name." );
+ assertTextPresent( "You must enter a directory." );
assertTextPresent( "Invalid cron expression." );
}
- @Test(dependsOnMethods = { "testAddManagedRepoInvalidValues" } )
- public void testAddManagedRepoInvalidIdentifier()
- {
- addManagedRepository( "<> \\/~+[ ]'\"", "name" , "/home" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "1" );
- assertTextPresent( "Identifier must only contain alphanumeric characters, underscores(_), dots(.), and dashes(-)." );
- }
-
- @Test(dependsOnMethods = { "testAddManagedRepoInvalidIdentifier" } )
- public void testAddManagedRepoInvalidRepoName()
- {
- addManagedRepository( "identifier", "<>\\~+[]'\"" , "/home" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "1" );
- assertTextPresent( "Repository Name must only contain alphanumeric characters, white-spaces(' '), forward-slashes(/), open-parenthesis('('), close-parenthesis(')'), underscores(_), dots(.), and dashes(-)." );
- }
-
- @Test(dependsOnMethods = { "testAddManagedRepoInvalidRepoName" } )
- public void testAddManagedRepoInvalidDirectory()
- {
- addManagedRepository( "identifier", "name" , "<> ~+[ ]'\"" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "1" );
- assertTextPresent( "Directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
- }
-
- @Test(dependsOnMethods = { "testAddManagedRepoInvalidDirectory" } )
- public void testAddManagedRepoInvalidIndexDir()
- {
- addManagedRepository( "identifier", "name" , "/home" , "<> ~+[ ]'\"", "Maven 2.x Repository", "0 0 * * * ?", "1", "1" );
- assertTextPresent( "Index directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
- }
-
- @Test(dependsOnMethods = { "testAddManagedRepoInvalidIndexDir" } )
- public void testAddManagedRepoInvalidRetentionCount()
- {
- addManagedRepository( "identifier", "name" , "/home" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "101" );
- assertTextPresent( "Repository Purge By Retention Count needs to be between 1 and 100." );
- }
-
- @Test(dependsOnMethods = { "testAddManagedRepoInvalidRetentionCount" } )
- public void testAddManagedRepoInvalidDaysOlder()
- {
- addManagedRepository( "identifier", "name" , "/home" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "-1", "1" );
- assertTextPresent( "Repository Purge By Days Older Than needs to be larger than 0." );
- }
-
- @Test(dependsOnMethods = { "testAddManagedRepoInvalidDaysOlder" } )
- public void testAddManagedRepoBlankValues()
- {
- goToRepositoriesPage();
- getSelenium().open( "/archiva/admin/addRepository.action" ); ;
- addManagedRepository( "", "" , "" , "", "Maven 2.x Repository", "", "", "" );
- assertTextPresent( "You must enter a repository identifier." );
- assertTextPresent( "You must enter a repository name." );
- assertTextPresent( "You must enter a directory." );
- assertTextPresent( "Invalid cron expression." );
- }
-
- @Test(dependsOnMethods = { "testAddManagedRepoBlankValues" } )
+ @Test( dependsOnMethods = { "testAddManagedRepoBlankValues" } )
public void testAddManagedRepoNoIdentifier()
{
- addManagedRepository( "", "name", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "", "" );
+ addManagedRepository( "", "name", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "", "", false );
assertTextPresent( "You must enter a repository identifier." );
}
@Test( dependsOnMethods = { "testAddManagedRepoNoIdentifier" } )
public void testAddManagedRepoNoRepoName()
{
- addManagedRepository( "identifier", "", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "", "" );
+ addManagedRepository( "identifier", "", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "", "",
+ false );
assertTextPresent( "You must enter a repository name." );
}
@Test( dependsOnMethods = { "testAddManagedRepoNoRepoName" } )
public void testAddManagedRepoNoDirectory()
{
- addManagedRepository( "identifier", "name", "", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "", "" );
+ addManagedRepository( "identifier", "name", "", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "", "",
+ false );
assertTextPresent( "You must enter a directory." );
}
@Test( dependsOnMethods = { "testAddManagedRepoNoDirectory" } )
public void testAddManagedRepoNoCron()
{
- addManagedRepository( "identifier", "name", "/home", "/.index", "Maven 2.x Repository", "", "", "" );
+ addManagedRepository( "identifier", "name", "/home", "/.index", "Maven 2.x Repository", "", "", "", true );
assertTextPresent( "Invalid cron expression." );
}
goToRepositoriesPage();
getSelenium().open( "/archiva/admin/addRepository.action" );
addManagedRepository( "managedrepo", "Managed Repository Sample", getRepositoryDir() + "local-repo/", "",
- "Maven 2.x Repository", "0 0 * * * ?", "", "" );
+ "Maven 2.x Repository", "0 0 * * * ?", "", "", true );
clickButtonWithValue( "Save" );
assertTextPresent( "Managed Repository Sample" );
}
- @Test(dependsOnMethods = { "testAddManagedRepoForEdit" } )
+ @Test( dependsOnMethods = { "testAddManagedRepoForEdit" } )
public void testEditManagedRepoInvalidValues()
- {
- editManagedRepository("<>\\~+[]'\"" , "<> ~+[ ]'\"" , "<> ~+[ ]'\"", "Maven 2.x Repository", "", "-1", "101");
- assertTextPresent( "Directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
- assertTextPresent( "Repository Name must only contain alphanumeric characters, white-spaces(' '), forward-slashes(/), open-parenthesis('('), close-parenthesis(')'), underscores(_), dots(.), and dashes(-)." );
- assertTextPresent( "Index directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
- assertTextPresent( "Repository Purge By Retention Count needs to be between 1 and 100.");
- assertTextPresent( "Repository Purge By Days Older Than needs to be larger than 0.");
+ {
+ editManagedRepository( "<>\\~+[]'\"", "<> ~+[ ]'\"", "<> ~+[ ]'\"", "Maven 2.x Repository", "", "-1", "101" );
+ assertTextPresent(
+ "Directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+ assertTextPresent(
+ "Repository Name must only contain alphanumeric characters, white-spaces(' '), forward-slashes(/), open-parenthesis('('), close-parenthesis(')'), underscores(_), dots(.), and dashes(-)." );
+ assertTextPresent(
+ "Index directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+ assertTextPresent( "Repository Purge By Retention Count needs to be between 1 and 100." );
+ assertTextPresent( "Repository Purge By Days Older Than needs to be larger than 0." );
assertTextPresent( "Invalid cron expression." );
- }
+ }
- @Test(dependsOnMethods = { "testEditManagedRepoInvalidValues" } )
+ @Test( dependsOnMethods = { "testEditManagedRepoInvalidValues" } )
public void testEditManagedRepoInvalidRepoName()
- {
- editManagedRepository("<>\\~+[]'\"" , "/home" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "1");
- assertTextPresent( "Repository Name must only contain alphanumeric characters, white-spaces(' '), forward-slashes(/), open-parenthesis('('), close-parenthesis(')'), underscores(_), dots(.), and dashes(-)." );
- }
+ {
+ editManagedRepository( "<>\\~+[]'\"", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "1" );
+ assertTextPresent(
+ "Repository Name must only contain alphanumeric characters, white-spaces(' '), forward-slashes(/), open-parenthesis('('), close-parenthesis(')'), underscores(_), dots(.), and dashes(-)." );
+ }
- @Test(dependsOnMethods = { "testEditManagedRepoInvalidRepoName" } )
+ @Test( dependsOnMethods = { "testEditManagedRepoInvalidRepoName" } )
public void testEditManagedRepoInvalidDirectory()
- {
- editManagedRepository("name" , "<> ~+[ ]'\"" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "1");
- assertTextPresent( "Directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
- }
+ {
+ editManagedRepository( "name", "<> ~+[ ]'\"", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "1" );
+ assertTextPresent(
+ "Directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+ }
- @Test(dependsOnMethods = { "testEditManagedRepoInvalidDirectory" } )
+ @Test( dependsOnMethods = { "testEditManagedRepoInvalidDirectory" } )
public void testEditManagedRepoInvalidIndexDir()
- {
- editManagedRepository("name" , "/home" , "<> ~+[ ]'\"", "Maven 2.x Repository", "0 0 * * * ?", "1", "1");
- assertTextPresent( "Index directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
- }
+ {
+ editManagedRepository( "name", "/home", "<> ~+[ ]'\"", "Maven 2.x Repository", "0 0 * * * ?", "1", "1" );
+ assertTextPresent(
+ "Index directory must only contain alphanumeric characters, equals(=), question-marks(?), exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-)." );
+ }
- @Test(dependsOnMethods = { "testEditManagedRepoInvalidIndexDir" } )
+ @Test( dependsOnMethods = { "testEditManagedRepoInvalidIndexDir" } )
public void testEditManagedRepoInvalidCron()
- {
- editManagedRepository("name" , "/home" , "/.index", "Maven 2.x Repository", "", "1", "1");
+ {
+ editManagedRepository( "name", "/home", "/.index", "Maven 2.x Repository", "", "1", "1" );
assertTextPresent( "Invalid cron expression." );
- }
+ }
- @Test(dependsOnMethods = { "testEditManagedRepoInvalidCron" } )
+ @Test( dependsOnMethods = { "testEditManagedRepoInvalidCron" } )
public void testEditManagedRepoInvalidRetentionCount()
- {
- editManagedRepository("name" , "/home" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "101");
+ {
+ editManagedRepository( "name", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "1", "101" );
assertTextPresent( "Repository Purge By Retention Count needs to be between 1 and 100." );
- }
+ }
- @Test(dependsOnMethods = { "testEditManagedRepoInvalidRetentionCount" } )
+ @Test( dependsOnMethods = { "testEditManagedRepoInvalidRetentionCount" } )
public void testEditManagedRepoInvalidDaysOlder()
- {
- editManagedRepository("name" , "/home" , "/.index", "Maven 2.x Repository", "0 0 * * * ?", "-1", "1");
+ {
+ editManagedRepository( "name", "/home", "/.index", "Maven 2.x Repository", "0 0 * * * ?", "-1", "1" );
assertTextPresent( "Repository Purge By Days Older Than needs to be larger than 0." );
- }
+ }
// TODO
@Test( dependsOnMethods = { "testEditManagedRepoInvalidDaysOlder" } )
addRemoteRepository( "remoterepo", "Remote Repository Sample", "", "", "", "", "Maven 2.x Repository" );
assertTextPresent( "You must enter a url." );
}
-
+
@Test( dependsOnMethods = { "testAddRemoteRepoNullURL" } )
- public void testAddProxyConnectorValidValues() throws Exception
+ public void testAddProxyConnectorValidValues()
+ throws Exception
{
getSelenium().open( "/archiva/admin/addProxyConnector.action" );
addProxyConnector( "(direct connection)", "internal", "remoterepo" );