Skip to content

Commit

Permalink
A few more interfaces instead of implementations
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed May 22, 2010
1 parent 6317be2 commit 648a2f4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Expand Up @@ -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;
Expand All @@ -50,7 +51,7 @@ public class TaeAminoAcidDescriptorTest extends CDKTestCase {
}

@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();
Expand Down
5 changes: 3 additions & 2 deletions src/test/org/openscience/cdk/templates/AminoAcidsTest.java
Expand Up @@ -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;

Expand All @@ -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++) {
Expand All @@ -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());

Expand Down
Expand Up @@ -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;

/**
Expand All @@ -36,7 +37,7 @@ public class ProteinBuilderToolTest extends CDKTestCase {

@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());
Expand Down

0 comments on commit 648a2f4

Please sign in to comment.