public void test_L3_Species_ModelHistory() { ModelHistory history = new ModelHistory(); int i = (S).setModelHistory(history); assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT ); assertEquals( false, (S).isSetModelHistory() ); 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); i = (S).setModelHistory(history); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertEquals( true, (S).isSetModelHistory() ); i = (S).unsetModelHistory(); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertEquals( false, (S).isSetModelHistory() ); assertTrue( (S).getModelHistory() == null ); history = null; }
public void test_ModelHistory_addCreator() { ModelCreator newMC; ModelHistory history = new ModelHistory(); assertTrue( history.getNumCreators() == 0 ); assertTrue( history != null ); ModelCreator mc = new ModelCreator(); assertTrue( mc != null ); mc.setFamilyName( "Keating"); mc.setGivenName( "Sarah"); mc.setEmail( "*****@*****.**"); mc.setOrganisation( "UH"); history.addCreator(mc); assertTrue( history.getNumCreators() == 1 ); mc = null; newMC = history.getListCreators().get(0); assertTrue( newMC != null ); assertTrue(( "Keating" == newMC.getFamilyName() )); assertTrue(( "Sarah" == newMC.getGivenName() )); assertTrue(( "*****@*****.**" == newMC.getEmail() )); assertTrue(( "UH" == newMC.getOrganisation() )); history = null; }
public void test_ModelCreator_setters() { ModelCreator mc = new ModelCreator(); assertTrue( mc != null ); assertTrue( mc.isSetFamilyName() == false ); assertTrue( mc.isSetGivenName() == false ); assertTrue( mc.isSetEmail() == false ); assertTrue( mc.isSetOrganisation() == false ); mc.setFamilyName( "Keating"); mc.setGivenName( "Sarah"); mc.setEmail( "*****@*****.**"); mc.setOrganisation( "UH"); assertTrue(( "Keating" == mc.getFamilyName() )); assertTrue(( "Sarah" == mc.getGivenName() )); assertTrue(( "*****@*****.**" == mc.getEmail() )); assertTrue(( "UH" == mc.getOrganisation() )); assertTrue( mc.isSetFamilyName() == true ); assertTrue( mc.isSetGivenName() == true ); assertTrue( mc.isSetEmail() == true ); assertTrue( mc.isSetOrganisation() == true ); mc.unsetFamilyName(); mc.unsetGivenName(); mc.unsetEmail(); mc.unsetOrganisation(); assertTrue(( "" == mc.getFamilyName() )); assertTrue(( "" == mc.getGivenName() )); assertTrue(( "" == mc.getEmail() )); assertTrue(( "" == mc.getOrganisation() )); assertTrue( mc.isSetFamilyName() == false ); assertTrue( mc.isSetGivenName() == false ); assertTrue( mc.isSetEmail() == false ); assertTrue( mc.isSetOrganisation() == false ); assertTrue( mc.isSetOrganization() == false ); mc.setOrganization( "UH"); assertTrue(( "UH" == mc.getOrganization() )); assertTrue( mc.isSetOrganization() == true ); mc.unsetOrganisation(); assertTrue(( "" == mc.getOrganization() )); assertTrue( mc.isSetOrganization() == false ); mc = 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; }
public void test_SBase_setModelHistory_Model() { 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); int i = S.setModelHistory(history); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); history = null; }
public void test_SBase_setModelHistoryL3() { SBase sb = new Species(3,1); ModelHistory mh = 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"); mh.addCreator(mc); mh.setCreatedDate(date); mh.setModifiedDate(date); int i = sb.setModelHistory(mh); assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS ); assertTrue( sb.isSetModelHistory() == true ); mh = sb.getModelHistory(); assertTrue( mh != null ); sb.unsetModelHistory(); mh = sb.getModelHistory(); assertTrue( sb.isSetModelHistory() == false ); assertTrue( mh == null ); mh = null; }