[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Thu Mar 13 22:58:11 UTC 2008
gordonp
Thu Mar 13 18:58:10 EDT 2008
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test
In directory dev.open-bio.org:/tmp/cvs-serv31223/src/main/org/biomoby/service/test
Modified Files:
MobyServletTestCase.java
Log Message:
Better servlet initialization
moby-live/Java/src/main/org/biomoby/service/test MobyServletTestCase.java,1.8,1.9
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/MobyServletTestCase.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/MobyServletTestCase.java 2007/12/14 16:26:00 1.8
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/service/test/MobyServletTestCase.java 2008/03/13 22:58:10 1.9
@@ -224,6 +224,15 @@
}
resultContents.clear(); // so we don't build up junk from multiple responses
+ // Sets up hashtables, etc. we'll use implicitly below for error checking
+ try{
+ fasta_na2dna.init(getMobyServlet().getServletConfig());
+ } catch(Exception e){
+ e.printStackTrace();
+ fail("Exception while configuring FromFastaToDNASequence servlet for testing: " + e);
+ }
+
+ System.err.println("Don't worry, an exception warning about INPUT_INCORRECT_SIMPLE should appear next...it's expected");
// Call second service on output of previous service, the input is actually AA, not DNA as expected
try{
fasta_na2dna.processRequests(MobyDataUtils.fromXMLDocument(new java.io.ByteArrayInputStream(outBuffer.getBuffer().toString().getBytes())),
@@ -295,6 +304,7 @@
testRequest.setInputStream(testDataURL.openStream());
MobyServlet servlet = getMobyServlet();
+ servlet.createServiceFromConfig(null); // initialized required settings
MobyContentInstance mobyContents = servlet.getMobyContents(testRequest);
assertNotNull("Could not retrieve the MOBY data payload from the test HTTP request", mobyContents);
}
@@ -310,7 +320,8 @@
* @return a test suite for all the test methods of this test case.
*/
public static Test suite() {
-
+ System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
+ "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
TestSuite suite = new TestSuite();
suite.addTest(new MobyServletTestCase("testRDF"));
suite.addTest(new MobyServletTestCase("testSoapParsing"));
More information about the MOBY-guts
mailing list