Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/static analysis 2 #532

Merged
merged 21 commits into from Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -56,7 +56,7 @@ public void testAddAtom_IAtom() {
public void testAddAtom_IAtom_IMonomer() {
IPolymer oPolymer = (IPolymer) newChemObject();
IMonomer oMono1 = oPolymer.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = null;
IAtom oAtom1 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom2 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
Expand Down Expand Up @@ -85,9 +85,9 @@ public void testGetMonomerCount() {
Assert.assertEquals(0, oPolymer.getMonomerCount());

IMonomer oMono1 = oPolymer.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = oPolymer.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom1 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom2 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
Expand All @@ -104,9 +104,9 @@ public void testGetMonomer_String() {
IPolymer oPolymer = (IPolymer) newChemObject();

IMonomer oMono1 = oPolymer.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = oPolymer.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom1 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom2 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
Expand All @@ -125,9 +125,9 @@ public void testGetMonomerNames() {
Assert.assertEquals(0, oPolymer.getMonomerNames().size());

IMonomer oMono1 = oPolymer.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = oPolymer.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom1 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom2 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
Expand All @@ -149,7 +149,7 @@ public void testGetMonomerNames() {
public void testRemoveMonomer_String() {
IPolymer oPolymer = (IPolymer) newChemObject();
IMonomer oMono1 = oPolymer.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IAtom oAtom1 = oPolymer.getBuilder().newInstance(IAtom.class, "C");
oPolymer.addAtom(oAtom1, oMono1);
Assert.assertTrue(oPolymer.getMonomerNames().contains(oMono1.getMonomerName()));
Expand All @@ -168,16 +168,13 @@ public void testRemoveMonomer_String() {
public void testToString() {
IPolymer polymer = (IPolymer) newChemObject();
IMonomer oMono1 = polymer.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = polymer.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom2 = polymer.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = polymer.getBuilder().newInstance(IAtom.class, "C");
polymer.addAtom(oAtom2, oMono1);
polymer.addAtom(oAtom3, oMono2);
Map<String, IMonomer> monomers = new Hashtable<String, IMonomer>();
monomers.put("TRP279", oMono1);
monomers.put("HOH", oMono2);
String description = polymer.toString();
for (int i = 0; i < description.length(); i++) {
Assert.assertTrue('\n' != description.charAt(i));
Expand All @@ -193,7 +190,7 @@ public void testToString() {
public void testClone() throws Exception {
IPolymer polymer = (IPolymer) newChemObject();
Object clone = polymer.clone();
Assert.assertTrue(clone instanceof IPolymer);
Assert.assertNotNull(clone);
}

}
Expand Up @@ -89,7 +89,7 @@ public void testAddAtom_IAtom() {
public void testAddAtom_IAtom_IMonomer() {
IStrand oStrand = (IStrand) newChemObject();
IMonomer oMono1 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IAtom oAtom1 = oStrand.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom2 = oStrand.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oStrand.getBuilder().newInstance(IAtom.class, "C");
Expand All @@ -105,9 +105,9 @@ public void testAddAtom_IAtom_IMonomer() {
public void testGetMonomerCount() {
IStrand oStrand = (IStrand) newChemObject();
IMonomer oMono1 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom2 = oStrand.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oStrand.getBuilder().newInstance(IAtom.class, "C");
oStrand.addAtom(oAtom2, oMono1);
Expand All @@ -120,9 +120,9 @@ public void testGetMonomerCount() {
public void testGetMonomer_String() {
IStrand oStrand = (IStrand) newChemObject();
IMonomer oMono1 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom2 = oStrand.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oStrand.getBuilder().newInstance(IAtom.class, "C");
oStrand.addAtom(oAtom2, oMono1);
Expand All @@ -137,9 +137,9 @@ public void testGetMonomer_String() {
public void testGetMonomerNames() {
IStrand oStrand = (IStrand) newChemObject();
IMonomer oMono1 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom2 = oStrand.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oStrand.getBuilder().newInstance(IAtom.class, "C");
oStrand.addAtom(oAtom2, oMono1);
Expand Down Expand Up @@ -167,7 +167,7 @@ public void testGetMonomerNames() {
public void testRemoveMonomer_String() {
IStrand oStrand = (IStrand) newChemObject();
IMonomer oMono1 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IAtom oAtom1 = oStrand.getBuilder().newInstance(IAtom.class, "C");
oStrand.addAtom(oAtom1, oMono1);
Assert.assertTrue(oStrand.getMonomerNames().contains(oMono1.getMonomerName()));
Expand All @@ -181,9 +181,9 @@ public void testRemoveMonomer_String() {
public void testGetMonomers() {
IStrand oStrand = (IStrand) newChemObject();
IMonomer oMono1 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom2 = oStrand.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oStrand.getBuilder().newInstance(IAtom.class, "C");
oStrand.addAtom(oAtom2, oMono1);
Expand All @@ -207,20 +207,16 @@ public void testGetMonomers() {
public void testToString() {
IStrand oStrand = (IStrand) newChemObject();
IMonomer oMono1 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono1.setMonomerName(new String("TRP279"));
oMono1.setMonomerName("TRP279");
IMonomer oMono2 = oStrand.getBuilder().newInstance(IMonomer.class);
oMono2.setMonomerName(new String("HOH"));
oMono2.setMonomerName("HOH");
IAtom oAtom2 = oStrand.getBuilder().newInstance(IAtom.class, "C");
IAtom oAtom3 = oStrand.getBuilder().newInstance(IAtom.class, "C");
oStrand.addAtom(oAtom2, oMono1);
oStrand.addAtom(oAtom3, oMono2);
Map<String, IMonomer> monomers = new Hashtable<String, IMonomer>();
IMonomer oMon = oStrand.getBuilder().newInstance(IMonomer.class);
oMon.setMonomerName("");
oMon.setMonomerType("UNKNOWN");
monomers.put("", oMon);
monomers.put("TRP279", oMono1);
monomers.put("HOH", oMono2);
String description = oStrand.toString();
for (int i = 0; i < description.length(); i++) {
Assert.assertTrue('\n' != description.charAt(i));
Expand All @@ -236,7 +232,7 @@ public void testToString() {
public void testClone() throws Exception {
IStrand strand = (IStrand) newChemObject();
Object clone = strand.clone();
Assert.assertTrue(clone instanceof IStrand);
Assert.assertNotNull(clone);
egonw marked this conversation as resolved.
Show resolved Hide resolved
}

}