Methods Summary |
---|
public static void | main(java.lang.String[] args)
final TestRunner runner= new TestRunner();
final TestResult result = runner.doRun(
RepositoryNameValidatorTest.suite(), false);
System.exit(result.errorCount() + result.failureCount());
|
protected void | setUp()
validator = new RepositoryNameValidator("repository name");
random = new Random();
|
public static junit.framework.Test | suite()
TestSuite suite = new TestSuite(RepositoryNameValidatorTest.class);
return suite;
|
protected void | tearDown()
validator = null;
random = null;
|
public void | testCombination()
for (int i = 0; i < ITERATIONS; i++)
{
testInvalid("" +
VALID_CHARS[random.nextInt(VALID_CHARS.length)] +
INVALID_CHARS[random.nextInt(INVALID_CHARS.length)]);
}
|
void | testInvalid(java.lang.String invalid)
try
{
validator.validate(invalid);
System.out.println(invalid);
Assert.assertTrue(false);
}
catch (Exception e)
{
//ok
}
|
public void | testInvalidChar()
for (int i = 0; i < INVALID_CHARS.length; i++)
{
testInvalid("" + INVALID_CHARS[i]);
}
|
public void | testInvalidStr()
for (int i = 0; i < ITERATIONS; i++)
{
testInvalid("" +
INVALID_CHARS[random.nextInt(INVALID_CHARS.length)] +
INVALID_CHARS[random.nextInt(INVALID_CHARS.length)]);
}
|
public void | testNull()
testInvalid(null);
|
void | testValid(java.lang.String valid)
try
{
validator.validate(valid);
}
catch (Exception e)
{
Assert.assertTrue(false);
}
|
public void | testValidChar()
for (int i = 0; i < VALID_CHARS.length; i++)
{
testValid("" + VALID_CHARS[i]);
}
|
public void | testValidStr()
for (int i = 0; i < ITERATIONS; i++)
{
testValid("" +
VALID_CHARS[random.nextInt(VALID_CHARS.length)] +
VALID_CHARS[random.nextInt(VALID_CHARS.length)]);
}
|
public void | testZeroLength()
testInvalid("");
|