Package org.h2.test.db
Class TestSpatial
- java.lang.Object
-
- org.h2.test.TestBase
-
- org.h2.test.TestDb
-
- org.h2.test.db.TestSpatial
-
public class TestSpatial extends org.h2.test.TestDbSpatial datatype and index tests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTestSpatial.TableEnvelopeAn aggregate function that calculates the envelope.
-
Constructor Summary
Constructors Constructor Description TestSpatial()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.locationtech.jts.geom.GeometrygeomFromText(java.lang.String text, int srid)Convert the text to a geometry object.static java.lang.StringgetObjectString(org.locationtech.jts.geom.Geometry object)Get the toString value of the object.static java.sql.ResultSetgetRandomGeometryTable(long seed, long rowCount, double minX, double maxX, double minY, double maxY, double maxLength)Generate a result set with random geometry data.booleanisEnabled()static voidmain(java.lang.String... a)Run just this test.static java.sql.ResultSetpointTable(double x, double y)This method is called via reflection from the database.voidtest()This method will be called by the test framework.-
Methods inherited from class org.h2.test.TestDb
buildChild, deleteDb, deleteDb, getConnection, getConnection, getURL
-
Methods inherited from class org.h2.test.TestBase
assertContains, assertEmpty, assertEqualDatabases, assertEqualReaders, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualStreams, assertFalse, assertFalse, assertKnownException, assertKnownException, assertNotContaining, assertNotNull, assertNotNull, assertNull, assertResult, assertResultRowCount, assertResultSetMeta, assertResultSetOrdered, assertResultSetOrdered, assertSame, assertSingleValue, assertSmaller, assertStartsWith, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertThrows, assertTrue, assertTrue, checkErrorCode, crash, createCaller, createFailingStream, eatMemory, execute, execute, fail, fail, freeMemory, getBaseDir, getClassPath, getFilePassword, getJVM, getMemoryUsed, getMemoryUsedBytes, getPassword, getPassword, getPowerOffCount, getSize, getTestDir, getTestName, getUser, init, init, logError, logErrorMessage, println, printTime, printTimeMemory, readString, runTest, setPowerOffCount, testFromMain, throwException, trace, trace, traceMemory
-
-
-
-
Method Detail
-
main
public static void main(java.lang.String... a) throws java.lang.ExceptionRun just this test.- Parameters:
a- ignored- Throws:
java.lang.Exception
-
isEnabled
public boolean isEnabled()
- Overrides:
isEnabledin classorg.h2.test.TestBase- Returns:
- whether this test is enabled in the current configuration
-
test
public void test() throws java.sql.SQLExceptionDescription copied from class:org.h2.test.TestBaseThis method will be called by the test framework.- Specified by:
testin classorg.h2.test.TestBase- Throws:
java.sql.SQLException
-
getRandomGeometryTable
public static java.sql.ResultSet getRandomGeometryTable(long seed, long rowCount, double minX, double maxX, double minY, double maxY, double maxLength)Generate a result set with random geometry data. Used as an ALIAS function.- Parameters:
seed- the random seedrowCount- the number of rowsminX- the smallest xmaxX- the largest xminY- the smallest ymaxY- the largest ymaxLength- the maximum length- Returns:
- a result set
-
geomFromText
public static org.locationtech.jts.geom.Geometry geomFromText(java.lang.String text, int srid) throws java.sql.SQLExceptionConvert the text to a geometry object.- Parameters:
text- the geometry as a Well Known Textsrid- the projection id- Returns:
- Geometry object
- Throws:
java.sql.SQLException
-
getObjectString
public static java.lang.String getObjectString(org.locationtech.jts.geom.Geometry object)
Get the toString value of the object.- Parameters:
object- the object- Returns:
- the string representation
-
pointTable
public static java.sql.ResultSet pointTable(double x, double y)This method is called via reflection from the database.- Parameters:
x- the x position of the pointy- the y position of the point- Returns:
- a result set with this point
-
-