public getCreator ( long n ) : ModelCreator | ||
n | long | |
Результат | ModelCreator |
public void test_ModelHistory_copyConstructor() { ModelHistory mh = new ModelHistory(); ModelCreator mc = new ModelCreator(); mc.setFamilyName("Keating"); mc.setGivenName("Sarah"); mc.setEmail("*****@*****.**"); mh.addCreator(mc); mc = null; Date date = new Date(2005,12,30,12,15,45,1,2,0); mh.setCreatedDate(date); date = null; assertTrue( mh.getCreatedDate().getMonth() == 12 ); assertTrue( mh.getCreatedDate().getSecond() == 45 ); assertTrue( ((ModelCreator) mh.getCreator(0)).getFamilyName() == "Keating" ); ModelHistory mh2 = new ModelHistory(mh); assertTrue( mh2.getCreatedDate().getMonth() == 12 ); assertTrue( mh2.getCreatedDate().getSecond() == 45 ); assertTrue( ((ModelCreator) mh2.getCreator(0)).getFamilyName() == "Keating" ); mh2 = null; mh = null; }
public void test_Model_setgetModelHistory() { ModelHistory history = new ModelHistory(); ModelCreator mc = new ModelCreator(); Date date = new Date(2005,12,30,12,15,45,1,2,0); mc.setFamilyName( "Keating"); mc.setGivenName( "Sarah"); mc.setEmail( "*****@*****.**"); mc.setOrganisation( "UH"); history.addCreator(mc); history.setCreatedDate(date); history.setModifiedDate(date); assertTrue( M.isSetModelHistory() == false ); M.setModelHistory(history); assertTrue( M.isSetModelHistory() == true ); ModelCreator newMC = history.getCreator(0); assertTrue( newMC != null ); assertTrue(( "Keating" == newMC.getFamilyName() )); assertTrue(( "Sarah" == newMC.getGivenName() )); assertTrue(( "*****@*****.**" == newMC.getEmail() )); assertTrue(( "UH" == newMC.getOrganisation() )); M.unsetModelHistory(); assertTrue( M.isSetModelHistory() == false ); history = null; mc = null; }