"Type of the sequence (PROTEIN or DNA)");\r
// TODO publish help on a compbio web site\r
\r
- p1.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p1.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
p1.addPossibleValues("PROTEIN", "DNA");\r
p1.setOptionName("-TYPE");\r
p1.setRequired(false);\r
"Protein weight matrix");\r
// TODO publish help on a compbio web site\r
\r
- p2.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p2.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\r
p2.addOptionNames("-jtree");\r
p2.addOptionNames("-jfasta");\r
Parameter<Mafft> p3 = new Parameter<Mafft>("MATRIX2",\r
"Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\r
p3.addPossibleValues("BLOSUM", "PAM", "GONNET", "ID");\r
// This attribute is required by strict schema\r
@Test()\r
public void testUnMarshalling() {\r
try {\r
- File input = new File(this.test_input);\r
- assertTrue(input.exists());\r
- JAXBContext ctx = JAXBContext.newInstance(RunnerConfig.class);\r
- Unmarshaller um = ctx.createUnmarshaller();\r
- JAXBElement<RunnerConfig> rconfig = um.unmarshal(new StreamSource(\r
- input), RunnerConfig.class);\r
- RunnerConfig<Mafft> runner = rconfig.getValue();\r
- assertNotNull(runner);\r
- System.out.println(runner);\r
- assertFalse(runner.options.isEmpty());\r
- assertFalse(runner.parameters.isEmpty());\r
- assertEquals(7, runner.options.size());\r
- assertEquals(8, runner.parameters.size());\r
- Option<Mafft> stypeOption = runner.getArgument("Sequence type");\r
- System.out.println(stypeOption);\r
- assertNotNull(stypeOption);\r
- assertFalse(stypeOption.isRequired);\r
- assertEquals("--auto", stypeOption.defaultValue);\r
- assertEquals(2, stypeOption.optionNames.size());\r
-\r
- assertEquals(" ", runner.getPrmSeparator());\r
- Option<Mafft> guidetrOption = runner\r
- .getArgument("Guide tree rebuild");\r
- Parameter<Mafft> guidetr = (Parameter<Mafft>) guidetrOption;\r
- ValueConstrain constraint = guidetr.getValidValue();\r
- assertEquals("Integer", constraint.type.toString());\r
- assertEquals(1, constraint.getMin());\r
- assertEquals(100, constraint.getMax());\r
-\r
- RunnerConfigMarshaller<Mafft> rmarsh = new RunnerConfigMarshaller<Mafft>(\r
- RunnerConfig.class);\r
- // Now see if we can write a valid document back discard the actual\r
- // output only validation is important here\r
- rmarsh.write(rconfig,\r
- new FileOutputStream(new File(reWrittenInput)));\r
-\r
- RunnerConfig<Mafft> rc = rmarsh.readAndValidate(\r
- new FileInputStream(new File(reWrittenInput)),\r
- RunnerConfig.class);\r
- assertEquals(runner, rc);\r
+ File input = new File(this.test_input);\r
+ assertTrue(input.exists());\r
+ JAXBContext ctx = JAXBContext.newInstance(RunnerConfig.class);\r
+ Unmarshaller um = ctx.createUnmarshaller();\r
+ JAXBElement<RunnerConfig> rconfig = um.unmarshal(new StreamSource(input), RunnerConfig.class);\r
+ RunnerConfig<Mafft> runner = rconfig.getValue();\r
+ assertNotNull(runner);\r
+ System.out.println(runner);\r
+ assertFalse(runner.options.isEmpty());\r
+ assertFalse(runner.parameters.isEmpty());\r
+ assertEquals(7, runner.options.size());\r
+ assertEquals(8, runner.parameters.size());\r
+ Option<Mafft> stypeOption = runner.getArgument("Sequence type");\r
+ System.out.println(stypeOption);\r
+ assertNotNull(stypeOption);\r
+ assertFalse(stypeOption.isRequired);\r
+ assertEquals("--auto", stypeOption.defaultValue);\r
+ assertEquals(2, stypeOption.optionNames.size());\r
+\r
+ assertEquals(" ", runner.getPrmSeparator());\r
+ Option<Mafft> guidetrOption = runner.getArgument("Guide tree rebuild");\r
+ Parameter<Mafft> guidetr = (Parameter<Mafft>) guidetrOption;\r
+ ValueConstrain constraint = guidetr.getValidValue();\r
+ assertEquals("Integer", constraint.type.toString());\r
+ assertEquals(1, constraint.getMin());\r
+ assertEquals(100, constraint.getMax());\r
+\r
+ RunnerConfigMarshaller<Mafft> rmarsh = new RunnerConfigMarshaller<Mafft>(RunnerConfig.class);\r
+ // Now see if we can write a valid document back discard the actual\r
+ // output only validation is important here\r
+ rmarsh.write(rconfig, new FileOutputStream(new File(reWrittenInput)));\r
+ RunnerConfig<Mafft> rc = rmarsh.readAndValidate(new FileInputStream(new File(reWrittenInput)), RunnerConfig.class);\r
+ assertEquals(runner, rc);\r
\r
} catch (JAXBException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
} catch (IOException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
} catch (SAXException e) {\r
- e.printStackTrace();\r
- fail(e.getLocalizedMessage());\r
+ e.printStackTrace();\r
+ fail(e.getLocalizedMessage());\r
}\r
}\r
}\r
@Test(expectedExceptions = WrongParameterException.class)\r
public void testCreateParameter() throws WrongParameterException {\r
try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1",\r
- "Protein weight matrix");\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\r
p3.addPossibleValues("BLOSUM", "PAM", "GONNET", "ID");\r
// This attribute is required by strict schema\r
@Test()\r
public void testParameterToCommand() throws WrongParameterException {\r
try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1",\r
- "Protein weight matrix");\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\r
p3.addPossibleValues("BLOSUM", "PAM", "GONNET", "ID");\r
// This attribute is required by strict schema\r
com = p3.toCommand("=");\r
assertFalse(com.endsWith("PAM"));\r
assertFalse(com.contains("PAM"));\r
-\r
} catch (MalformedURLException e) {\r
e.printStackTrace();\r
fail(e.getMessage());\r
@Test(expectedExceptions = ValidationException.class)\r
public void testOptionNoDefaultValidate() throws ValidationException {\r
try {\r
- Option<Mafft> p3 = new Option<Mafft>("Matrix1",\r
- "Protein weight matrix");\r
+ Option<Mafft> p3 = new Option<Mafft>("Matrix1", "Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\r
- p3.setOptionNames(new HashSet(Arrays.asList("--AAMATRIX",\r
- "--ABMAT", "--BBBB")));\r
+ p3.setOptionNames(new HashSet(Arrays.asList("--AAMATRIX", "--ABMAT", "--BBBB")));\r
p3.setRequired(true);\r
// THIS LINE IS CAUSING EXCEPTION AS DEFAULT VALUE MUST BE DEFINED\r
// IN WITHIN POSSIBLE VALUES\r
p3.validate();\r
-\r
} catch (MalformedURLException e) {\r
e.printStackTrace();\r
fail(e.getMessage());\r
@Test(expectedExceptions = WrongParameterException.class)\r
public void testOptionSetInvalidValue() throws WrongParameterException {\r
try {\r
- Option<Mafft> p3 = new Option<Mafft>("Matrix1",\r
- "Protein weight matrix");\r
+ Option<Mafft> p3 = new Option<Mafft>("Matrix1", "Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\r
- p3.setOptionNames(new HashSet(Arrays.asList("--AAMATRIX",\r
- "--ABMAT", "--BBBB")));\r
+ p3.setOptionNames(new HashSet(Arrays.asList("--AAMATRIX", "--ABMAT", "--BBBB")));\r
p3.setRequired(true);\r
// THIS LINE IS CAUSING EXCEPTION AS DEFAULT VALUE MUST BE DEFINED\r
// IN WITHIN POSSIBLE VALUES\r
p3.setDefaultValue("AAA");\r
-\r
} catch (MalformedURLException e) {\r
e.printStackTrace();\r
fail(e.getMessage());\r
@Test()\r
public void testOptionToCommand() {\r
try {\r
- Option<Mafft> p3 = new Option<Mafft>("Matrix1",\r
- "Protein weight matrix");\r
+ Option<Mafft> p3 = new Option<Mafft>("Matrix1", "Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\r
- p3.setOptionNames(new HashSet(Arrays.asList("--AAMATRIX",\r
- "--ABMAT", "--BBBB")));\r
+ p3.setOptionNames(new HashSet(Arrays.asList("--AAMATRIX", "--ABMAT", "--BBBB")));\r
p3.setRequired(true);\r
// THIS LINE IS CAUSING EXCEPTION AS DEFAULT VALUE MUST BE DEFINED\r
// IN WITHIN POSSIBLE VALUES\r
}\r
\r
@Test(expectedExceptions = IllegalStateException.class)\r
- public void testCreateNumParameterWithoutValidValue() {\r
+ public void testCreateNumParameterWithoutValidValue() throws MalformedURLException {\r
try {\r
- Parameter<Mafft> p4 = new Parameter<Mafft>("Matrix",\r
- "DNA weight matrix");\r
+ Parameter<Mafft> p4 = new Parameter<Mafft>("Matrix", "DNA weight matrix");\r
// This is causing exception is ValidValue constrain is not defined\r
// for\r
// numeric value\r
}\r
\r
@Test()\r
- public void testCreateParameterWithValidValueConstrain() {\r
-\r
- Parameter<Mafft> p4 = new Parameter<Mafft>("Matrix",\r
- "DNA weight matrix");\r
+ public void testCreateParameterWithValidValueConstrain() throws MalformedURLException {\r
+ Parameter<Mafft> p4 = new Parameter<Mafft>("Matrix", "DNA weight matrix");\r
ValueConstrain vc = new ValueConstrain();\r
vc.setType(ValueConstrain.Type.Float);\r
vc.setMin("0");\r
public void testValidateLowerBoundaryConstrainCheck()\r
throws WrongParameterException {\r
try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1",\r
- "Protein weight matrix");\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
// This attribute is required by strict schema\r
p3.setOptionName("--AAMATRIX");\r
p3.setRequired(true);\r
p3.setValidValue(vc);\r
// THIS IS CAUSING EXCEPTION\r
p3.setDefaultValue("-11.0");\r
-\r
} catch (MalformedURLException e) {\r
e.printStackTrace();\r
fail(e.getMessage());\r
public void testValidateUpperBoundaryConstrainCheck()\r
throws WrongParameterException {\r
try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1",\r
- "Protein weight matrix");\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
// This attribute is required by strict schema\r
p3.setOptionName("--AAMATRIX");\r
p3.setRequired(true);\r
p3.setValidValue(vc);\r
// THIS IS CAUSING EXCEPTION\r
p3.setDefaultValue("1");\r
-\r
} catch (MalformedURLException e) {\r
e.printStackTrace();\r
fail(e.getMessage());\r
@Test()\r
public void testValidateBoundaryConstrainCheck() {\r
try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1",\r
- "Protein weight matrix");\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
// TODO publish help on a compbio web site\r
- p3.setFurtherDetails(new URL("http",\r
- "www.compbio.dundee.ac.uk/users/pvtroshin/ws/",\r
- "Index.html"));\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
// This attribute is required by strict schema\r
p3.setOptionName("--AAMATRIX");\r
p3.setRequired(true);\r