Skip to content

Commit

Permalink
[NOID] Cleans up resources after the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ncordon committed Aug 8, 2023
1 parent 289b6fc commit a98ff43
Show file tree
Hide file tree
Showing 161 changed files with 1,428 additions and 994 deletions.
6 changes: 6 additions & 0 deletions core-it/src/test/java/apoc/core/it/ExportCsvS3Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import apoc.graph.Graphs;
import apoc.util.TestUtil;
import apoc.util.s3.S3BaseTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
Expand Down Expand Up @@ -52,6 +53,11 @@ public static void setUp() throws Exception{
db.executeTransactionally("CREATE (f:Address1:Address {name:'Andrea', city: 'Milano', street:'Via Garibaldi, 7'})-[:NEXT_DELIVERY]->(a:Address {name: 'Bar Sport'}), (b:Address {street: 'via Benni'})");
}

@AfterClass
public static void teardown() {
db.shutdown();
}

private static final String EXPECTED_QUERY_NODES = String.format("\"u\"%n" +
"\"{\"\"id\"\":0,\"\"labels\"\":[\"\"User\"\",\"\"User1\"\"],\"\"properties\"\":{\"\"name\"\":\"\"foo\"\",\"\"male\"\":true,\"\"age\"\":42,\"\"kids\"\":[\"\"a\"\",\"\"b\"\",\"\"c\"\"]}}\"%n" +
"\"{\"\"id\"\":1,\"\"labels\"\":[\"\"User\"\"],\"\"properties\"\":{\"\"name\"\":\"\"bar\"\",\"\"age\"\":42}}\"%n" +
Expand Down
6 changes: 6 additions & 0 deletions core-it/src/test/java/apoc/core/it/ExportCypherS3Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import apoc.util.TestUtil;
import apoc.util.s3.S3BaseTest;
import apoc.util.s3.S3TestUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -51,6 +52,11 @@ public void setUp() {
ExportCypherTestUtils.setUp( db, testName);
}

@After
public void teardown() {
db.shutdown();
}

// -- Whole file test -- //
@Test
public void testExportAllCypherDefault() {
Expand Down
6 changes: 6 additions & 0 deletions core-it/src/test/java/apoc/core/it/ExportGraphMLS3Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import apoc.util.TestUtil;
import apoc.util.s3.S3BaseTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -55,6 +56,11 @@ public void setUp() throws Exception {
setUpGraphMl(db, testName);
}

@After
public void teardown() {
db.shutdown();
}

@Test
public void testExportAllGraphML() throws Exception {
String fileName = "all.graphml";
Expand Down
6 changes: 6 additions & 0 deletions core-it/src/test/java/apoc/core/it/ExportJsonS3Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import apoc.graph.Graphs;
import apoc.util.TestUtil;
import apoc.util.s3.S3BaseTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -51,6 +52,11 @@ public void setUp() throws Exception {
db.executeTransactionally("CREATE (f:User {name:'Adam',age:42,male:true,kids:['Sam','Anna','Grace'], born:localdatetime('2015185T19:32:24'), place:point({latitude: 13.1, longitude: 33.46789})})-[:KNOWS {since: 1993, bffSince: duration('P5M1.5D')}]->(b:User {name:'Jim',age:42}),(c:User {age:12})");
}

@After
public void teardown() {
db.shutdown();
}

@Test
public void testExportAllJson() throws Exception {
String filename = "all.json";
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/agg/CollAggregationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.agg;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
Expand All @@ -39,6 +40,11 @@ public static void setUp() {
TestUtil.registerProcedure(db, CollAggregation.class);
}

@AfterClass
public static void teardown() {
db.shutdown();
}

@Test
public void testNth() throws Exception {
testCall(db, "UNWIND RANGE(0,10) as value RETURN apoc.agg.nth(value, 0) as first, apoc.agg.nth(value, 3) as third,apoc.agg.nth(value, -1) as last",
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/agg/GraphAggregationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.agg;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
Expand Down Expand Up @@ -48,6 +49,11 @@ public class GraphAggregationTest {
db.executeTransactionally("CREATE (a:A {id:'a'})-[:AB {id:'ab'}]->(b:B {id:'b'})-[:BC {id:'bc'}]->(c:C {id:'c'}),(a)-[:AC {id:'ac'}]->(c)");
}

@AfterClass
public static void teardown() {
db.shutdown();
}

@Test
public void testGraph() throws Exception {
Map<String, Entity> pcs = db.executeTransactionally("MATCH (n) RETURN n.id as id, n UNION ALL MATCH ()-[n]->() RETURN n.id as id, n", Collections.emptyMap(),
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/agg/MedianTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.agg;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
Expand All @@ -37,6 +38,11 @@ public class MedianTest {
TestUtil.registerProcedure(db, Median.class);
}

@AfterClass
public static void teardown() {
db.shutdown();
}

@Test
public void testMedian() throws Exception {
testCall(db, "UNWIND [] as value RETURN apoc.agg.median(value) as p",
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/agg/PercentilesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.agg;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.ClassRule;
Expand All @@ -41,6 +42,11 @@ public class PercentilesTest {
TestUtil.registerProcedure(db, Percentiles.class);
}

@AfterClass
public static void teardown() {
db.shutdown();
}

@Test
public void testPercentiles() throws Exception {
testCall(db, "UNWIND [] as value RETURN apoc.agg.percentiles(value) as p",
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/agg/ProductAggregationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.agg;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
Expand All @@ -37,6 +38,11 @@ public class ProductAggregationTest {
TestUtil.registerProcedure(db, Product.class);
}

@AfterClass
public static void teardown() {
db.shutdown();
}

@Test
public void testProduct() throws Exception {
testCall(db, "UNWIND [] as value RETURN apoc.agg.product(value) as p",
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/agg/StatisticsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.agg;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
Expand All @@ -41,6 +42,11 @@ public static void setUp() throws Exception {
TestUtil.registerProcedure(db, Statistics.class);
}

@AfterClass
public static void teardown() {
db.shutdown();
}

@Test
public void testStatistics() throws Exception {
testCall(db, "UNWIND [] as value RETURN apoc.agg.statistics(value) as p",
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/algo/CoverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.algo;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
Expand All @@ -42,6 +43,11 @@ public static void setUp() throws Exception {
db.executeTransactionally("CREATE (a)-[:X]->(b)-[:X]->(c)-[:X]->(d)");
}

@AfterClass
public static void teardown() {
db.shutdown();
}

@Test
public void testCover() throws Exception {
TestUtil.testCall(db,
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/algo/PathFindingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.algo;

import apoc.util.TestUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -73,6 +74,11 @@ public void setUp() throws Exception {
TestUtil.registerProcedure(db, PathFinding.class);
}

@After
public void teardown() {
db.shutdown();
}

@Test
public void testAStar() {
db.executeTransactionally(SETUP_GEO);
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/atomic/AtomicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.commons.lang.ArrayUtils;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -54,6 +55,11 @@ public class AtomicTest {
TestUtil.registerProcedure(db, Atomic.class);
}

@After
public void teardown() {
db.shutdown();
}

@Test
public void testAddAndSubInteger(){
db.executeTransactionally("CREATE (p:Person {name:'Tom'})");
Expand Down
6 changes: 6 additions & 0 deletions core/src/test/java/apoc/bitwise/BitwiseOperationsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package apoc.bitwise;

import apoc.util.TestUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
Expand All @@ -45,6 +46,11 @@ public static void setUp() throws Exception {
TestUtil.registerProcedure(db, BitwiseOperations.class);
}

@AfterClass
public static void teardown() {
db.shutdown();
}

public void testOperation(String op, long expected) {
Map<String, Object> params = map("a", a, "op", op, "b", b);
testCall(db, BITWISE_CALL, params,
Expand Down
Loading

0 comments on commit a98ff43

Please sign in to comment.