[MOBY-guts] biomoby commit

Martin Senger senger at dev.open-bio.org
Mon Mar 3 11:34:17 UTC 2008


senger
Mon Mar  3 06:34:17 EST 2008
Update of /home/repository/moby/moby-live/Java/src/test/java/org/biomoby/shared/parser
In directory dev.open-bio.org:/tmp/cvs-serv3170/src/test/java/org/biomoby/shared/parser

Modified Files:
	MobyParserTest.java 
Log Message:
* more work on junit testing and its infrastructure
* removing some compiler warnings from generated data types
* better use of caching in skeleton generator

moby-live/Java/src/test/java/org/biomoby/shared/parser MobyParserTest.java,1.3,1.4
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/test/java/org/biomoby/shared/parser/MobyParserTest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/src/test/java/org/biomoby/shared/parser/MobyParserTest.java	2008/03/03 03:11:27	1.3
+++ /home/repository/moby/moby-live/Java/src/test/java/org/biomoby/shared/parser/MobyParserTest.java	2008/03/03 11:34:17	1.4
@@ -57,22 +57,22 @@
     public void testNormal()
 	throws IOException, MobyException {
 	MobyPackage moby = parse (INPUT_1, null, null);
-	assertEquals (moby.getServiceNotes(), "freetext notes here");
-	assertEquals (moby.getAuthority(), "http://\"me\".<org>&");
+	assertEquals ("freetext notes here", moby.getServiceNotes());
+	assertEquals ("http://\"me\".<org>&", moby.getAuthority());
 	MobyJob[] jobs = moby.getJobs();
-	assertEquals (jobs.length, 4);
-	assertEquals (jobs[0].getId(), "a1");
+	assertEquals (4, jobs.length);
+	assertEquals ("a1", jobs[0].getId());
 	MobyObject data = jobs[0].getData();
-	assertEquals (data.getMobyTypeName(), "NucleotideSequence");
-	assertEquals (data.getName(), "");
-	assertEquals (data.getNamespace(), "DragonDB_Allele");
-	assertEquals (data.getId(), "chlorae");
+	assertEquals ("NucleotideSequence", data.getMobyTypeName());
+	assertEquals ("", data.getName());
+	assertEquals ("DragonDB_Allele", data.getNamespace());
+	assertEquals ("chlorae", data.getId());
 	assertFalse (data.isPrimitiveType());
-	assertEquals (data.getClass().getName(), "org.biomoby.shared.datatypes.NucleotideSequence");
+	assertEquals ("org.biomoby.shared.datatypes.NucleotideSequence", data.getClass().getName());
 	NucleotideSequence typedData = (NucleotideSequence)jobs[0].getData();
-	assertEquals (typedData.get_SequenceString(), ">tata\ntatata");
-	assertEquals (typedData.getMoby_SequenceString().getValue(), ">tata\ntatata");
-	assertEquals (typedData.getMoby_Length().getIntValue(), 10);
+	assertEquals (">tata\ntatata", typedData.get_SequenceString());
+	assertEquals (">tata\ntatata", typedData.getMoby_SequenceString().getValue());
+	assertEquals (10, typedData.getMoby_Length().getIntValue());
     }
 
      @Test
@@ -80,8 +80,8 @@
  	throws IOException, MobyException {
 	MobyPackage moby = parse (INPUT_2, "DNASequence", null);
 	DNASequence typedData = (DNASequence)moby.getJob(0).getData ("myDNA");
-	assertEquals (typedData.get_SequenceString(), "abcd");
-	assertEquals (typedData.getMoby_Length().getIntValue(), 12);
+	assertEquals ("abcd", typedData.get_SequenceString());
+	assertEquals (12, typedData.getMoby_Length().getIntValue());
      }
 
     @Test
@@ -90,18 +90,18 @@
 	MobyPackage moby = parse (INPUT_3, "BasicGFF3MultiFeature", null);
 	BasicGFF3MultiFeature typedData = (BasicGFF3MultiFeature)moby.getJob(0).getData ("myPairs");
 	BasicGFF3SequenceFeature[] data = typedData.getMoby_BasicGFF3SequenceFeature();
-	assertEquals (data.length, 1);
-	assertEquals (data[0].getMoby_start().getIntValue(), 1);
-	assertEquals (data[0].getMoby_score().getFloatValue(), 12.34, 0);
-	assertEquals (data[0].get_phase(), "b");
+	assertEquals (1, data.length);
+	assertEquals (1, data[0].getMoby_start().getIntValue());
+	assertEquals (12.34, data[0].getMoby_score().getFloatValue(), 0.01);
+	assertEquals ("b", data[0].get_phase());
 	multi_key_value_pair[] pairs = data[0].getMoby_column9_tag_value();
-	assertEquals (pairs.length, 2);
-	assertEquals (pairs[0].get_key(), "key1");
-	assertEquals (pairs[0].get_the_value().length, 3);
-	assertEquals (pairs[0].get_the_value()[0], "value1");
-	assertEquals (pairs[1].get_key(), "key2");
-	assertEquals (pairs[1].get_the_value().length, 1);
-	assertEquals (pairs[1].get_the_value()[0], "valueA");
+	assertEquals (2, pairs.length);
+	assertEquals ("key1", pairs[0].get_key());
+	assertEquals (3, pairs[0].get_the_value().length);
+	assertEquals ("value1", pairs[0].get_the_value()[0]);
+	assertEquals ("key2", pairs[1].get_key());
+	assertEquals (1, pairs[1].get_the_value().length);
+	assertEquals ("valueA", pairs[1].get_the_value()[0]);
     }
 
     @Test
@@ -113,18 +113,18 @@
 	MobyPackage moby = parse (INPUT_4, null, backups);
 	BasicGFF3MultiFeature typedData = (BasicGFF3MultiFeature)moby.getJob(0).getData ("myPairs");
 	BasicGFF3SequenceFeature[] data = typedData.getMoby_BasicGFF3SequenceFeature();
-	assertEquals (data.length, 1);
-	assertEquals (data[0].getMoby_start().getIntValue(), 1);
-	assertEquals (data[0].getMoby_score().getFloatValue(), 12.34, 0);
-	assertEquals (data[0].get_phase(), "b");
+	assertEquals (1, data.length);
+	assertEquals (1, data[0].getMoby_start().getIntValue());
+	assertEquals (12.34, data[0].getMoby_score().getFloatValue(), 0.01);
+	assertEquals ("b", data[0].get_phase());
 	multi_key_value_pair[] pairs = data[0].getMoby_column9_tag_value();
-	assertEquals (pairs.length, 1);
-	assertEquals (pairs[0].get_key(), "key1");
-	assertEquals (pairs[0].get_the_value().length, 1);
-	assertEquals (pairs[0].get_the_value()[0], "value1");
+	assertEquals (1, pairs.length);
+	assertEquals ("key1", pairs[0].get_key());
+	assertEquals (1, pairs[0].get_the_value().length);
+	assertEquals ("value1", pairs[0].get_the_value()[0]);
 	DNASequence seqData = (DNASequence)moby.getJob(0).getData ("mySeq");
-	assertEquals (seqData.get_SequenceString(), "xyz");
-	assertEquals (seqData.getMoby_Length().getIntValue(), 123);
+	assertEquals ("xyz", seqData.get_SequenceString());
+	assertEquals (123, seqData.getMoby_Length().getIntValue());
     }
 
     @Test
@@ -134,41 +134,40 @@
  	backups.put ("mySequenceCollection", "GenericSequence");
 	MobyPackage moby = parse (INPUT_SET, null, backups);
 	MobyObject[] data = moby.getJob(0).getDataSet ("mySequenceCollection");
-	assertEquals (data[0].getMobyTypeName(), "DNASequence");
-	assertEquals (data[1].getMobyTypeName(), "GenericSequence");
+	assertEquals ("DNASequence", data[0].getMobyTypeName());
+	assertEquals ("GenericSequence", data[1].getMobyTypeName());
 	GenericSequence typedData = (GenericSequence)data[0];
-	assertEquals (typedData.get_SequenceString(), "tatatatata");
-	assertEquals (typedData.getMoby_Length().getIntValue(), 10);
+	assertEquals ("tatatatata", typedData.get_SequenceString());
+	assertEquals (10, typedData.getMoby_Length().getIntValue());
 	typedData = (GenericSequence)data[1];
-	assertEquals (typedData.get_SequenceString(), "");
-	assertEquals (typedData.getMoby_Length().getIntValue(), 5);
+	assertEquals ("", typedData.get_SequenceString());
+	assertEquals (5, typedData.getMoby_Length().getIntValue());
     }
 
     @Test
     public void testXref()
 	throws IOException, MobyException {
 	MobyPackage moby = parse (INPUT_XREFS, null, null);
-	assertEquals (moby.getJob(0).getData().getValue().trim(),
-		      "This is a value");
+	assertEquals ("This is a value", moby.getJob(0).getData().getValue().trim());
 	MobyXref[] xrefs = moby.getJob(0).getData().getXrefs();
-	assertEquals (xrefs.length, 3);
+	assertEquals (3, xrefs.length);
 	assertTrue  (xrefs[0].isSimpleXref());
 	assertTrue  (xrefs[1].isSimpleXref());
 	assertFalse (xrefs[2].isSimpleXref());
-	assertEquals (xrefs[0].getId(), "At263644");
-	assertEquals (xrefs[0].getNamespace(), "TIGR");
-	assertEquals (xrefs[2].getId(), "yes");
-	assertEquals (xrefs[2].getNamespace(), "LION");
-	assertEquals (xrefs[2].getEvidenceCode(), "IEA");
+	assertEquals ("At263644", xrefs[0].getId());
+	assertEquals ("TIGR", xrefs[0].getNamespace());
+	assertEquals ("yes", xrefs[2].getId());
+	assertEquals ("LION", xrefs[2].getNamespace());
+	assertEquals ("IEA", xrefs[2].getEvidenceCode());
 
 	MobyProvisionInfo pi = moby.getJob(0).getData().getProvision();
-	assertEquals (pi.getSoftwareName(),    "InterPro");
-	assertEquals (pi.getSoftwareVersion(), "1.2");
-	assertEquals (pi.getSoftwareComment(), "HMMER's not run");
-	assertEquals (pi.getDBName(),    "Genbank/nt");
-	assertEquals (pi.getDBVersion(), "April 8, 2003");
-	assertEquals (pi.getDBComment(), "DBver");
-	assertEquals (pi.getComment(), "this <&>\"<&>\" is a software comment");
+	assertEquals ("InterPro", pi.getSoftwareName());
+	assertEquals ("1.2", pi.getSoftwareVersion());
+	assertEquals ("HMMER's not run", pi.getSoftwareComment());
+	assertEquals ("Genbank/nt", pi.getDBName());
+	assertEquals ("April 8, 2003", pi.getDBVersion());
+	assertEquals ("DBver", pi.getDBComment());
+	assertEquals ("this <&>\"<&>\" is a software comment", pi.getComment());
     }
 
 




More information about the MOBY-guts mailing list