Skip to content

Commit

Permalink
fixes 1217: Fix Pre Relase Tests (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
conker84 authored and jexp committed May 29, 2019
1 parent 0ee0e84 commit 08c476c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 21 deletions.
3 changes: 2 additions & 1 deletion src/test/java/apoc/bolt/BoltTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.List;
import java.util.Map;

import static apoc.util.TestContainerUtil.cleanBuild;
import static apoc.util.TestUtil.isTravis;
import static org.junit.Assert.*;
import static org.junit.Assume.assumeFalse;
Expand Down Expand Up @@ -60,7 +61,7 @@ public static void tearDown() {
neo4jContainer.close();
db.shutdown();
}
// cleanBuild();
cleanBuild();
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/apoc/custom/CypherProceduresClusterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CypherProceduresClusterTest {
@BeforeClass
public static void setupCluster() {
assumeFalse(isTravis());
executeGradleTasks("shadow");
executeGradleTasks("clean", "shadow");
TestUtil.ignoreException(() -> cluster = TestContainerUtil
.createEnterpriseCluster(3, 1, Util.map("apoc.custom.procedures.refresh", 100)),
Exception.class);
Expand All @@ -36,7 +36,7 @@ public static void bringDownCluster() {
if (cluster != null) {
cluster.close();
}
// cleanBuild();
cleanBuild();
}

@Test
Expand Down
24 changes: 14 additions & 10 deletions src/test/java/apoc/date/DateTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
package apoc.date;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.QueryExecutionException;
import org.neo4j.graphdb.Transaction;
import org.neo4j.helpers.collection.Iterators;
import org.neo4j.test.TestGraphDatabaseFactory;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
Expand All @@ -12,15 +25,6 @@
import java.util.Map;
import java.util.TimeZone;
import java.util.stream.Stream;
import apoc.util.TestUtil;
import org.junit.*;
import org.junit.rules.ExpectedException;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.QueryExecutionException;
import org.neo4j.graphdb.Transaction;
import org.neo4j.helpers.collection.Iterators;
import org.neo4j.test.TestGraphDatabaseFactory;

import static apoc.util.MapUtil.map;
import static apoc.util.TestUtil.testCall;
Expand Down Expand Up @@ -407,7 +411,7 @@ public void testConvertFormats() throws Exception {
String isoDateTime = "2019-05-14T14:52:06-04:00";
Map<String, Object> params = new HashMap<>();
params.put("rfcDateTime", rfcDateTime);
testCall(db, "RETURN apoc.date.convertFormats($rfcDateTime, 'rfc_1123_date_time', 'iso_date_time') as convertedTime", params, row -> assertEquals(isoDateTime, row.get("convertedTime")));
testCall(db, "RETURN apoc.date.convertFormat($rfcDateTime, 'rfc_1123_date_time', 'iso_date_time') as convertedTime", params, row -> assertEquals(isoDateTime, row.get("convertedTime")));
}

private SimpleDateFormat formatInUtcZone(final String pattern) {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/apoc/export/csv/ExportCsvIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ExportCsvIT {
public static void beforeAll() {
assumeFalse(isTravis());
TestUtil.ignoreException(() -> {
executeGradleTasks("shadow");
executeGradleTasks("clean", "shadow");
neo4jContainer = createEnterpriseDB(true);
neo4jContainer.start();
}, Exception.class);
Expand All @@ -43,7 +43,7 @@ public static void afterAll() {
if (neo4jContainer != null) {
neo4jContainer.close();
}
// cleanBuild();
cleanBuild();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void beforeAll() {
assumeFalse(isTravis());
TestUtil.ignoreException(() -> {
// We build the project, the artifact will be placed into ./build/libs
executeGradleTasks("shadow");
executeGradleTasks("clean", "shadow");
neo4jContainer = createEnterpriseDB(!TestUtil.isTravis())
.withInitScript("init_neo4j_export_csv.cypher");
neo4jContainer.start();
Expand All @@ -46,7 +46,7 @@ public static void afterAll() {
if (neo4jContainer != null) {
neo4jContainer.close();
}
// cleanBuild();
cleanBuild();
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/apoc/metrics/MetricsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class MetricsTest {
public static void beforeAll() {
assumeFalse(isTravis());
TestUtil.ignoreException(() -> {
executeGradleTasks("shadow");
executeGradleTasks("clean", "shadow");
neo4jContainer = createEnterpriseDB(true)
.withNeo4jConfig("apoc.import.file.enabled", "true");
neo4jContainer.start();
Expand All @@ -47,7 +47,7 @@ public static void afterAll() {
if (neo4jContainer != null) {
neo4jContainer.close();
}
// cleanBuild();
cleanBuild();
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/apoc/schema/SchemasEnterpriseFeaturesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class SchemasEnterpriseFeaturesTest {
@BeforeClass
public static void beforeAll() {
assumeFalse(isTravis());
executeGradleTasks("shadow");
executeGradleTasks("clean", "shadow");
TestUtil.ignoreException(() -> {
// We build the project, the artifact will be placed into ./build/libs
neo4jContainer = createEnterpriseDB(!TestUtil.isTravis());
Expand All @@ -47,7 +47,7 @@ public static void afterAll() {
session.close();
neo4jContainer.close();
}
// cleanBuild();
cleanBuild();
}

@Test
Expand Down

0 comments on commit 08c476c

Please sign in to comment.