Junit5 bump - ebean-postgis

This commit is contained in:
rbygrave committed 2021-09-06 17:59:01 +12:00
1 parent a6f27ca19f
commit 43451c5342
4 files changed
+28 -31

No files matched your search

+3 -3
View File
@@ -86,9 +86,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.avaje.composite</groupId> <groupId>io.avaje</groupId>
<artifactId>composite-testing</artifactId> <artifactId>junit</artifactId>
<version>3.1</version> <version>1.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -1,13 +1,13 @@
package org.example.domain; package org.example.domain;
import io.ebean.Ebean; import io.ebean.DB;
import org.junit.jupiter.api.Test;
import org.postgis.LineString; import org.postgis.LineString;
import org.postgis.MultiLineString; import org.postgis.MultiLineString;
import org.postgis.MultiPoint; import org.postgis.MultiPoint;
import org.postgis.MultiPolygon; import org.postgis.MultiPolygon;
import org.postgis.Point; import org.postgis.Point;
import org.postgis.Polygon; import org.postgis.Polygon;
import org.testng.annotations.Test;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
@@ -17,16 +17,16 @@ public class TestInsertQuery {
/** /**
* Not automated this test yet. * Not automated this test yet.
*/ */
@Test(enabled = false) @Test
public void insert() throws SQLException { public void insert() throws SQLException {
List<MyBean> list = Ebean.find(MyBean.class).findList(); List<MyBean> list = DB.find(MyBean.class).findList();
for (MyBean MyBean : list) { for (MyBean MyBean : list) {
System.out.println(MyBean.getPoint()); System.out.println(MyBean.getPoint());
} }
List<MyBean> list1 = Ebean.find(MyBean.class) List<MyBean> list1 = DB.find(MyBean.class)
.where() .where()
.raw("st_within(st_pointfromwkb(st_point(?, ?), 4674), poly)", 1.9, 1.9) .raw("st_within(st_pointfromwkb(st_point(?, ?), 4674), poly)", 1.9, 1.9)
.findList(); .findList();
@@ -50,10 +50,10 @@ public class TestInsertQuery {
p.setMultiPoint(multiPoint); p.setMultiPoint(multiPoint);
p.setMpoly(mpoly); p.setMpoly(mpoly);
Ebean.save(p); DB.save(p);
List<String> content = List<String> content =
Ebean.find(MyBean.class) DB.find(MyBean.class)
.select("ST_AsText(lineString)::String") .select("ST_AsText(lineString)::String")
.findSingleAttributeList(); .findSingleAttributeList();
@@ -1,6 +1,6 @@
package org.example.domain; package org.example.domain;
import io.ebean.Ebean; import io.ebean.DB;
import org.geolatte.geom.Point; import org.geolatte.geom.Point;
import org.geolatte.geom.Polygon; import org.geolatte.geom.Polygon;
import org.geolatte.geom.codec.Wkt; import org.geolatte.geom.codec.Wkt;
@@ -8,9 +8,9 @@ import org.geolatte.geom.LineString;
import org.geolatte.geom.MultiLineString; import org.geolatte.geom.MultiLineString;
import org.geolatte.geom.MultiPoint; import org.geolatte.geom.MultiPoint;
import org.geolatte.geom.MultiPolygon; import org.geolatte.geom.MultiPolygon;
import org.testng.annotations.Test; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.sql.SQLException;
import java.util.List; import java.util.List;
public class TestOtherInsertQuery { public class TestOtherInsertQuery {
@@ -18,16 +18,16 @@ public class TestOtherInsertQuery {
/** /**
* Not automated this test yet. * Not automated this test yet.
*/ */
@Test(enabled = false) @Disabled
public void insert() throws SQLException { @Test
public void insert() {
List<OtherBeanGeoLatte> list = DB.find(OtherBeanGeoLatte.class).findList();
List<OtherBeanGeoLatte> list = Ebean.find(OtherBeanGeoLatte.class).findList();
for (OtherBeanGeoLatte OtherBeanGeoLatte : list) { for (OtherBeanGeoLatte OtherBeanGeoLatte : list) {
System.out.println(OtherBeanGeoLatte.getPoint()); System.out.println(OtherBeanGeoLatte.getPoint());
} }
List<OtherBeanGeoLatte> list1 = Ebean.find(OtherBeanGeoLatte.class) List<OtherBeanGeoLatte> list1 = DB.find(OtherBeanGeoLatte.class)
.where() .where()
.raw("st_within(st_pointfromwkb(st_point(?, ?), 4674), poly)", 1.9, 1.9) .raw("st_within(st_pointfromwkb(st_point(?, ?), 4674), poly)", 1.9, 1.9)
.findList(); .findList();
@@ -52,6 +52,6 @@ public class TestOtherInsertQuery {
p.setMultiPoint(multiPoint); p.setMultiPoint(multiPoint);
p.setMultiLineString(multiLineString); p.setMultiLineString(multiLineString);
Ebean.save(p); DB.save(p);
} }
} }
@@ -10,13 +10,13 @@ import org.geolatte.geom.Point;
import org.geolatte.geom.Polygon; import org.geolatte.geom.Polygon;
import org.geolatte.geom.PositionSequenceBuilders; import org.geolatte.geom.PositionSequenceBuilders;
import org.geolatte.geom.crs.CoordinateReferenceSystems; import org.geolatte.geom.crs.CoordinateReferenceSystems;
import org.testng.annotations.AfterTest; import org.junit.jupiter.api.AfterEach;
import org.testng.annotations.BeforeTest; import org.junit.jupiter.api.BeforeEach;
import org.testng.annotations.Test; import org.junit.jupiter.api.Test;
import static org.geolatte.geom.codec.Wkt.toWkt; import static org.geolatte.geom.codec.Wkt.toWkt;
import static org.testng.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.testng.AssertJUnit.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
public class TestQuery { public class TestQuery {
@@ -88,20 +88,17 @@ public class TestQuery {
) )
); );
@BeforeTest @BeforeEach
public void setupObjects() { public void setupObjects() {
OtherBeanGeoLatte geoLatte = new OtherBeanGeoLatte(); OtherBeanGeoLatte geoLatte = new OtherBeanGeoLatte();
geoLatte.setWgs84Point(wgs84Point); geoLatte.setWgs84Point(wgs84Point);
DB.save(geoLatte); DB.save(geoLatte);
} }
@AfterTest @AfterEach
public void cleanup() { public void cleanup() {
DB DB.find(MyBean.class).delete();
.find(MyBean.class) DB.find(OtherBeanGeoLatte.class).delete();
.delete();
DB.find(OtherBeanGeoLatte.class)
.delete();
} }
@Test @Test