Skip to content
Snippets Groups Projects
Commit fbf845ab authored by Adam Laskowski's avatar Adam Laskowski
Browse files

SSDM-55: fixed create property and jython tests.

parent b0293c32
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -207,7 +207,8 @@ public class CreatePropertyTypeExecutor ...@@ -207,7 +207,8 @@ public class CreatePropertyTypeExecutor
propertyType.setSchema(creation.getSchema()); propertyType.setSchema(creation.getSchema());
propertyType.setTransformation(creation.getTransformation()); propertyType.setTransformation(creation.getTransformation());
propertyType.setMetaData(creation.getMetaData()); propertyType.setMetaData(creation.getMetaData());
propertyType.setMultiValue(creation.isMultiValue()); propertyType.setMultiValue(
creation.isMultiValue() != null && creation.isMultiValue());
propertyTypes.add(propertyType); propertyTypes.add(propertyType);
} }
......
...@@ -284,7 +284,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit ...@@ -284,7 +284,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit
{ {
JythonManagedPropertyEvaluator evaluator = JythonManagedPropertyEvaluator evaluator =
new JythonManagedPropertyEvaluator("def updateFromUI(action):\n" new JythonManagedPropertyEvaluator("def updateFromUI(action):\n"
+ " property.setValue(person.getUserId() + ';' + person.getUserName())"); + " property.setStringValue(person.getUserId() + ';' + person.getUserName())");
ManagedProperty property = new ManagedProperty(); ManagedProperty property = new ManagedProperty();
property.setPropertyTypeCode("p"); property.setPropertyTypeCode("p");
IPerson person = new PersonAdapter("jbravo", "Johny", "Bravo"); IPerson person = new PersonAdapter("jbravo", "Johny", "Bravo");
...@@ -448,7 +448,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit ...@@ -448,7 +448,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit
{ {
JythonManagedPropertyEvaluator evaluator = JythonManagedPropertyEvaluator evaluator =
new JythonManagedPropertyEvaluator("def updateFromBatchInput(bindings):\n" new JythonManagedPropertyEvaluator("def updateFromBatchInput(bindings):\n"
+ " property.setValue(bindings.get(''))"); + " property.setStringValue(bindings.get(''))");
ManagedProperty property = new ManagedProperty(); ManagedProperty property = new ManagedProperty();
property.setPropertyTypeCode("p"); property.setPropertyTypeCode("p");
IPerson person = new PersonAdapter("test", null, null); IPerson person = new PersonAdapter("test", null, null);
...@@ -466,7 +466,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit ...@@ -466,7 +466,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit
JythonManagedPropertyEvaluator evaluator = JythonManagedPropertyEvaluator evaluator =
new JythonManagedPropertyEvaluator("def batchColumnNames():\n return ['A', 'B']\n" new JythonManagedPropertyEvaluator("def batchColumnNames():\n return ['A', 'B']\n"
+ "def updateFromBatchInput(bindings):\n" + "def updateFromBatchInput(bindings):\n"
+ " property.setValue(bindings.get('A') + bindings.get('B'))"); + " property.setStringValue(bindings.get('A') + bindings.get('B'))");
ManagedProperty property = new ManagedProperty(); ManagedProperty property = new ManagedProperty();
property.setPropertyTypeCode("p"); property.setPropertyTypeCode("p");
IPerson person = new PersonAdapter("test", null, null); IPerson person = new PersonAdapter("test", null, null);
...@@ -486,7 +486,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit ...@@ -486,7 +486,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit
new JythonManagedPropertyEvaluator( new JythonManagedPropertyEvaluator(
"def batchColumnNames():\n return ['BC1', 'BC2']\n" "def batchColumnNames():\n return ['BC1', 'BC2']\n"
+ "def updateFromBatchInput(bindings):\n" + "def updateFromBatchInput(bindings):\n"
+ " property.setValue(bindings.get('BC1') + ' ' + " + " property.setStringValue(bindings.get('BC1') + ' ' + "
+ "bindings.get('BC2') + ' ' + " + "bindings.get('BC2') + ' ' + "
+ "bindings.get(originalColumnNameBindingKey('OC')))"); + "bindings.get(originalColumnNameBindingKey('OC')))");
ManagedProperty property = new ManagedProperty(); ManagedProperty property = new ManagedProperty();
...@@ -507,7 +507,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit ...@@ -507,7 +507,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit
{ {
JythonManagedPropertyEvaluator evaluator = JythonManagedPropertyEvaluator evaluator =
new JythonManagedPropertyEvaluator("def updateFromBatchInput(bindings):\n" new JythonManagedPropertyEvaluator("def updateFromBatchInput(bindings):\n"
+ " property.setValue(person.getUserId() + ';' + person.getUserName())"); + " property.setStringValue(person.getUserId() + ';' + person.getUserName())");
ManagedProperty property = new ManagedProperty(); ManagedProperty property = new ManagedProperty();
property.setPropertyTypeCode("p"); property.setPropertyTypeCode("p");
IPerson person = new PersonAdapter("jbravo", "Johny", "Bravo"); IPerson person = new PersonAdapter("jbravo", "Johny", "Bravo");
...@@ -523,7 +523,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit ...@@ -523,7 +523,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit
{ {
JythonManagedPropertyEvaluator evaluator = JythonManagedPropertyEvaluator evaluator =
new JythonManagedPropertyEvaluator("def updateFromBatchInput(bindings):\n" new JythonManagedPropertyEvaluator("def updateFromBatchInput(bindings):\n"
+ " property.setValue(person.getUserId() + ';' + person.getUserName())"); + " property.setStringValue(person.getUserId() + ';' + person.getUserName())");
ManagedProperty property = new ManagedProperty(); ManagedProperty property = new ManagedProperty();
property.setPropertyTypeCode("p"); property.setPropertyTypeCode("p");
IPerson person = new PersonAdapter("jbravo", null, null); IPerson person = new PersonAdapter("jbravo", null, null);
...@@ -539,7 +539,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit ...@@ -539,7 +539,7 @@ public class JythonManagedPropertyEvaluatorTest extends AssertJUnit
{ {
JythonManagedPropertyEvaluator evaluator = JythonManagedPropertyEvaluator evaluator =
new JythonManagedPropertyEvaluator("def updateFromBatchInput(bindings):\n" new JythonManagedPropertyEvaluator("def updateFromBatchInput(bindings):\n"
+ " property.setValue(person)"); + " property.setStringValue(person)");
ManagedProperty property = new ManagedProperty(); ManagedProperty property = new ManagedProperty();
property.setPropertyTypeCode("p"); property.setPropertyTypeCode("p");
Map<String, String> bindings = new HashMap<String, String>(); Map<String, String> bindings = new HashMap<String, String>();
......
...@@ -6,7 +6,7 @@ def updateFromUI(action): ...@@ -6,7 +6,7 @@ def updateFromUI(action):
if inputValue is None: if inputValue is None:
inputValue = 'null' inputValue = 'null'
value = value + input.getLabel() + '=' + inputValue + '|' value = value + input.getLabel() + '=' + inputValue + '|'
property.setValue(value) property.setStringValue(value)
elif action.getName() == 'a2': elif action.getName() == 'a2':
value = 'a2!' value = 'a2!'
for input in action.getInputWidgetDescriptions(): for input in action.getInputWidgetDescriptions():
...@@ -14,6 +14,6 @@ def updateFromUI(action): ...@@ -14,6 +14,6 @@ def updateFromUI(action):
if inputValue is None: if inputValue is None:
inputValue = 'null' inputValue = 'null'
value = value + input.getLabel() + '=' + inputValue + '!' value = value + input.getLabel() + '=' + inputValue + '!'
property.setValue(value) property.setStringValue(value)
else: else:
raise ValidationException('action ' + action.getName() + ' is not supported') raise ValidationException('action ' + action.getName() + ' is not supported')
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment