Verified Commit ff6ab39a authored by 35V LG84's avatar 35V LG84

tep-1010: cleanups and t3db records

Clean up unit tests and add t3db records.
Signed-off-by: 35V LG84's avatar35V LG84 <35vlg84-x4e6b92@e257.fi>
parent 058ed149
......@@ -281,8 +281,8 @@ class Settings(optPath: Option[Path], providedConfig: Config) {
val accounts: List[String] = getReportAccounts(keys.accounts)
// todo: this is lazy evaluated?
// to trigger, remove output from
// tests/reporting/ex/GroupByException-unknown-group-by.exec
// test:uuid: 31e0bd80-d4a9-4d93-915d-fa2424aedb84
// test: 31e0bd80-d4a9-4d93-915d-fa2424aedb84
// exec: tests/reporting/ex/GroupByException-unknown-group-by.exec
val groupBy: GroupBy = GroupBy(cfg.getString(keys.groupBy))
}
......
......@@ -33,7 +33,7 @@ class StorageTypeTest extends FlatSpec {
}
/**
* test:uuid: 195971d7-f16f-4c1c-a761-6764b28fd4db
* test: 195971d7-f16f-4c1c-a761-6764b28fd4db
*/
it should "handle unknown type" in {
assertThrows[TacklerException]{
......
......@@ -26,7 +26,7 @@ class TxnFilterBBoxLatLonAltTest extends FunSpec with TxnFilterBBoxSpec {
describe("BBox 3D (Latitude, Longitude, Altitude)") {
/**
* test:
* test: 00d5f743-4eca-4d06-a5e5-4de035909828
*/
it("Filter 2D Txns") {
val geo2DTxnStr =
......@@ -51,7 +51,7 @@ class TxnFilterBBoxLatLonAltTest extends FunSpec with TxnFilterBBoxSpec {
}
/**
* test:
* test: 607d4e0e-e05b-43cf-87b6-d3cad309be73
*/
it ("Filter 3D Txns") {
......@@ -70,7 +70,7 @@ class TxnFilterBBoxLatLonAltTest extends FunSpec with TxnFilterBBoxSpec {
describe("BBox 3D errors") {
/**
* test:
* test: 1d6f4fb9-bcfd-41ae-8720-2584ec2f4087
*/
it("detects illegal arguments") {
val errBBoxes: List[(BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, String)] =
......@@ -108,7 +108,7 @@ class TxnFilterBBoxLatLonAltTest extends FunSpec with TxnFilterBBoxSpec {
}
/**
* test:
* test: 92232872-cea2-4787-8ba4-892d958796cb
*/
it("detects illegal arguments via JSON") {
val errBBoxFilterJson =
......@@ -137,7 +137,10 @@ class TxnFilterBBoxLatLonAltTest extends FunSpec with TxnFilterBBoxSpec {
describe("BBox 3D (Latitude, Longitude, Altitude) verification tests") {
it ("Check edge cases (points and/or BBoxes)") {
/**
* test: 9aa6d324-3bcc-4fcd-ac75-2447f3a65d3b
*/
it("Check edge cases (points and/or BBoxes)") {
val count = geo2d3dTests.map(t => {
val expectedCount = t._1
......@@ -163,84 +166,87 @@ class TxnFilterBBoxLatLonAltTest extends FunSpec with TxnFilterBBoxSpec {
assert(count === 7, ", e.g. test count for filter is wrong")
}
}
it ("check altitude functionality") {
val altTests = List[
(Int, // test count
(BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal), // 3D GEO Filter
List[(BigDecimal, BigDecimal, Option[BigDecimal], Boolean)]) // Test vectors and result
](
(4,
(20, 10, 22, 45, 25, 22),
List(
(30, 15, Some(22), true),
(30, 15, Some(-22), false),
(30, 15, Some(22.1), false),
(30, 15, Some(21.9), false),
)
),
(4,
(20, 10, -22, 45, 25, -22),
List(
(30, 15, Some(-22), true),
/**
* test: d6764e33-f20c-4c50-8452-d249d1f0c902
*/
it("check altitude functionality") {
val altTests = List[
(Int, // test count
(BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal, BigDecimal), // 3D GEO Filter
List[(BigDecimal, BigDecimal, Option[BigDecimal], Boolean)]) // Test vectors and result
](
(4,
(20, 10, 22, 45, 25, 22),
List(
(30, 15, Some(22), true),
(30, 15, Some(-22), false),
(30, 15, Some(22.1), false),
(30, 15, Some(21.9), false),
)
),
(4,
(20, 10, -22, 45, 25, -22),
List(
(30, 15, Some(-22), true),
(30, 15, Some(22), false),
(30, 15, Some(-22.1), false),
(30, 15, Some(-21.9), false),
)
),
(7,
(20, 10, -10, 45, 25, 10),
List(
(30, 15, Some(0), true),
(30, 15, Some(5), true),
(30, 15, Some(-5), true),
(30, 15, Some(-10), true),
(30, 15, Some(10), true),
(30, 15, Some(-11), false),
(30, 15, Some(11), false),
)
),
(6,
(20, 10, -10, 45, 25, -1),
List(
(30, 15, Some(0), false),
(30, 15, Some(-5), true),
(30, 15, Some(-10), true),
(30, 15, Some(-1), true),
(30, 15, Some(-11), false),
(30, 15, Some(0), false),
)
),
)
(30, 15, Some(22), false),
(30, 15, Some(-22.1), false),
(30, 15, Some(-21.9), false),
)
),
(7,
(20, 10, -10, 45, 25, 10),
List(
(30, 15, Some(0), true),
(30, 15, Some(5), true),
(30, 15, Some(-5), true),
(30, 15, Some(-10), true),
(30, 15, Some(10), true),
(30, 15, Some(-11), false),
(30, 15, Some(11), false),
)
),
(6,
(20, 10, -10, 45, 25, -1),
List(
(30, 15, Some(0), false),
(30, 15, Some(-5), true),
(30, 15, Some(-10), true),
(30, 15, Some(-1), true),
val count = altTests.map(t => {
val expectedCount = t._1
(30, 15, Some(-11), false),
(30, 15, Some(0), false),
val bbox = t._2
val txnFilter = TxnFilterBBoxLatLonAlt(
bbox._1, bbox._2, bbox._3, bbox._4, bbox._5, bbox._6
)
),
)
val count = altTests.map(t => {
val expectedCount = t._1
val tvecs = t._3
val bbox = t._2
val txnFilter = TxnFilterBBoxLatLonAlt(
bbox._1, bbox._2, bbox._3, bbox._4, bbox._5, bbox._6
)
val tvecs = t._3
val count = tvecs.map(v => {
val geo = GeoPoint.toPoint(v._1, v._2, v._3).get
val txn = Transaction(TxnHeader(date, None, None, None, Some(geo), None), posts)
val count = tvecs.map(v => {
val geo = GeoPoint.toPoint(v._1, v._2, v._3).get
val txn = Transaction(TxnHeader(date, None, None, None, Some(geo), None), posts)
assert(TxnFilterBBoxLatLonAltF.filter(txnFilter, txn) === v._4)
1
}).foldLeft(0)(_ + _)
assert(TxnFilterBBoxLatLonAltF.filter(txnFilter, txn) === v._4)
assert(count === expectedCount, ", e.g. test vector size for one filter is wrong")
1
}).foldLeft(0)(_ + _)
assert(count === expectedCount, ", e.g. test vector size for one filter is wrong")
1
}).foldLeft(0)(_ + _)
assert(count === 4, ", e.g. test count for filter is wrong")
assert(count === 4, ", e.g. test count for filter is wrong")
}
}
}
......@@ -26,7 +26,7 @@ class TxnFilterBBoxLatLonTest extends FunSpec with TxnFilterBBoxSpec {
describe("BBox 2D (Latitude, Longitude) basic tests") {
/**
* test:
* test: 320d92b9-f8e7-4283-9296-74ff4340fff1
*/
it("Filter 2D Txns") {
val geo2DTxnData = tt.string2Txns(geo2DTxnStr)
......@@ -42,7 +42,7 @@ class TxnFilterBBoxLatLonTest extends FunSpec with TxnFilterBBoxSpec {
}
/**
* test:
* test: 05983503-0aa4-42e1-a1c9-cc5df93285f7
*/
it("Filter 3D Txns") {
......@@ -62,14 +62,14 @@ class TxnFilterBBoxLatLonTest extends FunSpec with TxnFilterBBoxSpec {
describe("BBox 2D (Latitude, Longitude) error cases") {
/**
* test:
* test: 37063f39-0796-44bd-a300-511f36db8f48
*/
it("detects illegal arguments") {
val errBBoxes: List[(BigDecimal, BigDecimal, BigDecimal, BigDecimal, String)] =
List(
(65.0, 0, 40, 0, "North is below South. South: 65.0; North: 40"),
(-2, 0, -30.0, 0, "North is below South. South: -2; North: -30.0"),
(25, 0, -25, 0, "North is below South. South: 25; North: -25"),
(22, 0, -25, 0, "North is below South. South: 22; North: -25"),
(-90.1, 0, 0, 0, "South is beyond pole. South: -90.1"),
(0, 0, 90.1, 0, "North is beyond pole. North: 90.1"),
......@@ -94,7 +94,7 @@ class TxnFilterBBoxLatLonTest extends FunSpec with TxnFilterBBoxSpec {
}
/**
* test:
* test: e690ce1d-4e0c-4f73-9b71-5a6a84dc52b8
*/
it("detects illegal arguments via JSON") {
val errBBoxFilterJson =
......@@ -121,6 +121,9 @@ class TxnFilterBBoxLatLonTest extends FunSpec with TxnFilterBBoxSpec {
describe("BBox 2D (Latitude, Longitude) verification tests") {
/**
* test: 8f7e0c4e-a4b5-4f33-aad9-adaae1df1c5e
*/
it ("Check edge cases (points and/or BBoxes)") {
val count = geo2d3dTests.map(t => {
......
......@@ -115,54 +115,89 @@ features:
parent: 415d0acb-8441-4dce-aa81-e99e5b2f2e49
subject: Geo Filter
- feature:
id: a78fa9ce-160b-4c24-ba1a-30df5c2b3ea8
parent: cfa92a0d-a8af-4fb5-a3c6-723029febc5a
subject: "2D Txn Geo Filter (BBoxLatLon)"
tests:
operations:
- test:
id: 320d92b9-f8e7-4283-9296-74ff4340fff1
name: TxnFilterBBoxLatLonTest
descriptions:
- desc: "Filter 2D Txns"
- test:
id: 05983503-0aa4-42e1-a1c9-cc5df93285f7
name: TxnFilterBBoxLatLonTest
descriptions:
- desc: "Filter 3D Txns"
- test:
id: 37063f39-0796-44bd-a300-511f36db8f48
name: TxnFilterBBoxLatLonTest
descriptions:
- desc: "detects illegal arguments"
- desc: "North vs. south, northern hemisphere"
- desc: "North vs. south, southern hemisphere"
- desc: "Over equator"
- desc: "South beyond pole"
- desc: "North beyond pole"
- desc: "West beyond 180th meridian, east"
- desc: "west beyond 180th meridian, west"
- desc: "East beyond 180th meridian, east"
- desc: "East beyond 180th meridian, west"
- test:
id: e690ce1d-4e0c-4f73-9b71-5a6a84dc52b8
name: TxnFilterBBoxLatLonTest
descriptions:
- desc: "detects illegal arguments via JSON"
- test:
id: 8f7e0c4e-a4b5-4f33-aad9-adaae1df1c5e
name: TxnFilterBBoxLatLonTest
descriptions:
- desc: "Check edge cases (points and/or BBoxes)"
- feature:
id: aee868fa-63b4-4bc0-879f-1d6272ae6e39
parent: cfa92a0d-a8af-4fb5-a3c6-723029febc5a
subject: "3D Txn Geo Filter (BBoxLatLonAlt)"
tests:
operations:
- test:
id: 00d5f743-4eca-4d06-a5e5-4de035909828
name: TxnFilterBBoxLatLonAltTest
descriptions:
- desc: "Filter 2D Txns"
- test:
id: 607d4e0e-e05b-43cf-87b6-d3cad309be73
name: TxnFilterBBoxLatLonAltTest
descriptions:
- desc: "Filter 3D Txns"
- test:
id: 1d6f4fb9-bcfd-41ae-8720-2584ec2f4087
name: TxnFilterBBoxLatLonAltTest
descriptions:
- desc: "detects illegal arguments"
- desc: "North vs. south, northern hemisphere"
- desc: "North vs. south, southern hemisphere"
- desc: "Over equator"
- desc: "South beyond pole"
- desc: "North beyond pole"
- desc: "West beyond 180th meridian, east"
- desc: "west beyond 180th meridian, west"
- desc: "East beyond 180th meridian, east"
- desc: "East beyond 180th meridian, west"
- test:
id: 92232872-cea2-4787-8ba4-892d958796cb
name: TxnFilterBBoxLatLonAltTest
descriptions:
- desc: "detects illegal arguments via JSON"
- test:
id: 9aa6d324-3bcc-4fcd-ac75-2447f3a65d3b
name: TxnFilterBBoxLatLonAltTest
descriptions:
- desc: "Check edge cases (points and/or BBoxes)"
- test:
id: d6764e33-f20c-4c50-8452-d249d1f0c902
name: TxnFilterBBoxLatLonAltTest
descriptions:
- desc: "check altitude functionality"
#features:
# - feature:
# id:
# subject:
#
# - feature:
# id:
# parent:
# subject:
# tests:
# errors:
# - error:
# id:
# refid:
# name:
# desc:
# desciptions:
# - desc:
# - desc:
# reports:
# balance:
# - test:
# refid:
# balance-group:
# - test:
# refid:
# registry:
# - test:
# refid:
# identity:
# - test:
# refid:
# equity:
# - test:
# refid:
# operations:
# - test:
# id:
# refid:
# name:
# desc:
# descriptions:
# - desc:
# - desc:
# references:
# - ref: identity
# - ref: equity
# - ref: balance
# - ref: balance-group
# - ref: register
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment