From a906a15747db4fd322f1b32138ba8c281db7873a Mon Sep 17 00:00:00 2001
From: buczekp <buczekp>
Date: Wed, 12 Jan 2011 20:57:12 +0000
Subject: [PATCH] [LMS-1949] fixed tests

SVN: 19400
---
 .../bo/EntityPropertiesConverterTest.java     | 26 ++++++++++++-------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityPropertiesConverterTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityPropertiesConverterTest.java
index 32292714271..f392f860e89 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityPropertiesConverterTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/EntityPropertiesConverterTest.java
@@ -29,6 +29,7 @@ import org.testng.annotations.Test;
 
 import ch.rinn.restrictions.Friend;
 import ch.systemsx.cisd.common.exceptions.UserFailureException;
+import ch.systemsx.cisd.common.test.RecordingMatcher;
 import ch.systemsx.cisd.openbis.generic.server.business.ManagerTestTool;
 import ch.systemsx.cisd.openbis.generic.server.dataaccess.IPropertyValueValidator;
 import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataType;
@@ -50,6 +51,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind;
  * 
  * @author Christian Ribeaud
  */
+// TODO 2010-01-11, Piotr Buczek: test dynamic and managed properties handling
 @Friend(toClasses = EntityPropertiesConverter.class)
 public final class EntityPropertiesConverterTest extends AbstractBOTest
 {
@@ -168,6 +170,9 @@ public final class EntityPropertiesConverterTest extends AbstractBOTest
     {
         final IEntityPropertiesConverter entityPropertiesConverter =
                 createEntityPropertiesConverter(EntityKind.SAMPLE);
+
+        final RecordingMatcher<Set<IEntityProperty>> definedPropertiesMatcher =
+                RecordingMatcher.create();
         context.checking(new Expectations()
             {
                 {
@@ -180,11 +185,10 @@ public final class EntityPropertiesConverterTest extends AbstractBOTest
                     one(dynamicPropertiesChecker).checkDynamicPropertiesNotManuallyUpdated(
                             with(propertiesToUpdateMatcher), with(dynamicPropertiesMatcher));
 
-                    CollectionMatcher<Set<IEntityProperty>> definedPropertiesMatcher =
-                            new CollectionMatcher<Set<IEntityProperty>>(
-                                    new HashSet<IEntityProperty>());
                     one(placeholderCreator).addDynamicPropertiesPlaceholders(
                             with(definedPropertiesMatcher), with(dynamicPropertiesMatcher));
+                    one(placeholderCreator).addManagedPropertiesPlaceholders(
+                            with(definedPropertiesMatcher), with(dynamicPropertiesMatcher));
                 }
             });
         final List<EntityPropertyPE> properties =
@@ -201,6 +205,9 @@ public final class EntityPropertiesConverterTest extends AbstractBOTest
                 createEntityPropertiesConverter(EntityKind.SAMPLE);
         final PropertyTypePE propertyTypePE = createPropertyType();
         final IEntityProperty[] properties = createSampleProperties(false);
+
+        final RecordingMatcher<Set<IEntityProperty>> definedPropertiesMatcher =
+                RecordingMatcher.create();
         context.checking(new Expectations()
             {
                 {
@@ -244,11 +251,10 @@ public final class EntityPropertiesConverterTest extends AbstractBOTest
                     {
                         listOfProperties.add(p);
                     }
-                    CollectionMatcher<Set<IEntityProperty>> definedPropertiesMatcher =
-                            new CollectionMatcher<Set<IEntityProperty>>(
-                                    new HashSet<IEntityProperty>());
                     one(placeholderCreator).addDynamicPropertiesPlaceholders(
                             with(definedPropertiesMatcher), with(dynamicPropertiesMatcher));
+                    one(placeholderCreator).addManagedPropertiesPlaceholders(
+                            with(definedPropertiesMatcher), with(dynamicPropertiesMatcher));
                 }
 
             });
@@ -278,6 +284,9 @@ public final class EntityPropertiesConverterTest extends AbstractBOTest
                 createEntityPropertiesConverter(EntityKind.SAMPLE);
         final PropertyTypePE propertyTypePE = createPropertyType();
         final IEntityProperty[] properties = createSampleProperties(true);
+
+        final RecordingMatcher<Set<IEntityProperty>> definedPropertiesMatcher =
+                RecordingMatcher.create();
         context.checking(new Expectations()
             {
                 {
@@ -302,11 +311,10 @@ public final class EntityPropertiesConverterTest extends AbstractBOTest
                     {
                         listOfProperties.add(p);
                     }
-                    CollectionMatcher<Set<IEntityProperty>> definedPropertiesMatcher =
-                            new CollectionMatcher<Set<IEntityProperty>>(
-                                    new HashSet<IEntityProperty>());
                     one(placeholderCreator).addDynamicPropertiesPlaceholders(
                             with(definedPropertiesMatcher), with(dynamicPropertiesMatcher));
+                    one(placeholderCreator).addManagedPropertiesPlaceholders(
+                            with(definedPropertiesMatcher), with(dynamicPropertiesMatcher));
                 }
             });
         final List<EntityPropertyPE> convertedProperties =
-- 
GitLab