From 19aeaacbfda5dfadeef9ec0b85f70e521b2103f3 Mon Sep 17 00:00:00 2001 From: buczekp <buczekp> Date: Mon, 22 Nov 2010 14:07:34 +0000 Subject: [PATCH] [LMS-1858] fixed test expectations SVN: 18841 --- .../bo/dynamic_property/DynamicPropertyEvaluator.java | 3 +-- .../DynamicPropertyEvaluatorTest.java | 11 +++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/dynamic_property/DynamicPropertyEvaluator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/dynamic_property/DynamicPropertyEvaluator.java index 10193d91711..3e7af59a069 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/dynamic_property/DynamicPropertyEvaluator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/dynamic_property/DynamicPropertyEvaluator.java @@ -29,10 +29,10 @@ import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; import ch.systemsx.cisd.openbis.generic.server.business.bo.EntityPropertiesConverter; import ch.systemsx.cisd.openbis.generic.server.business.bo.EntityPropertiesConverter.ComplexPropertyValueHelper; +import ch.systemsx.cisd.openbis.generic.server.business.bo.IEntityPropertiesConverter; import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.calculator.DynamicPropertyCalculator; import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.calculator.EntityAdaptorFactory; import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.calculator.IEntityAdaptor; -import ch.systemsx.cisd.openbis.generic.server.business.bo.IEntityPropertiesConverter; import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory; import ch.systemsx.cisd.openbis.generic.shared.basic.BasicConstant; import ch.systemsx.cisd.openbis.generic.shared.dto.EntityPropertyPE; @@ -174,7 +174,6 @@ public class DynamicPropertyEvaluator implements IDynamicPropertyEvaluator } final DynamicPropertyCalculator calculator = getCalculator(etpt.getScript()); calculator.setEntity(entityAdaptor); - etpt.getEntityType().getEntityKind(); final String dynamicValue = calculator.evalAsString(); final String validatedValue = entityPropertiesConverter.tryCreateValidatedPropertyValue(etpt.getEntityType() diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/dynamic_property/DynamicPropertyEvaluatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/dynamic_property/DynamicPropertyEvaluatorTest.java index 86da15df45a..5218fb7a289 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/dynamic_property/DynamicPropertyEvaluatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/dynamic_property/DynamicPropertyEvaluatorTest.java @@ -27,7 +27,7 @@ import org.testng.AssertJUnit; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.DynamicPropertyEvaluator; +import ch.systemsx.cisd.common.logging.LogInitializer; import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.calculator.AbstractEntityAdaptor; import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.calculator.BasicPropertyAdaptor; import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.calculator.IEntityAdaptor; @@ -41,6 +41,7 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.EntityTypePropertyTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePropertyPE; +import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.SampleTypePropertyTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.ScriptPE; @@ -57,6 +58,7 @@ public class DynamicPropertyEvaluatorTest extends AssertJUnit @BeforeMethod public void setUp() { + LogInitializer.init(); daoFactory = new Mockery().mock(IDAOFactory.class); evaluator = new DynamicPropertyEvaluator(daoFactory); } @@ -202,9 +204,9 @@ public class DynamicPropertyEvaluatorTest extends AssertJUnit sample = createSample("s1", properties); evaluator.evaluateProperties(sample); // cyclic dependency should be found - assertEquals(expectedCyclicDependencyErrorMessage(dp1, dp2, dp3, dp1), dp1.getValue()); - assertEquals(expectedCyclicDependencyErrorMessage(dp1, dp2, dp3, dp1), dp2.getValue()); - assertEquals(expectedCyclicDependencyErrorMessage(dp1, dp2, dp3, dp1), dp3.getValue()); + assertEquals(expectedCyclicDependencyErrorMessage(dp2, dp3, dp1, dp2), dp1.getValue()); + assertEquals(expectedCyclicDependencyErrorMessage(dp2, dp3, dp1, dp2), dp2.getValue()); + assertEquals(expectedCyclicDependencyErrorMessage(dp2, dp3, dp1, dp2), dp3.getValue()); } // @@ -303,6 +305,7 @@ public class DynamicPropertyEvaluatorTest extends AssertJUnit assignment.setPropertyType(propertyType); assignment.setDynamic(true); assignment.setScript(script); + assignment.setEntityType(new SampleTypePE()); return assignment; } -- GitLab