@Test
	public void testChangeNameOfProperty() throws Exception
	{
		// connect to database
		PersistenceManager pm = new PersistenceManager(driver, database, login, password);
		// drop all tables
		pm.dropTable(Object.class);

		// create test objects
		OriginalObject oo = new OriginalObject();
		oo.setValue(76);
		ContainerObject one = new ContainerObject();
		ContainerObject two = new ContainerObject();
		one.setFoo(oo);

		// store test objects
		pm.saveObject(one);
		pm.saveObject(two);
		pm.close();

		// re-connect to database
		pm = new PersistenceManager(driver, database, login, password);
		// change the name of the property class
		new TestTools(pm.getPersist()).changeName(OriginalObject.class, NewName.class);
		new TestTools(pm.getPersist()).changeName(ContainerObject.class, NewNameContainer.class);
		pm.close();

		// re-connect to database
		pm = new PersistenceManager(driver, database, login, password);
		// update schema
		pm.updateSchema(NewName.class);
		pm.close();

		// re-connect to database
		pm = new PersistenceManager(driver, database, login, password);
		// make sure there is one NewName object
		List<NewName> nnList = pm.getObjects(NewName.class, new All());
		assertEquals(1, nnList.size());
		// make sure there are two NewNameContainer objects
		List<NewNameContainer> ncList = pm.getObjects(NewNameContainer.class, new All());
		assertEquals(2, ncList.size());
		// make sure one of the NewNameContainer objects contain the correct
		// NewName object.
		if (ncList.get(0).getFoo() != null)
		{
			assertEquals(76, ncList.get(0).getFoo().getValue());
		} 
		else if (ncList.get(1).getFoo() != null)
		{
			assertEquals(76, ncList.get(1).getFoo().getValue());
		} 
		else
		{
			fail("Reference not preserved.");
		}
		// store a new NewName object in the empty NewNameContainer object
		NewName nu = new NewName();
		nu.setValue(18);
		if (ncList.get(0).getFoo() == null)
		{
			ncList.get(0).setFoo(nu);
			pm.saveObject(ncList.get(0));
		}
		else if (ncList.get(1).getFoo() == null)
		{
			ncList.get(1).setFoo(nu);
			pm.saveObject(ncList.get(1));
		}
		pm.close();

		// re-connect to database
		pm = new PersistenceManager(driver, database, login, password);
		// make sure we can retrieve the NewName object we stored previously
		nnList = pm.getObjects(NewName.class, new All());
		assertEquals(2, nnList.size());
		ncList = pm.getObjects(NewNameContainer.class, new All());
		assertEquals(2, ncList.size());
		NewNameContainer nc1 = ncList.get(0);
		NewNameContainer nc2 = ncList.get(1);
		assertTrue((nc1.getFoo().getValue() == 18 && nc2.getFoo().getValue() == 76)
				|| (nc1.getFoo().getValue() == 76 && nc2.getFoo().getValue() == 18));
		pm.close();

	}