public void testWriteAssayProperties() throws AtlasLoaderException { // create investigation MAGETABInvestigation investigation = new MAGETABInvestigation(); investigation.IDF.experimentalFactorType.add("Type"); investigation.IDF.experimentalFactorName.add("Type"); Assay assay = new Assay("TEST-ASSAY"); AssayNode assayNode = new AssayNode(); FactorValueAttribute fva = new FactorValueAttribute(); fva.type = "Type"; fva.setAttributeValue("specific factor value"); assayNode.factorValues.add(fva); final LoaderDAO dao = MockFactory.createLoaderDAO(); AssayAndHybridizationStep.writeAssayProperties(investigation, assay, assayNode, dao); // now get properties of assay - we should have one matching our factor value assertSame("Wrong number of properties", assay.getProperties().size(), 1); for (AssayProperty p : assay.getProperties()) { assertEquals("Wrong property name", p.getName(), "type"); assertEquals("Wrong property value", p.getValue(), "specific factor value"); } }
public void testWriteSampleProperties() throws AtlasLoaderException { // create investigation MAGETABInvestigation investigation = new MAGETABInvestigation(); Sample sample = new Sample("TEST-SAMPLE"); SourceNode sourceNode = new SourceNode(); CharacteristicsAttribute fva = new CharacteristicsAttribute(); fva.type = "Type"; fva.setAttributeValue("specific factor value"); sourceNode.characteristics.add(fva); new SourceStep().readSampleProperties(sample, sourceNode, MockFactory.createLoaderDAO()); // now get properties of assay - we should have one matching our factor value assertSame("Wrong number of properties", sample.getProperties().size(), 1); for (SampleProperty p : sample.getProperties()) { assertEquals("Wrong property name", p.getName(), "type"); assertEquals("Wrong property value", p.getValue(), "specific factor value"); } }