Search in sources :

Example 1 with GalaxyNodeConfigurationReader

use of com.genericworkflownodes.knime.config.impl.GalaxyNodeConfigurationReader in project GenericKnimeNodes by genericworkflownodes.

the class GalaxyNodeConfigurationReaderTest method testReader.

@Test
public void testReader() throws Exception {
    INodeConfiguration config = null;
    GalaxyNodeConfigurationReader reader = new GalaxyNodeConfigurationReader();
    config = reader.read(TestDataSource.class.getResourceAsStream("emboss_water.xml"));
    assertEquals("Smith-Waterman local alignment", config.getDescription());
    assertEquals("water", config.getName());
    assertEquals("5.0.0", config.getVersion());
    assertEquals("help text", config.getManual());
    assertEquals(2, config.getNumberOfInputPorts());
    assertEquals(1, config.getNumberOfOutputPorts());
    assertNotNull(config.getParameter("gapopen"));
    assertNotNull(config.getParameter("gapextend"));
    Parameter<?> p1 = config.getParameter("gapopen");
    Parameter<?> p2 = config.getParameter("gapextend");
    StringChoiceParameter p3 = (StringChoiceParameter) config.getParameter("menu");
    assertTrue(p1 instanceof StringParameter);
    assertTrue(p2 instanceof DoubleParameter);
    assertTrue(p3 instanceof StringChoiceParameter);
    assertEquals(p1.getValue(), "10.0");
    assertEquals(p2.getValue(), 0.5);
    assertEquals("1", p3.getValue());
    assertEquals("A", p3.getLabels().get(0));
    assertEquals("B", p3.getLabels().get(1));
    assertEquals("C", p3.getLabels().get(2));
}
Also used : StringParameter(com.genericworkflownodes.knime.parameter.StringParameter) DoubleParameter(com.genericworkflownodes.knime.parameter.DoubleParameter) GalaxyNodeConfigurationReader(com.genericworkflownodes.knime.config.impl.GalaxyNodeConfigurationReader) StringChoiceParameter(com.genericworkflownodes.knime.parameter.StringChoiceParameter) Test(org.junit.Test)

Aggregations

GalaxyNodeConfigurationReader (com.genericworkflownodes.knime.config.impl.GalaxyNodeConfigurationReader)1 DoubleParameter (com.genericworkflownodes.knime.parameter.DoubleParameter)1 StringChoiceParameter (com.genericworkflownodes.knime.parameter.StringChoiceParameter)1 StringParameter (com.genericworkflownodes.knime.parameter.StringParameter)1 Test (org.junit.Test)1