Exemplo n.º 1
0
 @Test
 // tests appending at the beginning of the empty populations
 public void testAppendPopulation4() {
   Population populationToAppend = new SimplePopulation();
   Population[] results = PopulationUtils.appendPopulation(null, populationToAppend, false);
   assertEquals(1, results.length);
   assertSame(populationToAppend, results[0]);
 }
Exemplo n.º 2
0
 @Test
 // tests appending at the beginning of the population
 public void testAppendPopulation2() {
   Population[] inputPopulations =
       new Population[] {new SimplePopulation(), new SimplePopulation(), new SimplePopulation()};
   Population populationToAppend = new SimplePopulation();
   Population[] results =
       PopulationUtils.appendPopulation(inputPopulations, populationToAppend, false);
   assertEquals(4, results.length);
   assertSame(populationToAppend, results[0]);
   assertSame(inputPopulations[0], results[1]);
   assertSame(inputPopulations[1], results[2]);
   assertSame(inputPopulations[2], results[3]);
 }
Exemplo n.º 3
0
 @Test
 // tests appending empty population at the beginning of the empty populations
 public void testAppendPopulation5() {
   Population[] results = PopulationUtils.appendPopulation(null, null, true);
   assertEquals(null, results);
 }