From 8d10aa50fcd0d9823a28b1ed6fcac7cadab24eb8 Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Wed, 9 Jun 2010 20:17:40 +0000
Subject: [PATCH] [SE-255] fixed DSS tests

SVN: 16377
---
 .../etlserver/CodeExtractortTestCase.java     | 25 +++++++++----------
 .../DefaultDataSetInfoExtractorTest.java      | 21 ++++++----------
 ...etInfoExtractorForDataAcquisitionTest.java |  4 +--
 ...aSetInfoExtractorForImageAnalysisTest.java |  2 +-
 4 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/CodeExtractortTestCase.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/CodeExtractortTestCase.java
index 6c28b33d901..de2ac726668 100644
--- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/CodeExtractortTestCase.java
+++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/CodeExtractortTestCase.java
@@ -21,33 +21,32 @@ package ch.systemsx.cisd.etlserver;
  */
 public abstract class CodeExtractortTestCase
 {
-    protected static final String PREFIX = IDataSetInfoExtractor.EXTRACTOR_KEY + ".";
 
     protected static final String ENTITY_SEPARATOR =
-            PREFIX + DefaultDataSetInfoExtractor.ENTITY_SEPARATOR_PROPERTY_NAME;
-    
+            DefaultDataSetInfoExtractor.ENTITY_SEPARATOR_PROPERTY_NAME;
+
     protected static final String SUB_ENTITY_SEPARATOR =
-            PREFIX + DefaultDataSetInfoExtractor.SUB_ENTITY_SEPARATOR_PROPERTY_NAME;
+            DefaultDataSetInfoExtractor.SUB_ENTITY_SEPARATOR_PROPERTY_NAME;
 
     protected static final String INDEX_OF_SAMPLE_CODE =
-            PREFIX + DefaultDataSetInfoExtractor.INDEX_OF_SAMPLE_CODE;
+            DefaultDataSetInfoExtractor.INDEX_OF_SAMPLE_CODE;
 
     protected static final String INDEX_OF_EXPERIMENT_IDENTIFIER =
-        PREFIX + DefaultDataSetInfoExtractor.INDEX_OF_EXPERIMENT_IDENTIFIER;
-    
+            DefaultDataSetInfoExtractor.INDEX_OF_EXPERIMENT_IDENTIFIER;
+
     protected static final String INDEX_OF_PARENT_DATA_SET_CODE =
-            PREFIX + DefaultDataSetInfoExtractor.INDEX_OF_PARENT_DATA_SET_CODES;
+            DefaultDataSetInfoExtractor.INDEX_OF_PARENT_DATA_SET_CODES;
 
     protected static final String INDEX_OF_DATA_PRODUCER_CODE =
-            PREFIX + DefaultDataSetInfoExtractor.INDEX_OF_DATA_PRODUCER_CODE;
+            DefaultDataSetInfoExtractor.INDEX_OF_DATA_PRODUCER_CODE;
 
     protected static final String INDEX_OF_DATA_PRODUCTION_DATE =
-            PREFIX + DefaultDataSetInfoExtractor.INDEX_OF_DATA_PRODUCTION_DATE;
+            DefaultDataSetInfoExtractor.INDEX_OF_DATA_PRODUCTION_DATE;
 
     protected static final String DATA_PRODUCTION_DATE_FORMAT =
-            PREFIX + DefaultDataSetInfoExtractor.DATA_PRODUCTION_DATE_FORMAT;
+            DefaultDataSetInfoExtractor.DATA_PRODUCTION_DATE_FORMAT;
 
     protected static final String DATA_SET_PROPERTIES_FILE_NAME_KEY =
-            PREFIX + DefaultDataSetInfoExtractor.DATA_SET_PROPERTIES_FILE_NAME_KEY;
-    
+            DefaultDataSetInfoExtractor.DATA_SET_PROPERTIES_FILE_NAME_KEY;
+
 }
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/DefaultDataSetInfoExtractorTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/DefaultDataSetInfoExtractorTest.java
index cb485f04cc4..976bb9b4770 100644
--- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/DefaultDataSetInfoExtractorTest.java
+++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/DefaultDataSetInfoExtractorTest.java
@@ -58,7 +58,7 @@ public final class DefaultDataSetInfoExtractorTest extends CodeExtractortTestCas
     public void testExtractContainedSampleIdentifier()
     {
         Properties properties = new Properties();
-        properties.setProperty(asPropertyName(GROUP_CODE), "my-group");
+        properties.setProperty(GROUP_CODE, "my-group");
         final IDataSetInfoExtractor extractor = new DefaultDataSetInfoExtractor(properties);
 
         final DataSetInformation dsInfo1 =
@@ -77,7 +77,7 @@ public final class DefaultDataSetInfoExtractorTest extends CodeExtractortTestCas
     {
         Properties properties = new Properties();
         properties.setProperty(INDEX_OF_EXPERIMENT_IDENTIFIER, "1");
-        properties.setProperty(asPropertyName(GROUP_CODE), "my-group");
+        properties.setProperty(GROUP_CODE, "my-group");
         final IDataSetInfoExtractor extractor = new DefaultDataSetInfoExtractor(properties);
 
         final DataSetInformation dsInfo =
@@ -147,29 +147,24 @@ public final class DefaultDataSetInfoExtractorTest extends CodeExtractortTestCas
     public void testGroupCodeGlobal()
     {
         final Properties properties = new Properties();
-        properties.setProperty(asPropertyName(INDEX_OF_GROUP_CODE), "");
+        properties.setProperty(INDEX_OF_GROUP_CODE, "");
         String globalGroupCode = "g1";
-        properties.setProperty(asPropertyName(GROUP_CODE), globalGroupCode);
+        properties.setProperty(GROUP_CODE, globalGroupCode);
 
         final DataSetInformation dsInfo = extractDatasetInfo(properties, "sampleCode");
 
         assertEquals(globalGroupCode, dsInfo.getSpaceCode());
     }
 
-    private static String asPropertyName(String propertyName)
-    {
-        return IDataSetInfoExtractor.EXTRACTOR_KEY + "." + propertyName;
-    }
-
     @Test
     // set group code as the local setting for one datasets. It should override the global setting.
     public void testGroupCodeDatasetSpecific()
     {
         final Properties properties = new Properties();
-        properties.setProperty(asPropertyName(INDEX_OF_GROUP_CODE), "-2");
+        properties.setProperty(INDEX_OF_GROUP_CODE, "-2");
         String globalGroupCode = "globalGroup";
 
-        properties.setProperty(asPropertyName(GROUP_CODE), globalGroupCode);
+        properties.setProperty(GROUP_CODE, globalGroupCode);
 
         String localGroupCode = "localGroup";
         String fileName =
@@ -185,8 +180,8 @@ public final class DefaultDataSetInfoExtractorTest extends CodeExtractortTestCas
     public void testGroupCodeDatasetSpecificMissingFails()
     {
         final Properties properties = new Properties();
-        properties.setProperty(asPropertyName(INDEX_OF_GROUP_CODE), "-2");
-        properties.setProperty(asPropertyName(GROUP_CODE), "any");
+        properties.setProperty(INDEX_OF_GROUP_CODE, "-2");
+        properties.setProperty(GROUP_CODE, "any");
 
         extractDatasetInfo(properties, "sampleCode");
     }
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/threev/DataSetInfoExtractorForDataAcquisitionTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/threev/DataSetInfoExtractorForDataAcquisitionTest.java
index 3c661f9a31d..4ab98db8d3b 100644
--- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/threev/DataSetInfoExtractorForDataAcquisitionTest.java
+++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/threev/DataSetInfoExtractorForDataAcquisitionTest.java
@@ -36,10 +36,10 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
 public class DataSetInfoExtractorForDataAcquisitionTest extends CodeExtractortTestCase
 {
     private static final String INDICES_OF_DATA_SET_CODE_ENTITIES =
-            PREFIX + DataSetInfoExtractorForDataAcquisition.INDICES_OF_DATA_SET_CODE_ENTITIES;
+            DataSetInfoExtractorForDataAcquisition.INDICES_OF_DATA_SET_CODE_ENTITIES;
 
     private static final String DATA_SET_CODE_ENTITIES_GLUE =
-            PREFIX + AbstractDataSetInfoExtractorFor3V.DATA_SET_CODE_ENTITIES_GLUE;
+            AbstractDataSetInfoExtractorFor3V.DATA_SET_CODE_ENTITIES_GLUE;
 
     @Test
     public void testHappyCaseWithOnlyMandatoryPorperties()
diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/threev/DataSetInfoExtractorForImageAnalysisTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/threev/DataSetInfoExtractorForImageAnalysisTest.java
index 2680989d431..4b4330019a0 100644
--- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/threev/DataSetInfoExtractorForImageAnalysisTest.java
+++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/threev/DataSetInfoExtractorForImageAnalysisTest.java
@@ -35,7 +35,7 @@ import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation;
 public class DataSetInfoExtractorForImageAnalysisTest extends CodeExtractortTestCase
 {
     private static final String INDICES_OF_PARENT_DATA_SET_CODE_ENTITIES =
-            PREFIX + DataSetInfoExtractorForImageAnalysis.INDICES_OF_PARENT_DATA_SET_CODE_ENTITIES;
+            DataSetInfoExtractorForImageAnalysis.INDICES_OF_PARENT_DATA_SET_CODE_ENTITIES;
 
     @Test
     public void testHappyCaseWithOnlyMandatoryPorperties()
-- 
GitLab