コード例 #1
0
 @Test
 public void testValidateSuccess() throws IOException {
   writeTo(environmentFile, environmentConfig);
   writeTo(databaseFile, workingDatabaseConfig);
   try {
     factory.validate(workingConfiguration);
   } catch (InvalidConfigurationException e) {
     assertTrue("This configuration is valid " + e.getMessage(), false);
   }
 }
コード例 #2
0
 @Test
 public void testValidateFailDatabaseConfigMissingField() throws IOException {
   writeTo(environmentFile, environmentConfig);
   writeTo(databaseFile, databaseConfigMissingField);
   try {
     factory.validate(workingConfiguration);
     assertTrue("This configuration is invalid", false);
   } catch (InvalidConfigurationException e) {
     assertTrue("This configuration is invalid " + e.getMessage(), true);
   }
 }