Skip to content
Snippets Groups Projects
Commit 7b7169ce authored by jakubs's avatar jakubs
Browse files

BIS-102 SP-146 test material updates

SVN: 26241
parent 6ec7d95b
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,10 @@ def createMaterials(transaction):
def createSamples(transaction):
sample = transaction.createNewSample('/RICH_SPACE/SAMPLE123', 'DYNAMIC_PLATE')
def updateMaterial(transaction):
ma = transaction.getMaterialForUpdate("AD3", "VIRUS");
ma.setPropertyValue("DESCRIPTION", "modified description");
def process(transaction):
# create experiment
experiment = create_experiment_if_needed(transaction)
......@@ -60,6 +64,9 @@ def process(transaction):
# register many materials
createMaterials(transaction)
# update material
updateMaterial(transaction)
# register samples
createSamples(transaction)
......
......@@ -68,6 +68,8 @@ public class FeatureRichDataSetImportSystemTest extends SystemTestCase
assert100MaterialsCreated(openBISService);
assertEmailHasBeenSentFromHook();
assertMaterialUpdated(openBISService);
}
private void assertEmailHasBeenSentFromHook()
......@@ -81,7 +83,7 @@ public class FeatureRichDataSetImportSystemTest extends SystemTestCase
{
assertTrue(content, content.contains("rich_email_text")); // check the content
// introduced
// with the persistent map
// with the persistent map
return; // assert ok
}
}
......@@ -140,6 +142,26 @@ public class FeatureRichDataSetImportSystemTest extends SystemTestCase
}
private void assertMaterialUpdated(IEncapsulatedOpenBISService openBISService)
{
LinkedList<MaterialIdentifier> ids = new LinkedList<MaterialIdentifier>();
MaterialIdentifier ident = MaterialIdentifier.tryParseIdentifier("AD3 (VIRUS)");
ids.add(ident);
ListMaterialCriteria criteria = ListMaterialCriteria.createFromMaterialIdentifiers(ids);
List<Material> materials = openBISService.listMaterials(criteria, true);
assertEquals(1, materials.size());
for (Material m : materials)
{
IEntityProperty property = m.getProperties().get(0);
assertEquals("DESCRIPTION", property.getPropertyType().getCode());
assertEquals("modified description", property.getValue());
}
}
private void assertLinkedDataSetImported(IEncapsulatedOpenBISService openBISService)
{
ExternalData a = listOneDataSet(openBISService, "FR_LINK_CODE");
......
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