\r
public class RunnerConfigTester {\r
\r
- public static String test_input = AllTestSuit.TEST_DATA_PATH_ABSOLUTE\r
- + "MafftParameters.xml";\r
+ public static String test_input = AllTestSuit.TEST_DATA_PATH_ABSOLUTE + "MafftParameters.xml";\r
\r
RunnerConfig<Mafft> rconfig = null;\r
\r
rconfig.setRunnerClassName(Mafft.class.getName());\r
List<Option<Mafft>> prms = new ArrayList<Option<Mafft>>();\r
\r
- RunnerConfigMarshaller<Mafft> pmarshaller = new RunnerConfigMarshaller<Mafft>(\r
- RunnerConfig.class, Parameter.class, Option.class,\r
- ValueConstrain.class);\r
+ RunnerConfigMarshaller<Mafft> pmarshaller = new RunnerConfigMarshaller<Mafft>(RunnerConfig.class, Parameter.class,\r
+ Option.class, ValueConstrain.class);\r
} catch (JAXBException e) {\r
e.printStackTrace();\r
fail(e.getLocalizedMessage());\r
\r
@Test(expectedExceptions = WrongParameterException.class)\r
public void testCreateParameter() throws WrongParameterException {\r
- try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
- // TODO publish help on a compbio web site\r
- p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
+ // TODO publish help on a compbio web site\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
- p3.setOptionName("--AAMATRIX");\r
- p3.setRequired(true);\r
- // THIS LINE IS CAUSING EXCEPTION AS DEFAULT VALUE MUST BE DEFINED\r
- // IN WITHIN POSSIBLE VALUES\r
- p3.setDefaultValue("pam22");\r
- String com = p3.toCommand(" ");\r
- System.out.println("AAAAAAAAAAAAAA!" + com);\r
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- }\r
+ p3.addPossibleValues("BLOSUM", "PAM", "GONNET", "ID");\r
+ // This attribute is required by strict schema\r
+ p3.setOptionName("--AAMATRIX");\r
+ p3.setRequired(true);\r
+ // THIS LINE IS CAUSING EXCEPTION AS DEFAULT VALUE MUST BE DEFINED\r
+ // IN WITHIN POSSIBLE VALUES\r
+ p3.setDefaultValue("pam22");\r
+ String com = p3.toCommand(" ");\r
+ System.out.println("AAAAAAAAAAAAAA!" + com);\r
}\r
\r
@Test()\r
public void testParameterToCommand() throws WrongParameterException {\r
- try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
- // TODO publish help on a compbio web site\r
- p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
+ // TODO publish help on a compbio web site\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
- p3.setOptionName("--AAMATRIX");\r
- p3.setRequired(true);\r
- // THIS LINE IS CAUSING EXCEPTION AS DEFAULT VALUE MUST BE DEFINED\r
- // IN WITHIN POSSIBLE VALUES\r
- p3.setDefaultValue("PAM");\r
- String com = p3.toCommand("=");\r
- assertTrue(com.startsWith("--AAMATRIX"));\r
- assertTrue(com.endsWith("PAM"));\r
- assertTrue(com.contains("="));\r
- p3.setDefaultValue("ID");\r
- com = p3.toCommand("=");\r
- assertFalse(com.endsWith("PAM"));\r
- assertFalse(com.contains("PAM"));\r
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- }\r
+ p3.addPossibleValues("BLOSUM", "PAM", "GONNET", "ID");\r
+ // This attribute is required by strict schema\r
+ p3.setOptionName("--AAMATRIX");\r
+ p3.setRequired(true);\r
+ // THIS LINE IS CAUSING EXCEPTION AS DEFAULT VALUE MUST BE DEFINED\r
+ // IN WITHIN POSSIBLE VALUES\r
+ p3.setDefaultValue("PAM");\r
+ String com = p3.toCommand("=");\r
+ assertTrue(com.startsWith("--AAMATRIX"));\r
+ assertTrue(com.endsWith("PAM"));\r
+ assertTrue(com.contains("="));\r
+ p3.setDefaultValue("ID");\r
+ com = p3.toCommand("=");\r
+ assertFalse(com.endsWith("PAM"));\r
+ assertFalse(com.contains("PAM"));\r
}\r
\r
@Test(expectedExceptions = ValidationException.class)\r
public void testOptionNoDefaultValidate() throws ValidationException {\r
- try {\r
- Option<Mafft> p3 = new Option<Mafft>("Matrix1", "Protein weight matrix");\r
- // TODO publish help on a compbio web site\r
- p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
+ Option<Mafft> p3 = new Option<Mafft>("Matrix1", "Protein weight matrix");\r
+ // TODO publish help on a compbio web site\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\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
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- }\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
\r
@Test(expectedExceptions = WrongParameterException.class)\r
public void testOptionSetInvalidValue() throws WrongParameterException {\r
- try {\r
- Option<Mafft> p3 = new Option<Mafft>("Matrix1", "Protein weight matrix");\r
- // TODO publish help on a compbio web site\r
- p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
\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
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- }\r
+ Option<Mafft> p3 = new Option<Mafft>("Matrix1", "Protein weight matrix");\r
+ // TODO publish help on a compbio web site\r
+ p3.setFurtherDetails("http://www.compbio.dundee.ac.uk/users/pvtroshin/ws/Index.html");\r
+\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
\r
@Test()\r
p3.setDefaultValue("--ABMAT");\r
com = p3.toCommand("=");\r
assertEquals("--ABMAT", com);\r
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
} catch (ValidationException e) {\r
e.printStackTrace();\r
fail(e.getMessage());\r
}\r
\r
@Test(expectedExceptions = WrongParameterException.class)\r
- public void testValidateLowerBoundaryConstrainCheck()\r
- throws WrongParameterException {\r
- try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
- // TODO publish help on a compbio web site\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
+ public void testValidateLowerBoundaryConstrainCheck() throws WrongParameterException {\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
+ // TODO publish help on a compbio web site\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
\r
- ValueConstrain vc = new ValueConstrain();\r
- vc.setType(ValueConstrain.Type.Float);\r
- vc.setMin("-10.12");\r
- vc.setMax("0");\r
- p3.setValidValue(vc);\r
- // THIS IS CAUSING EXCEPTION\r
- p3.setDefaultValue("-11.0");\r
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- }\r
+ ValueConstrain vc = new ValueConstrain();\r
+ vc.setType(ValueConstrain.Type.Float);\r
+ vc.setMin("-10.12");\r
+ vc.setMax("0");\r
+ p3.setValidValue(vc);\r
+ // THIS IS CAUSING EXCEPTION\r
+ p3.setDefaultValue("-11.0");\r
}\r
\r
@Test(expectedExceptions = WrongParameterException.class)\r
- public void testValidateUpperBoundaryConstrainCheck()\r
- throws WrongParameterException {\r
- try {\r
- Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
- // TODO publish help on a compbio web site\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
+ public void testValidateUpperBoundaryConstrainCheck() throws WrongParameterException {\r
+ Parameter<Mafft> p3 = new Parameter<Mafft>("Matrix1", "Protein weight matrix");\r
+ // TODO publish help on a compbio web site\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
\r
- ValueConstrain vc = new ValueConstrain();\r
- vc.setType(ValueConstrain.Type.Float);\r
- vc.setMin("-10.12");\r
- vc.setMax("0");\r
- p3.setValidValue(vc);\r
- // THIS IS CAUSING EXCEPTION\r
- p3.setDefaultValue("1");\r
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
- }\r
+ ValueConstrain vc = new ValueConstrain();\r
+ vc.setType(ValueConstrain.Type.Float);\r
+ vc.setMin("-10.12");\r
+ vc.setMax("0");\r
+ p3.setValidValue(vc);\r
+ // THIS IS CAUSING EXCEPTION\r
+ p3.setDefaultValue("1");\r
}\r
\r
@Test()\r
// Max value boundary is not defined so 1 is valid\r
p3.setDefaultValue("1");\r
p3.validate();\r
- } catch (MalformedURLException e) {\r
- e.printStackTrace();\r
- fail(e.getMessage());\r
} catch (WrongParameterException e) {\r
e.printStackTrace();\r
fail(e.getMessage());\r