@Test public void testBulkInsert() { ReturnValue ret = attributeAnnotator.init(); Assert.assertTrue("attributeAnnotator could not init", ret.getExitStatus() == ReturnValue.SUCCESS); String path = AttributeAnnotatorTest.class.getResource("attributeAnnotator.csv").getPath(); when(options.has("file")).thenReturn(true); when(options.valueOf("file")).thenReturn(path); ret = attributeAnnotator.do_run(); Assert.assertTrue("attributeAnnotator did not complete successfully", ret.getExitStatus() == ReturnValue.SUCCESS); verify(metadata).annotateSequencerRun(anyInt(), isA(Set.class)); verify(metadata).annotateLane(anyInt(), isA(Set.class)); verify(metadata).annotateIUS(anyInt(), isA(Set.class)); verify(metadata).annotateExperiment(anyInt(), isA(Set.class)); verify(metadata).annotateProcessing(anyInt(), isA(Set.class)); verify(metadata).annotateSample(anyInt(), isA(Set.class)); verify(metadata).annotateStudy(anyInt(), isA(Set.class)); verify(metadata).annotateWorkflow(anyInt(), isA(Set.class)); verify(metadata).annotateWorkflowRun(anyInt(), isA(Set.class)); verifyNoMoreInteractions(metadata); }
private void bulkInsert() { Map<String, Map<String, Map<String, String>>> bulkMap = new HashMap<>(); if (this.parseFile(bulkMap)) { for (Map.Entry<String, Map<String, Map<String, String>>> entry : bulkMap.entrySet()) { if (entry.getKey().equals("w") || entry.getKey().equals("workflow-accesion")) { this.bulkInsertWorkflow(entry.getValue()); } if (entry.getKey().equals("wr") || entry.getKey().equals("workflow-run-accession")) { this.bulkInsertWorkflowRun(entry.getValue()); } if (entry.getKey().equals("sr") || entry.getKey().equals("sequencer-run-accession")) { this.bulkInsertSequencerRun(entry.getValue()); } if (entry.getKey().equals("l") || entry.getKey().equals("lane-accession")) { this.bulkInsertLane(entry.getValue()); } if (entry.getKey().equals("i") || entry.getKey().equals("ius-accession")) { this.bulkInsertIUS(entry.getValue()); } if (entry.getKey().equals("e") || entry.getKey().equals("experiment-accession")) { this.bulkInsertExperiment(entry.getValue()); } if (entry.getKey().equals("st") || entry.getKey().equals("study-accession")) { this.bulkInsertStudy(entry.getValue()); } if (entry.getKey().equals("p") || entry.getKey().equals("processing-accession")) { this.bulkInsertProcessing(entry.getValue()); } if (entry.getKey().equals("s") || entry.getKey().equals("sample-accession")) { this.bulkInsertSample(entry.getValue()); } } } }
AttributeAnnotator extends Plugin { private void bulkInsert() { Map<String, Map<String, Map<String, String>>> bulkMap = new HashMap<>(); if (this.parseFile(bulkMap)) { for (Map.Entry<String, Map<String, Map<String, String>>> entry : bulkMap.entrySet()) { if (entry.getKey().equals("w") || entry.getKey().equals("workflow-accesion")) { this.bulkInsertWorkflow(entry.getValue()); } if (entry.getKey().equals("wr") || entry.getKey().equals("workflow-run-accession")) { this.bulkInsertWorkflowRun(entry.getValue()); } if (entry.getKey().equals("sr") || entry.getKey().equals("sequencer-run-accession")) { this.bulkInsertSequencerRun(entry.getValue()); } if (entry.getKey().equals("l") || entry.getKey().equals("lane-accession")) { this.bulkInsertLane(entry.getValue()); } if (entry.getKey().equals("i") || entry.getKey().equals("ius-accession")) { this.bulkInsertIUS(entry.getValue()); } if (entry.getKey().equals("e") || entry.getKey().equals("experiment-accession")) { this.bulkInsertExperiment(entry.getValue()); } if (entry.getKey().equals("st") || entry.getKey().equals("study-accession")) { this.bulkInsertStudy(entry.getValue()); } if (entry.getKey().equals("p") || entry.getKey().equals("processing-accession")) { this.bulkInsertProcessing(entry.getValue()); } if (entry.getKey().equals("s") || entry.getKey().equals("sample-accession")) { this.bulkInsertSample(entry.getValue()); } } } } }
AttributeAnnotator extends Plugin { private void bulkInsert() { Map<String, Map<String, Map<String, String>>> bulkMap = new HashMap<>(); if (this.parseFile(bulkMap)) { for (Map.Entry<String, Map<String, Map<String, String>>> entry : bulkMap.entrySet()) { if (entry.getKey().equals("w") || entry.getKey().equals("workflow-accesion")) { this.bulkInsertWorkflow(entry.getValue()); } if (entry.getKey().equals("wr") || entry.getKey().equals("workflow-run-accession")) { this.bulkInsertWorkflowRun(entry.getValue()); } if (entry.getKey().equals("sr") || entry.getKey().equals("sequencer-run-accession")) { this.bulkInsertSequencerRun(entry.getValue()); } if (entry.getKey().equals("l") || entry.getKey().equals("lane-accession")) { this.bulkInsertLane(entry.getValue()); } if (entry.getKey().equals("i") || entry.getKey().equals("ius-accession")) { this.bulkInsertIUS(entry.getValue()); } if (entry.getKey().equals("e") || entry.getKey().equals("experiment-accession")) { this.bulkInsertExperiment(entry.getValue()); } if (entry.getKey().equals("st") || entry.getKey().equals("study-accession")) { this.bulkInsertStudy(entry.getValue()); } if (entry.getKey().equals("p") || entry.getKey().equals("processing-accession")) { this.bulkInsertProcessing(entry.getValue()); } if (entry.getKey().equals("s") || entry.getKey().equals("sample-accession")) { this.bulkInsertSample(entry.getValue()); } } } } AttributeAnnotator(); }
AttributeAnnotator extends Plugin { private void bulkInsert() { Map<String, Map<String, Map<String, String>>> bulkMap = new HashMap<>(); if (this.parseFile(bulkMap)) { for (Map.Entry<String, Map<String, Map<String, String>>> entry : bulkMap.entrySet()) { if (entry.getKey().equals("w") || entry.getKey().equals("workflow-accesion")) { this.bulkInsertWorkflow(entry.getValue()); } if (entry.getKey().equals("wr") || entry.getKey().equals("workflow-run-accession")) { this.bulkInsertWorkflowRun(entry.getValue()); } if (entry.getKey().equals("sr") || entry.getKey().equals("sequencer-run-accession")) { this.bulkInsertSequencerRun(entry.getValue()); } if (entry.getKey().equals("l") || entry.getKey().equals("lane-accession")) { this.bulkInsertLane(entry.getValue()); } if (entry.getKey().equals("i") || entry.getKey().equals("ius-accession")) { this.bulkInsertIUS(entry.getValue()); } if (entry.getKey().equals("e") || entry.getKey().equals("experiment-accession")) { this.bulkInsertExperiment(entry.getValue()); } if (entry.getKey().equals("st") || entry.getKey().equals("study-accession")) { this.bulkInsertStudy(entry.getValue()); } if (entry.getKey().equals("p") || entry.getKey().equals("processing-accession")) { this.bulkInsertProcessing(entry.getValue()); } if (entry.getKey().equals("s") || entry.getKey().equals("sample-accession")) { this.bulkInsertSample(entry.getValue()); } } } } AttributeAnnotator(); @Override ReturnValue init(); @Override ReturnValue do_test(); @Override ReturnValue do_run(); @Override ReturnValue clean_up(); @Override String get_description(); }
AttributeAnnotator extends Plugin { private void bulkInsert() { Map<String, Map<String, Map<String, String>>> bulkMap = new HashMap<>(); if (this.parseFile(bulkMap)) { for (Map.Entry<String, Map<String, Map<String, String>>> entry : bulkMap.entrySet()) { if (entry.getKey().equals("w") || entry.getKey().equals("workflow-accesion")) { this.bulkInsertWorkflow(entry.getValue()); } if (entry.getKey().equals("wr") || entry.getKey().equals("workflow-run-accession")) { this.bulkInsertWorkflowRun(entry.getValue()); } if (entry.getKey().equals("sr") || entry.getKey().equals("sequencer-run-accession")) { this.bulkInsertSequencerRun(entry.getValue()); } if (entry.getKey().equals("l") || entry.getKey().equals("lane-accession")) { this.bulkInsertLane(entry.getValue()); } if (entry.getKey().equals("i") || entry.getKey().equals("ius-accession")) { this.bulkInsertIUS(entry.getValue()); } if (entry.getKey().equals("e") || entry.getKey().equals("experiment-accession")) { this.bulkInsertExperiment(entry.getValue()); } if (entry.getKey().equals("st") || entry.getKey().equals("study-accession")) { this.bulkInsertStudy(entry.getValue()); } if (entry.getKey().equals("p") || entry.getKey().equals("processing-accession")) { this.bulkInsertProcessing(entry.getValue()); } if (entry.getKey().equals("s") || entry.getKey().equals("sample-accession")) { this.bulkInsertSample(entry.getValue()); } } } } AttributeAnnotator(); @Override ReturnValue init(); @Override ReturnValue do_test(); @Override ReturnValue do_run(); @Override ReturnValue clean_up(); @Override String get_description();  }