Implement maven deploy

- Add mockito dependency
This commit is contained in:
2015-12-22 15:11:38 +01:00
parent d7ee0defc8
commit 0da8ebafdc
2 changed files with 88 additions and 26 deletions

View File

@@ -1,9 +1,12 @@
package eva2.optimization.population;
import com.sun.org.apache.bcel.internal.generic.POP;
import eva2.optimization.individuals.ESIndividualDoubleData;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
public class PopulationTest {
Population emptyPopulation;
@@ -182,8 +185,13 @@ public class PopulationTest {
@Test
public void testIncrGeneration() throws Exception {
int currentGeneration = emptyPopulation.getGeneration();
InterfacePopulationChangedEventListener listener = mock(InterfacePopulationChangedEventListener.class);
emptyPopulation.addPopulationChangedEventListener(listener);
emptyPopulation.incrGeneration();
verify(listener).registerPopulationStateChanged(emptyPopulation, Population.NEXT_GENERATION_PERFORMED);
assertEquals(currentGeneration + 1, emptyPopulation.getGeneration());
}
@@ -204,11 +212,6 @@ public class PopulationTest {
}
@Test
public void testAddPopulation1() throws Exception {
}
@Test
public void testResetFitness() throws Exception {
@@ -219,11 +222,6 @@ public class PopulationTest {
}
@Test
public void testGetDominatingSet1() throws Exception {
}
@Test
public void testGetIndexOfBestIndividualPrefFeasible() throws Exception {
@@ -234,16 +232,6 @@ public class PopulationTest {
}
@Test
public void testGetIndexOfBestIndividualPrefFeasible1() throws Exception {
}
@Test
public void testGetIndexOfWorstIndividualNoConstr1() throws Exception {
}
@Test
public void testMoveNInds() throws Exception {
@@ -319,11 +307,6 @@ public class PopulationTest {
}
@Test
public void testGetCorrelations1() throws Exception {
}
@Test
public void testGetFitnessMeasures() throws Exception {
@@ -401,4 +384,29 @@ public class PopulationTest {
// Get all individuals with fitness <= 10.0 (first fitness dimension)
assertEquals(2, emptyPopulation.filterByFitness(10.0, 0).size());
}
@Test
public void testGetBestEAIndividual() throws Exception {
}
@Test
public void testGetBestNIndividuals() throws Exception {
}
@Test
public void testGetWorstNIndividuals() throws Exception {
}
@Test
public void testGetWorstEAIndividual() throws Exception {
}
@Test
public void testRemoveNIndividuals() throws Exception {
}
}