Skip to content
Snippets Groups Projects
Verified Commit 4e96ecc4 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: unittests versioning 8

parent 04f40567
Branches
Tags
No related merge requests found
......@@ -48,23 +48,6 @@ INSERT INTO feature_config (_key, _value) VALUES ("ENTITY_VERSIONING", "ENABLED"
-- TEST insertEntityProperty with Versioning - REFERENCE HEAD
-- TODO assert throws
SET @VALUE="50@";
CALL insertEntityProperty(0, @EntityID, @PropertyID, "reference_data", @Value,
NULL, "FIX", NULL, NULL, NULL, NULL, 0);
-- TODO switch expected/actual
SELECT tap.eq(0, domain_id, "domain ok") FROM reference_data;
SELECT tap.eq(99, entity_id, "entity ok") FROM reference_data;
SELECT tap.eq(11, property_id, "property ok") FROM reference_data;
SELECT tap.eq(50, value, "value ok") FROM reference_data;
SELECT tap.eq("FIX", status, "status ok") FROM reference_data;
SELECT tap.eq("0", pidx, "pidx ok") FROM reference_data;
SELECT tap.eq(value_iversion, NULL, "value_iversion ok") FROM reference_data;
DELETE FROM reference_data WHERE domain_id=0 AND entity_id=99;
SET @VALUE="50";
CALL insertEntityProperty(0, @EntityID, @PropertyID, "reference_data", @Value,
NULL, "FIX", NULL, NULL, NULL, NULL, 0);
......@@ -82,8 +65,8 @@ DELETE FROM reference_data WHERE domain_id=0 AND entity_id=99;
-- TEST insertEntityProperty with Versioning - Reference version
CALL insert_single_child_version(@EntityID, "hashbla", "versionbla", NULL, "SRIDbla");
CALL insert_single_child_version(@EntityID, "hashblub", "versionblub", "versionbla", "SRIDblub");
CALL insert_single_child_version(50, "hashbla", "versionbla", NULL, "SRIDbla");
CALL insert_single_child_version(50, "hashblub", "versionblub", "versionbla", "SRIDblub");
SET @VALUE="50@versionbla";
CALL insertEntityProperty(0, @EntityID, @PropertyID, "reference_data", @Value,
......@@ -103,6 +86,7 @@ SET @VALUE="50@versionblub";
CALL insertEntityProperty(0, @EntityID, @PropertyID, "reference_data", @Value,
NULL, "FIX", NULL, NULL, NULL, NULL, 0);
-- TODO switch expected/actual
SELECT tap.eq(0, domain_id, "domain ok") FROM reference_data;
SELECT tap.eq(99, entity_id, "entity ok") FROM reference_data;
SELECT tap.eq(11, property_id, "property ok") FROM reference_data;
......@@ -111,7 +95,19 @@ SELECT tap.eq("FIX", status, "status ok") FROM reference_data;
SELECT tap.eq("0", pidx, "pidx ok") FROM reference_data;
SELECT tap.eq(value_iversion, "2", "value_iversion ok") FROM reference_data;
-- TODO switch expected/actual
-- invalid values throw errors
SET @VALUE="50@";
CALL tap._assert_throws('
CALL insertEntityProperty(0, @EntityID, @PropertyID, "reference_data", @Value,
NULL, "FIX", NULL, NULL, NULL, NULL, 0)', "@ but no version id");
SET @VALUE="50@non-existing-version";
CALL tap._assert_throws('
CALL insertEntityProperty(0, @EntityID, @PropertyID, "reference_data", @Value,
NULL, "FIX", NULL, NULL, NULL, NULL, 0)', "non-existing-version id");
-- #####################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment