From a10aa15a3d06cdc3d141fa81429179813a3fd75e Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Tue, 26 Jan 2010 12:55:24 +0000
Subject: [PATCH] SE-193 bug fixed concerning p-grade service

SVN: 14454
---
 rtd_phosphonetx/etc/passwd                               | 4 ++++
 .../phosphonetx/server/RawDataServiceInternal.java       | 9 ++++++++-
 .../source/java/phosphonetx-applicationContext.xml       | 3 ++-
 .../openbis/plugin/phosphonetx/RawDataTestClient.java    | 2 +-
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/rtd_phosphonetx/etc/passwd b/rtd_phosphonetx/etc/passwd
index e69de29bb2d..6ead36251a5 100644
--- a/rtd_phosphonetx/etc/passwd
+++ b/rtd_phosphonetx/etc/passwd
@@ -0,0 +1,4 @@
+test:a@admins.com:A:The Admin:J3fII6Pex7jnCBwF+uXz2mFuB1QVhPUi
+u:u@users.com:U:The User:dmbGKaGRmbX8YKfslMxUHObmYfjywkuT
+o:o@observers.com:O:The Observer:t53ADCnFnEFhBvHB7FPoHhbHeW2O1KJc
+etlserver::::SHGHSPawL/B3NKXD5nsu4fSrj5LwR2MX
diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java
index 3f9cca5ce6a..9dbaf9c9ddd 100644
--- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java
+++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/server/RawDataServiceInternal.java
@@ -66,6 +66,8 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern
 
     private ICommonBusinessObjectFactory businessObjectFactory;
 
+    private ISessionManager<Session> sessionManagerFromConstructor;
+
     public RawDataServiceInternal()
     {
     }
@@ -74,9 +76,14 @@ public class RawDataServiceInternal extends AbstractServer<IRawDataServiceIntern
             ICommonBusinessObjectFactory businessObjectFactory)
     {
         super(sessionManager, daoFactory);
+        sessionManagerFromConstructor = sessionManager;
         this.businessObjectFactory = businessObjectFactory;
     }
-    
+
+    public void replaceAutoWiredSesseionManagerByConstructorSessionManager()
+    {
+        sessionManager = sessionManagerFromConstructor;
+    }
 
     public IRawDataServiceInternal createLogger(boolean invocationSuccessful, long elapsedTime)
     {
diff --git a/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml b/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml
index 98883e8bd1f..7b2ea654b2d 100644
--- a/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml
+++ b/rtd_phosphonetx/source/java/phosphonetx-applicationContext.xml
@@ -65,7 +65,8 @@
     </bean>
     
     <bean id="phosphonetx-raw-data-service-internal" 
-          class="ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal">
+          class="ch.systemsx.cisd.openbis.plugin.phosphonetx.server.RawDataServiceInternal" 
+          init-method="replaceAutoWiredSesseionManagerByConstructorSessionManager">
         <constructor-arg>
             <bean class="ch.systemsx.cisd.authentication.DefaultSessionManager">
                 <constructor-arg>
diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java
index de9cb66793a..392f06676b3 100644
--- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java
+++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/RawDataTestClient.java
@@ -43,7 +43,7 @@ public class RawDataTestClient
             try
             {
                 System.out.println("User: " + user);
-                SessionContextDTO session = service.tryToAuthenticate("test_b", "t");
+                SessionContextDTO session = service.tryToAuthenticate("test", "a");
                 String sessionToken = session.getSessionToken();
                 List<Sample> samples = service.listRawDataSamples(sessionToken, user);
                 for (Sample sample : samples)
-- 
GitLab