Skip to content
Snippets Groups Projects
Commit 033ede97 authored by felmer's avatar felmer
Browse files

LMS-2714 tests fixed

SVN: 24296
parent ab4627c4
No related branches found
No related tags found
No related merge requests found
...@@ -141,17 +141,17 @@ public class BatchMaterialRegistrationAndUpdateTest extends SystemTestCase ...@@ -141,17 +141,17 @@ public class BatchMaterialRegistrationAndUpdateTest extends SystemTestCase
List<PropertyHistory> history = List<PropertyHistory> history =
getMaterialPropertiesHistory(getMaterialOrNull("C1").getId()); getMaterialPropertiesHistory(getMaterialOrNull("C1").getId());
assertEquals( assertEquals(
"[BACTERIUM: material:22<a:2>, DESCRIPTION: compound 1<a:2>, GENDER: term:12<a:2>]", "[BACTERIUM: material:BACTERIUM1 [BACTERIUM]<a:2>, DESCRIPTION: compound 1<a:2>, GENDER: term:FEMALE [GENDER]<a:2>]",
history.toString()); history.toString());
assertCurrentValidUntilTimeStamp(history.get(0)); assertCurrentValidUntilTimeStamp(history.get(0));
assertEquals("[BACTERIUM: material:34<a:2>]", assertEquals("[BACTERIUM: material:BACTERIUM-X [BACTERIUM]<a:2>]",
getMaterialPropertiesHistory(getMaterialOrNull("C2").getId()).toString()); getMaterialPropertiesHistory(getMaterialOrNull("C2").getId()).toString());
updateMaterials("code\tdescription\tgender\tbacterium\n" updateMaterials("code\tdescription\tgender\tbacterium\n"
+ "c2\t--DELETE--\tfemale\tbacterium2\n", MATERIAL_TYPE, false); + "c2\t--DELETE--\tfemale\tbacterium2\n", MATERIAL_TYPE, false);
assertEquals( assertEquals(
"[BACTERIUM: material:34<a:2>, BACTERIUM: material:35<a:2>, DESCRIPTION: compound 2<a:2>, GENDER: term:11<a:2>]", "[BACTERIUM: material:BACTERIUM-X [BACTERIUM]<a:2>, BACTERIUM: material:BACTERIUM-Y [BACTERIUM]<a:2>, DESCRIPTION: compound 2<a:2>, GENDER: term:MALE [GENDER]<a:2>]",
getMaterialPropertiesHistory(getMaterialOrNull("C2").getId()).toString()); getMaterialPropertiesHistory(getMaterialOrNull("C2").getId()).toString());
deleteTestMaterials(); deleteTestMaterials();
} }
......
...@@ -28,16 +28,8 @@ final class HistoryRowMapper implements ParameterizedRowMapper<PropertyHistory> ...@@ -28,16 +28,8 @@ final class HistoryRowMapper implements ParameterizedRowMapper<PropertyHistory>
PropertyHistory propertyHistory = new PropertyHistory(); PropertyHistory propertyHistory = new PropertyHistory();
propertyHistory.setPropertyTypeCode(rs.getString("code")); propertyHistory.setPropertyTypeCode(rs.getString("code"));
propertyHistory.setValue(rs.getString("value")); propertyHistory.setValue(rs.getString("value"));
long id = rs.getLong("cvte_id"); propertyHistory.setTerm(rs.getString("vocabulary_term"));
if (rs.wasNull() == false) propertyHistory.setMaterial(rs.getString("material"));
{
propertyHistory.setTermID(id);
}
id = rs.getLong("mate_prop_id");
if (rs.wasNull() == false)
{
propertyHistory.setMaterialID(id);
}
propertyHistory.setValidFromTimeStamp(rs.getTimestamp("valid_from_timestamp")); propertyHistory.setValidFromTimeStamp(rs.getTimestamp("valid_from_timestamp"));
propertyHistory.setValidUntilTimeStamp(rs.getTimestamp("valid_until_timestamp")); propertyHistory.setValidUntilTimeStamp(rs.getTimestamp("valid_until_timestamp"));
propertyHistory.setPersIdAuthor(rs.getLong("pers_id_author")); propertyHistory.setPersIdAuthor(rs.getLong("pers_id_author"));
......
...@@ -77,7 +77,7 @@ public class PropertiesHistoryTest extends SystemTestCase ...@@ -77,7 +77,7 @@ public class PropertiesHistoryTest extends SystemTestCase
List<PropertyHistory> history = getExperimentPropertiesHistory(id.getId()); List<PropertyHistory> history = getExperimentPropertiesHistory(id.getId());
assertEquals( assertEquals(
"[BACTERIUM: material:34<a:2>, DESCRIPTION: A simple experiment<a:1>, GENDER: term:11<a:1>]", "[BACTERIUM: material:BACTERIUM-X [BACTERIUM]<a:2>, DESCRIPTION: A simple experiment<a:1>, GENDER: term:MALE [GENDER]<a:1>]",
history.toString()); history.toString());
} }
...@@ -112,7 +112,7 @@ public class PropertiesHistoryTest extends SystemTestCase ...@@ -112,7 +112,7 @@ public class PropertiesHistoryTest extends SystemTestCase
assertEquals(0, commonClientService.getExperimentInfo(id).getProperties().size()); assertEquals(0, commonClientService.getExperimentInfo(id).getProperties().size());
List<PropertyHistory> history = getExperimentPropertiesHistory(id.getId()); List<PropertyHistory> history = getExperimentPropertiesHistory(id.getId());
assertEquals( assertEquals(
"[BACTERIUM: material:34<a:2>, DESCRIPTION: A simple experiment<a:1>, GENDER: term:11<a:1>]", "[BACTERIUM: material:BACTERIUM-X [BACTERIUM]<a:2>, DESCRIPTION: A simple experiment<a:1>, GENDER: term:MALE [GENDER]<a:1>]",
history.toString()); history.toString());
} }
...@@ -146,7 +146,7 @@ public class PropertiesHistoryTest extends SystemTestCase ...@@ -146,7 +146,7 @@ public class PropertiesHistoryTest extends SystemTestCase
List<PropertyHistory> history = getSamplePropertiesHistory(id.getId()); List<PropertyHistory> history = getSamplePropertiesHistory(id.getId());
assertEquals( assertEquals(
"[BACTERIUM: material:34<a:1>, COMMENT: very advanced stuff<a:1>, GENDER: term:11<a:2>]", "[BACTERIUM: material:BACTERIUM-X [BACTERIUM]<a:1>, COMMENT: very advanced stuff<a:1>, GENDER: term:MALE [GENDER]<a:2>]",
history.toString()); history.toString());
} }
...@@ -178,7 +178,7 @@ public class PropertiesHistoryTest extends SystemTestCase ...@@ -178,7 +178,7 @@ public class PropertiesHistoryTest extends SystemTestCase
assertEquals(3, genericClientService.getSampleInfo(id).getProperties().size()); assertEquals(3, genericClientService.getSampleInfo(id).getProperties().size());
List<PropertyHistory> history = getSamplePropertiesHistory(id.getId()); List<PropertyHistory> history = getSamplePropertiesHistory(id.getId());
assertEquals( assertEquals(
"[BACTERIUM: material:34<a:1>, COMMENT: very advanced stuff<a:1>, GENDER: term:11<a:2>]", "[BACTERIUM: material:BACTERIUM-X [BACTERIUM]<a:1>, COMMENT: very advanced stuff<a:1>, GENDER: term:MALE [GENDER]<a:2>]",
history.toString()); history.toString());
} }
...@@ -208,7 +208,7 @@ public class PropertiesHistoryTest extends SystemTestCase ...@@ -208,7 +208,7 @@ public class PropertiesHistoryTest extends SystemTestCase
List<PropertyHistory> history = getDataSetPropertiesHistory(id.getId()); List<PropertyHistory> history = getDataSetPropertiesHistory(id.getId());
assertEquals( assertEquals(
"[BACTERIUM: material:22<a:1>, COMMENT: no comment<a:1>, GENDER: term:12<a:1>]", "[BACTERIUM: material:BACTERIUM1 [BACTERIUM]<a:1>, COMMENT: no comment<a:1>, GENDER: term:FEMALE [GENDER]<a:1>]",
history.toString()); history.toString());
} }
...@@ -238,7 +238,7 @@ public class PropertiesHistoryTest extends SystemTestCase ...@@ -238,7 +238,7 @@ public class PropertiesHistoryTest extends SystemTestCase
assertEquals(1, genericClientService.getDataSetInfo(id).getProperties().size()); assertEquals(1, genericClientService.getDataSetInfo(id).getProperties().size());
List<PropertyHistory> history = getDataSetPropertiesHistory(id.getId()); List<PropertyHistory> history = getDataSetPropertiesHistory(id.getId());
assertEquals( assertEquals(
"[BACTERIUM: material:22<a:1>, COMMENT: no comment<a:1>, GENDER: term:12<a:1>]", "[BACTERIUM: material:BACTERIUM1 [BACTERIUM]<a:1>, COMMENT: no comment<a:1>, GENDER: term:FEMALE [GENDER]<a:1>]",
history.toString()); history.toString());
} }
......
...@@ -29,9 +29,9 @@ public class PropertyHistory ...@@ -29,9 +29,9 @@ public class PropertyHistory
private String value; private String value;
private Long termID; private String term;
private Long materialID; private String material;
private Long persIdAuthor; private Long persIdAuthor;
...@@ -79,14 +79,14 @@ public class PropertyHistory ...@@ -79,14 +79,14 @@ public class PropertyHistory
this.value = value; this.value = value;
} }
public void setTermID(Long termID) public void setTerm(String term)
{ {
this.termID = termID; this.term = term;
} }
public void setMaterialID(Long materialID) public void setMaterial(String material)
{ {
this.materialID = materialID; this.material = material;
} }
@Override @Override
...@@ -98,13 +98,13 @@ public class PropertyHistory ...@@ -98,13 +98,13 @@ public class PropertyHistory
{ {
builder.append(' ').append(value); builder.append(' ').append(value);
} }
if (termID != null) if (term != null)
{ {
builder.append(" term:").append(termID); builder.append(" term:").append(term);
} }
if (materialID != null) if (material != null)
{ {
builder.append(" material:").append(materialID); builder.append(" material:").append(material);
} }
builder.append("<a:" + persIdAuthor + ">"); builder.append("<a:" + persIdAuthor + ">");
return builder.toString(); return builder.toString();
......
...@@ -247,7 +247,7 @@ public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringCo ...@@ -247,7 +247,7 @@ public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringCo
{ {
List<PropertyHistory> list = List<PropertyHistory> list =
simpleJdbcTemplate simpleJdbcTemplate
.query("select t.code, h.value, h.cvte_id, h.mate_prop_id, h.pers_id_author," .query("select t.code, h.value, h.vocabulary_term, h.material, h.pers_id_author,"
+ " h.valid_from_timestamp, h.valid_until_timestamp" + " h.valid_from_timestamp, h.valid_until_timestamp"
+ " from material_properties_history as h " + " from material_properties_history as h "
+ " join material_type_property_types as etpt on h.mtpt_id = etpt.id" + " join material_type_property_types as etpt on h.mtpt_id = etpt.id"
...@@ -261,7 +261,7 @@ public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringCo ...@@ -261,7 +261,7 @@ public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringCo
{ {
List<PropertyHistory> list = List<PropertyHistory> list =
simpleJdbcTemplate simpleJdbcTemplate
.query("select t.code, h.value, h.cvte_id, h.mate_prop_id, h.pers_id_author," .query("select t.code, h.value, h.vocabulary_term, h.material, h.pers_id_author,"
+ " h.valid_from_timestamp, h.valid_until_timestamp" + " h.valid_from_timestamp, h.valid_until_timestamp"
+ " from experiment_properties_history as h " + " from experiment_properties_history as h "
+ " join experiment_type_property_types as etpt on h.etpt_id = etpt.id" + " join experiment_type_property_types as etpt on h.etpt_id = etpt.id"
...@@ -275,7 +275,7 @@ public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringCo ...@@ -275,7 +275,7 @@ public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringCo
{ {
List<PropertyHistory> list = List<PropertyHistory> list =
simpleJdbcTemplate simpleJdbcTemplate
.query("select t.code, h.value, h.cvte_id, h.mate_prop_id, h.pers_id_author," .query("select t.code, h.value, h.vocabulary_term, h.material, h.pers_id_author,"
+ " h.valid_from_timestamp, h.valid_until_timestamp" + " h.valid_from_timestamp, h.valid_until_timestamp"
+ " from sample_properties_history as h " + " from sample_properties_history as h "
+ " join sample_type_property_types as etpt on h.stpt_id = etpt.id" + " join sample_type_property_types as etpt on h.stpt_id = etpt.id"
...@@ -289,7 +289,7 @@ public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringCo ...@@ -289,7 +289,7 @@ public abstract class SystemTestCase extends AbstractTransactionalTestNGSpringCo
{ {
List<PropertyHistory> list = List<PropertyHistory> list =
simpleJdbcTemplate simpleJdbcTemplate
.query("select t.code, h.value, h.cvte_id, h.mate_prop_id, h.pers_id_author," .query("select t.code, h.value, h.vocabulary_term, h.material, h.pers_id_author,"
+ " h.valid_from_timestamp, h.valid_until_timestamp" + " h.valid_from_timestamp, h.valid_until_timestamp"
+ " from data_set_properties_history as h " + " from data_set_properties_history as h "
+ " join data_set_type_property_types as etpt on h.dstpt_id = etpt.id" + " join data_set_type_property_types as etpt on h.dstpt_id = etpt.id"
......
...@@ -96,7 +96,8 @@ public class GeneralInformationChangingServiceTest extends SystemTestCase ...@@ -96,7 +96,8 @@ public class GeneralInformationChangingServiceTest extends SystemTestCase
.getParent()); .getParent());
List<PropertyHistory> history = getSamplePropertiesHistory(id.getId()); List<PropertyHistory> history = getSamplePropertiesHistory(id.getId());
assertEquals("[ANY_MATERIAL: material:41<a:1>, ORGANISM: term:9<a:1>, SIZE: 321<a:1>]", assertEquals(
"[ANY_MATERIAL: material:2 [GENE]<a:1>, ORGANISM: term:GORILLA [ORGANISM]<a:1>, SIZE: 321<a:1>]",
history.toString()); history.toString());
} }
......
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