Implement maven deploy

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

View File

@ -1,7 +1,8 @@
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'com.bmuschko.nexus'
group = 'eva2'
group = 'de.openea'
version = '2.2.0'
description = """EvA2"""
@ -25,9 +26,62 @@ task fatJar(type: Jar) {
repositories {
mavenCentral()
}
dependencies {
compile group: 'javax.help', name: 'javahelp', version: '2.0.05'
compile group: 'org.yaml', name: 'snakeyaml', version: '1.16'
compile group: 'gov.nist.math', name: 'jama', version: '1.0.3'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.+'
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
modifyPom {
project {
name 'EvA2'
description 'Gradle plugin that provides tasks for configuring and uploading artifacts to Sonatype Nexus.'
url 'http://www.ra.cs.uni-tuebingen.de/software/eva2/'
inceptionYear '2008'
scm {
url 'https://gitlab.cs.uni-tuebingen.de/eva2/eva2/'
connection 'scm:https://gitlab.cs.uni-tuebingen.de/eva2/eva2/.git'
developerConnection 'scm:https://gitlab.cs.uni-tuebingen.de/eva2/eva2/.git'
}
licenses {
license {
name 'GNU Lesser General Public License, Version 3.0'
url 'http://www.gnu.org/licenses/lgpl-3.0.html'
distribution 'repo'
}
}
developers {
developer {
id 'halfdan'
name 'Fabian Becker'
email 'halfdan@xnorfz.de'
}
}
}
}
extraArchive {
sources = true
tests = true
javadoc = true
}
nexus {
repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
}

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 {
}
}