LoadGeneratorSource implements MigrationSource { @Override public MigrationData getMigrationData() { if (migrationData == null) { MigrationData data = new MigrationData(); data.setProjects(getProjects()); data.setSamples(getSamples()); data.setLibraries(getLibraries()); data.setLibraryAliquots(getLibraryAliquots()); data.setPools(getPools()); data.setRuns(getRuns()); migrationData = data; } return migrationData; } LoadGeneratorSource(MigrationProperties properties); List<Project> getProjects(); List<Sample> getSamples(); List<Library> getLibraries(); List<LibraryAliquot> getLibraryAliquots(); List<Pool> getPools(); Collection<Run> getRuns(); @Override MigrationData getMigrationData(); static final String SOURCE_PARAM; }
@Test public void testGetMigrationData() { MigrationData data = sut.getMigrationData(); assertNotNull(data.getProjects()); assertEquals(5, data.getProjects().size()); assertNotNull(data.getSamples()); assertEquals(100, data.getSamples().size()); assertNotNull(data.getLibraries()); assertEquals(100, data.getLibraries().size()); assertNotNull(data.getLibraryAliquots()); assertEquals(100, data.getLibraryAliquots().size()); assertNotNull(data.getPools()); assertEquals(100, data.getPools().size()); Pool p = data.getPools().iterator().next(); assertNotNull(p.getPoolContents()); assertEquals(5, p.getPoolContents().size()); assertNotNull(data.getRuns()); assertEquals(100, data.getRuns().size()); Run r = data.getRuns().iterator().next(); assertNotNull(r.getSequencerPartitionContainers()); assertEquals(1, r.getSequencerPartitionContainers().size()); SequencerPartitionContainer spc = r.getSequencerPartitionContainers().get(0); assertNotNull(spc.getPartitions()); assertEquals(8, spc.getPartitions().size()); }