minor change: add one more decimal place to table output
[jalview.git] / forester / java / src / org / forester / test / Test.java
index ae43b31..cd648f8 100644 (file)
@@ -127,7 +127,7 @@ import org.forester.ws.wabi.TxSearch.TAX_RANK;
 @SuppressWarnings( "unused")
 public final class Test {
 
-    private final static boolean PERFORM_DB_TESTS          = true;
+    private final static boolean PERFORM_DB_TESTS          = false;
     private final static double  ZERO_DIFF                 = 1.0E-9;
     private final static String  PATH_TO_TEST_DATA         = System.getProperty( "user.dir" )
                                                                    + ForesterUtil.getFileSeparator() + "test_data"
@@ -175,8 +175,8 @@ public final class Test {
             if ( ForesterUtil.calculateOverlap( d4, covered ) != 2 ) {
                 return false;
             }
-            final Domain a = new BasicDomain( "a", ( short ) 2, ( short ) 5, ( short ) 1, ( short ) 1, 0.01, 1 );
-            final Domain b = new BasicDomain( "b", ( short ) 2, ( short ) 10, ( short ) 1, ( short ) 1, 0.1, 1 );
+            final Domain a = new BasicDomain( "a", ( short ) 2, ( short ) 5, ( short ) 1, ( short ) 1, 1, -1 );
+            final Domain b = new BasicDomain( "b", ( short ) 2, ( short ) 10, ( short ) 1, ( short ) 1, 0.1, -1 );
             final Protein ab = new BasicProtein( "ab", "varanus", 0 );
             ab.addProteinDomain( a );
             ab.addProteinDomain( b );
@@ -187,7 +187,7 @@ public final class Test {
             if ( ab_s0.getNumberOfProteinDomains() != 1 ) {
                 return false;
             }
-            if ( !ab_s0.getProteinDomain( 0 ).getDomainId().equals( "a" ) ) {
+            if ( !ab_s0.getProteinDomain( 0 ).getDomainId().equals( "b" ) ) {
                 return false;
             }
             final Protein ab_s1 = ForesterUtil.removeOverlappingDomains( 4, false, ab );
@@ -1365,7 +1365,7 @@ public final class Test {
     private static boolean testBasicPhyloXMLparsing() {
         try {
             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
-            final PhyloXmlParser xml_parser = new PhyloXmlParser();
+            final PhyloXmlParser xml_parser = PhyloXmlParser.createPhyloXmlParser();
             final Phylogeny[] phylogenies_0 = factory.create( Test.PATH_TO_TEST_DATA + "phyloxml_test_t1.xml",
                                                               xml_parser );
             if ( xml_parser.getErrorCount() > 0 ) {
@@ -1558,7 +1558,7 @@ public final class Test {
     private static boolean testBasicPhyloXMLparsingRoundtrip() {
         try {
             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
-            final PhyloXmlParser xml_parser = new PhyloXmlParser();
+            final PhyloXmlParser xml_parser = PhyloXmlParser.createPhyloXmlParser();
             if ( USE_LOCAL_PHYLOXML_SCHEMA ) {
                 xml_parser.setValidateAgainstSchema( PHYLOXML_LOCAL_XSD );
             }
@@ -1910,7 +1910,7 @@ public final class Test {
                 // Do nothing -- means were not running from jar.
             }
             if ( xml_parser == null ) {
-                xml_parser = new PhyloXmlParser();
+                xml_parser = PhyloXmlParser.createPhyloXmlParser();
                 if ( USE_LOCAL_PHYLOXML_SCHEMA ) {
                     xml_parser.setValidateAgainstSchema( PHYLOXML_LOCAL_XSD );
                 }
@@ -5103,7 +5103,10 @@ public final class Test {
             if ( parser2.getDomainsIgnoredDueToDuf() != 0 ) {
                 return false;
             }
-            if ( parser2.getDomainsIgnoredDueToEval() != 0 ) {
+            if ( parser2.getDomainsIgnoredDueToFsEval() != 0 ) {
+                return false;
+            }
+            if ( parser2.getDomainsIgnoredDueToIEval() != 0 ) {
                 return false;
             }
             final Protein p1 = proteins.get( 0 );
@@ -5143,12 +5146,6 @@ public final class Test {
             if ( !Test.isEqual( p4.getProteinDomain( 0 ).getPerDomainScore(), 135.7 ) ) {
                 return false;
             }
-            if ( !Test.isEqual( p4.getProteinDomain( 0 ).getPerSequenceEvalue(), 8.3e-40 ) ) {
-                return false;
-            }
-            if ( !Test.isEqual( p4.getProteinDomain( 0 ).getPerSequenceScore(), 136.3 ) ) {
-                return false;
-            }
             if ( !Test.isEqual( p4.getProteinDomain( 0 ).getNumber(), 1 ) ) {
                 return false;
             }
@@ -8540,7 +8537,7 @@ public final class Test {
                 // Do nothing -- means were not running from jar.
             }
             if ( xml_parser == null ) {
-                xml_parser = new PhyloXmlParser();
+                xml_parser = PhyloXmlParser.createPhyloXmlParser();
                 if ( USE_LOCAL_PHYLOXML_SCHEMA ) {
                     xml_parser.setValidateAgainstSchema( PHYLOXML_LOCAL_XSD );
                 }