Permalink
Browse files

A few more interfaces instead of implementations

Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information...
1 parent 6317be2 commit 648a2f48b8aea3479313af372766ae1e6da0d3c9 @egonw egonw committed with rajarshi May 22, 2010
@@ -24,6 +24,7 @@
import org.junit.Before;
import org.junit.Test;
import org.openscience.cdk.BioPolymer;
+import org.openscience.cdk.interfaces.IBioPolymer;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.qsar.IMolecularDescriptor;
import org.openscience.cdk.qsar.result.IDescriptorResult;
@@ -46,7 +47,7 @@ public void setUp() throws Exception {
}
@Test public void testAACount() throws Exception {
- BioPolymer protein = ProteinBuilderTool.createProtein("ARNDCFQEGHIPLKMSTYVW");
+ IBioPolymer protein = ProteinBuilderTool.createProtein("ARNDCFQEGHIPLKMSTYVW");
IDescriptorResult result = descriptor.calculate(protein).getValue();
Assert.assertTrue(result instanceof IntegerArrayResult);
IntegerArrayResult iaResult = (IntegerArrayResult)result;
@@ -58,7 +59,7 @@ public void setUp() throws Exception {
@Test
public void testFCount() throws Exception {
- BioPolymer protein = ProteinBuilderTool.createProtein("FF");
+ IBioPolymer protein = ProteinBuilderTool.createProtein("FF");
IDescriptorResult result = descriptor.calculate(protein).getValue();
Assert.assertTrue(result instanceof IntegerArrayResult);
IntegerArrayResult iaResult = (IntegerArrayResult)result;
@@ -67,7 +68,7 @@ public void testFCount() throws Exception {
}
@Test public void testTCount() throws Exception {
- BioPolymer protein = ProteinBuilderTool.createProtein("TT");
+ IBioPolymer protein = ProteinBuilderTool.createProtein("TT");
IDescriptorResult result = descriptor.calculate(protein).getValue();
Assert.assertTrue(result instanceof IntegerArrayResult);
IntegerArrayResult iaResult = (IntegerArrayResult)result;
@@ -30,6 +30,7 @@
import org.openscience.cdk.BioPolymer;
import org.openscience.cdk.CDKTestCase;
import org.openscience.cdk.exception.CDKException;
+import org.openscience.cdk.interfaces.IBioPolymer;
import org.openscience.cdk.qsar.DescriptorValue;
import org.openscience.cdk.qsar.IMolecularDescriptor;
import org.openscience.cdk.qsar.result.DoubleArrayResult;
@@ -50,7 +51,7 @@
}
@Test public void testTaeAminoAcidDescriptor() throws ClassNotFoundException, CDKException, Exception {
- BioPolymer pepseq = ProteinBuilderTool.createProtein("ACDEFGH");
+ IBioPolymer pepseq = ProteinBuilderTool.createProtein("ACDEFGH");
DescriptorValue result = descriptor.calculate(pepseq);
DoubleArrayResult dar = (DoubleArrayResult) result.getValue();
@@ -26,6 +26,7 @@
import org.junit.Assert;
import org.junit.Test;
import org.openscience.cdk.AminoAcid;
+import org.openscience.cdk.interfaces.IAminoAcid;
import org.openscience.cdk.templates.AminoAcids;
import org.openscience.cdk.CDKTestCase;
@@ -45,7 +46,7 @@ public void testCreateBondMatrix() {
@Test
public void testCreateAAs() {
- AminoAcid[] aas = AminoAcids.createAAs();
+ IAminoAcid[] aas = AminoAcids.createAAs();
Assert.assertNotNull(aas);
Assert.assertEquals(20, aas.length);
for (int i=0; i<20; i++) {
@@ -60,7 +61,7 @@ public void testCreateAAs() {
@Test
public void testGetHashMapBySingleCharCode() {
- Map<String,AminoAcid> map = AminoAcids.getHashMapBySingleCharCode();
+ Map<String,IAminoAcid> map = AminoAcids.getHashMapBySingleCharCode();
Assert.assertNotNull(map);
Assert.assertEquals(20, map.size());
@@ -27,6 +27,7 @@
import org.junit.Test;
import org.openscience.cdk.BioPolymer;
import org.openscience.cdk.CDKTestCase;
+import org.openscience.cdk.interfaces.IBioPolymer;
import org.openscience.cdk.tools.ProteinBuilderTool;
/**
@@ -36,7 +37,7 @@
@Test
public void testCreateProtein() throws Exception {
- BioPolymer protein = ProteinBuilderTool.createProtein("GAGA");
+ IBioPolymer protein = ProteinBuilderTool.createProtein("GAGA");
Assert.assertNotNull(protein);
Assert.assertEquals(4, protein.getMonomerCount());
Assert.assertEquals(1, protein.getStrandCount());

0 comments on commit 648a2f4

Please sign in to comment.