ExperimentConfiguration { public ExperimentType getExperimentType() { Element configuration = xmlReader.getDocument().getDocumentElement(); String type = configuration.getAttribute(EXPERIMENT_TYPE); if (StringUtils.isEmpty(type)) { throw new IllegalArgumentException(String.format("Missing %s attribute on root element", EXPERIMENT_TYPE)); } ExperimentType experimentType = ExperimentType.get(type); if (experimentType == null) { throw new IllegalArgumentException( String.format( "Unknown %s attribute: \"%s\". Must be one of: [%s]", EXPERIMENT_TYPE, type, Joiner.on(", ").join(EnumSet.allOf(ExperimentType.class)))); } return experimentType; } ExperimentConfiguration(XmlReader xmlReader); List<Pair<Contrast, Boolean>> getContrastAndAnnotationPairs(); List<Contrast> getContrasts(); List<AssayGroup> getAssayGroups(); ExperimentType getExperimentType();  }
@Test public void testGetExperimentType() { assertThat( testConfiguration(MICROARRAY_CONFIGURATION_XML).getExperimentType(), is(ExperimentType.MICROARRAY_1COLOUR_MRNA_DIFFERENTIAL)); assertThat(testConfiguration( "<configuration experimentType=\"rnaseq_mrna_baseline\"></configuration>").getExperimentType(), is(ExperimentType.RNASEQ_MRNA_BASELINE)); }