Skip to content
Snippets Groups Projects
Commit 276916e7 authored by Adam Laskowski's avatar Adam Laskowski
Browse files

SSDM-13637: Fixed unit tests for meta_data update and create

parent 8f3d5d1f
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -1312,11 +1312,17 @@ public class UpdateDataSetTest extends AbstractDataSetTest ...@@ -1312,11 +1312,17 @@ public class UpdateDataSetTest extends AbstractDataSetTest
@Test @Test
public void testCreateMetaData() public void testUpdateMetaData()
{ {
// Prepare // Prepare
String sessionToken = v3api.login(TEST_USER, PASSWORD); String sessionToken = v3api.login(TEST_USER, PASSWORD);
DataSetCreation dataSetCreation = createDataSet();
DataSetCreation dataSetCreation = new DataSetCreation();
dataSetCreation.setCode("DATA_SET_META_1");
dataSetCreation.setTypeId(new EntityTypePermId("DELETION_TEST_CONTAINER", EntityKind.DATA_SET));
dataSetCreation.setDataStoreId(new DataStorePermId("STANDARD"));
dataSetCreation.setDataSetKind(DataSetKind.CONTAINER);
dataSetCreation.setExperimentId(new ExperimentIdentifier("/CISD/NEMO/EXP-TEST-1"));
dataSetCreation.setMetaData(Map.of("key_modify", "value_modify", "key_delete", "value_delete")); dataSetCreation.setMetaData(Map.of("key_modify", "value_modify", "key_delete", "value_delete"));
DataSetPermId id = v3api.createDataSets(sessionToken, Arrays.asList(dataSetCreation)).get(0); DataSetPermId id = v3api.createDataSets(sessionToken, Arrays.asList(dataSetCreation)).get(0);
......
...@@ -164,7 +164,7 @@ public class UpdateExperimentTypeTest extends UpdateEntityTypeTest<ExperimentTyp ...@@ -164,7 +164,7 @@ public class UpdateExperimentTypeTest extends UpdateEntityTypeTest<ExperimentTyp
// Prepare // Prepare
ExperimentTypeCreation creation = new ExperimentTypeCreation(); ExperimentTypeCreation creation = new ExperimentTypeCreation();
creation.setCode("EXPERIMENT_TYPE_META_DATA_TEST"); creation.setCode("EXPERIMENT_TYPE_META_DATA_TEST");
creation.setMetaData(Map.of("kay_modify", "value_modify", "key_delete", "value_delete")); creation.setMetaData(Map.of("key_modify", "value_modify", "key_delete", "value_delete"));
createTypes(sessionToken, List.of(creation)); createTypes(sessionToken, List.of(creation));
// Act // Act
......
...@@ -605,7 +605,7 @@ CREATE RULE data_set_relationships_update AS ...@@ -605,7 +605,7 @@ CREATE RULE data_set_relationships_update AS
ON UPDATE TO data_set_relationships DO INSTEAD UPDATE data_set_relationships_all SET data_id_parent = new.data_id_parent, parent_frozen = new.parent_frozen, cont_frozen = new.cont_frozen, data_id_child = new.data_id_child, child_frozen = new.child_frozen, comp_frozen = new.comp_frozen, del_id = new.del_id, relationship_id = new.relationship_id, ordinal = new.ordinal, pers_id_author = new.pers_id_author, registration_timestamp = new.registration_timestamp, modification_timestamp = new.modification_timestamp ON UPDATE TO data_set_relationships DO INSTEAD UPDATE data_set_relationships_all SET data_id_parent = new.data_id_parent, parent_frozen = new.parent_frozen, cont_frozen = new.cont_frozen, data_id_child = new.data_id_child, child_frozen = new.child_frozen, comp_frozen = new.comp_frozen, del_id = new.del_id, relationship_id = new.relationship_id, ordinal = new.ordinal, pers_id_author = new.pers_id_author, registration_timestamp = new.registration_timestamp, modification_timestamp = new.modification_timestamp
WHERE (((data_set_relationships_all.data_id_parent)::bigint = (new.data_id_parent)::bigint) AND ((data_set_relationships_all.data_id_child)::bigint = (new.data_id_child)::bigint) AND ((data_set_relationships_all.relationship_id)::bigint = (new.relationship_id)::bigint)); WHERE (((data_set_relationships_all.data_id_parent)::bigint = (new.data_id_parent)::bigint) AND ((data_set_relationships_all.data_id_child)::bigint = (new.data_id_child)::bigint) AND ((data_set_relationships_all.relationship_id)::bigint = (new.relationship_id)::bigint));
CREATE RULE data_update AS CREATE RULE data_update AS
ON UPDATE TO data DO INSTEAD UPDATE data_all SET code = new.code, frozen = new.frozen, frozen_for_children = new.frozen_for_children, frozen_for_parents = new.frozen_for_parents, frozen_for_comps = new.frozen_for_comps, frozen_for_conts = new.frozen_for_conts, del_id = new.del_id, orig_del = new.orig_del, expe_id = new.expe_id, expe_frozen = new.expe_frozen, dast_id = new.dast_id, data_producer_code = new.data_producer_code, dsty_id = new.dsty_id, is_derived = new.is_derived, is_valid = new.is_valid, modification_timestamp = new.modification_timestamp, access_timestamp = new.access_timestamp, pers_id_registerer = new.pers_id_registerer, pers_id_modifier = new.pers_id_modifier, production_timestamp = new.production_timestamp, registration_timestamp = new.registration_timestamp, samp_id = new.samp_id, samp_frozen = new.samp_frozen, version = new.version, data_set_kind = new.data_set_kind ON UPDATE TO data DO INSTEAD UPDATE data_all SET code = new.code, frozen = new.frozen, frozen_for_children = new.frozen_for_children, frozen_for_parents = new.frozen_for_parents, frozen_for_comps = new.frozen_for_comps, frozen_for_conts = new.frozen_for_conts, del_id = new.del_id, orig_del = new.orig_del, expe_id = new.expe_id, expe_frozen = new.expe_frozen, dast_id = new.dast_id, data_producer_code = new.data_producer_code, dsty_id = new.dsty_id, is_derived = new.is_derived, is_valid = new.is_valid, modification_timestamp = new.modification_timestamp, access_timestamp = new.access_timestamp, pers_id_registerer = new.pers_id_registerer, pers_id_modifier = new.pers_id_modifier, production_timestamp = new.production_timestamp, registration_timestamp = new.registration_timestamp, samp_id = new.samp_id, samp_frozen = new.samp_frozen, version = new.version, data_set_kind = new.data_set_kind, meta_data = new.meta_data
WHERE ((data_all.id)::bigint = (new.id)::bigint); WHERE ((data_all.id)::bigint = (new.id)::bigint);
CREATE RULE dataset_experiment_delete AS CREATE RULE dataset_experiment_delete AS
ON DELETE TO data_all ON DELETE TO data_all
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment