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

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