} catch (IllegalArgumentException e) {
assertTrue(true);
// success
}
Species s3 = new Species();
s3.setId("SP1");
try {
model.addSpecies(s3);
fail("We should not be able to register twice the same id.");
} catch (IllegalArgumentException e) {
assertTrue(true);
// success
}
assertTrue(model.getSpecies("S3") == null);
s3.setId("LP1");
try {
model.addSpecies(s3);
assertTrue(true);
} catch (IllegalArgumentException e) {
fail("We should be able to register an id that is the same as a local parameter id.");
}
model.removeSpecies(s3);
assertTrue(model.getSpecies("S3") == null);
// Testing again after having removed the Species
try {
model.addSpecies(s3);
assertTrue(true);
} catch (IllegalArgumentException e) {
fail("We should be able to register an id that is the same as a local parameter id.");
}
model.removeSpecies(s3);
assertTrue(model.getSpecies("S3") == null);
// Setting the same metaid as a SpeciesReference
try {
s3.setMetaId("SP1");
assertTrue(true);
} catch (IdentifierException e) {
fail("We should be able to put any metaId to a Species removed from a model.");
}
try {
model.addSpecies(s3);
fail("We should not be able to register twice the same metaid.");
} catch (IllegalArgumentException e) {
assertTrue(true);
// success
}
assertTrue(model.getSpecies("S3") == null);
try {
s3.setId("S1");
assertTrue(true);
} catch (IdentifierException e) {
fail("We should be able to put any id to a Species removed from a model.");
}
try {
model.addSpecies(s3);
fail("We should not be able to register twice the same id.");
} catch (IllegalArgumentException e) {
assertTrue(true);
// success
}
assertTrue(model.getSpecies("S3") == null);
// Setting the same metaid as a LocalParameter
try {
s3.setMetaId("LP1");
assertTrue(true);
} catch (IdentifierException e) {
fail("We should be able to put any metaId to a Species not linked to a model.");
}