public PackageTest(String arg0) {
super(arg0);
}
public void testRecovery() throws Exception {
ConfigTestElement config = new ConfigTestElement();
config.addProperty(new StringProperty("name", "config"));
config.setRunningVersion(true);
LoginConfig loginConfig = new LoginConfig();
loginConfig.setUsername("user1");
loginConfig.setPassword("pass1");
assertTrue(config.getProperty("login") instanceof NullProperty);
// This test should work whether or not all Nulls are equal
assertEquals(new NullProperty("login"), config.getProperty("login"));
config.addProperty(new TestElementProperty("login", loginConfig));
assertEquals(loginConfig.toString(), config.getPropertyAsString("login"));
config.recoverRunningVersion();
assertTrue(config.getProperty("login") instanceof NullProperty);
assertEquals(new NullProperty("login"), config.getProperty("login"));
}