From 2763a48a28c348252b38b9bd86746310ef4a3071 Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Wed, 16 Dec 2009 10:08:21 +0000
Subject: [PATCH] SE-178 ETLService related tests fixed

SVN: 13960
---
 .../generic/server/ETLServiceTest.java        |  8 ++++--
 .../shared/IETLLIMSService.java.expected      | 27 ++++++++++++++++++-
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceTest.java
index 039eefabf64..710d5464e62 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/ETLServiceTest.java
@@ -448,6 +448,7 @@ public class ETLServiceTest extends AbstractServerTestCase
     public void testRegisterSample()
     {
         prepareGetSession();
+        final long id = 123456789L;
         final NewSample sample = new NewSample();
         context.checking(new Expectations()
             {
@@ -457,11 +458,14 @@ public class ETLServiceTest extends AbstractServerTestCase
 
                     one(sampleBO).define(sample);
                     one(sampleBO).save();
-
+                    one(sampleBO).getSample();
+                    SamplePE samplePE = new SamplePE();
+                    samplePE.setId(id);
+                    will(returnValue(samplePE));
                 }
             });
 
-        createService().registerSample(SESSION_TOKEN, sample);
+        assertEquals(id, createService().registerSample(SESSION_TOKEN, sample));
 
         context.assertIsSatisfied();
     }
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/IETLLIMSService.java.expected b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/IETLLIMSService.java.expected
index bc174fb40cf..8731a062eaf 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/IETLLIMSService.java.expected
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/IETLLIMSService.java.expected
@@ -30,6 +30,9 @@ import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.ListSampl
 import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.ListSamplesByPropertyPredicate;
 import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.NewSamplePredicate;
 import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.SampleOwnerIdentifierPredicate;
+import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.SampleTechIdPredicate;
+import ch.systemsx.cisd.openbis.generic.shared.basic.TechId;
+import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataSetTypeWithVocabularyTerms;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DatabaseInstance;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DeletedDataSet;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Experiment;
@@ -104,6 +107,26 @@ public interface IETLLIMSService extends IServer, ISessionProvider
     public SampleType getSampleType(String sessionToken, String sampleTypeCode)
             throws UserFailureException;
 
+    /**
+     * Returns the data set type together with assigned property types for specified data set type
+     * code.
+     */
+    @Transactional(readOnly = true)
+    @RolesAllowed(RoleSet.ETL_SERVER)
+    public DataSetTypeWithVocabularyTerms getDataSetType(String sessionToken, String dataSetTypeCode)
+            throws UserFailureException;
+    
+    /**
+     * For given sample {@link TechId} returns the corresponding list of {@link ExternalData}.
+     * 
+     * @return a sorted list of {@link ExternalData}.
+     */
+    @Transactional(readOnly = true)
+    @RolesAllowed(RoleSet.ETL_SERVER)
+    public List<ExternalData> listDataSetsBySampleID(final String sessionToken,
+            @AuthorizationGuard(guardClass = SampleTechIdPredicate.class) final TechId sampleId,
+            final boolean showOnlyDirectlyConnected) throws UserFailureException;
+
     /**
      * Lists samples using given configuration.
      * 
@@ -133,10 +156,12 @@ public interface IETLLIMSService extends IServer, ISessionProvider
 
     /**
      * Registers a new sample.
+     * 
+     * @return the technical ID of the new sample.
      */
     @Transactional
     @RolesAllowed(RoleSet.ETL_SERVER)
-    public void registerSample(final String sessionToken,
+    public long registerSample(final String sessionToken,
             @AuthorizationGuard(guardClass = NewSamplePredicate.class) final NewSample newSample)
             throws UserFailureException;
 
-- 
GitLab