@Override public boolean test(IPerson person) { // Get the list of values for the attribute Object[] vals = person.getAttributeValues(getAttributeName()); // No values, test passed if (vals == null) { return true; } else { // Loop through the values of the attribute, if one is equal // to the test case the test fails and returns false for (int i = 0; i < vals.length; i++) { Object obj = (Object) vals[i]; if (obj != null) { String val = getStringTransformedValue(obj); if (val.equalsIgnoreCase(testValue)) { return false; } } } // None of the values equaled the test case, test passed return true; } }
new ValueMissingTester( new TestPersonAttributesGroupTestDefinition(key1, randomStrings[0])); new ValueMissingTester(new TestPersonAttributesGroupTestDefinition(key2, testKey)); new ValueMissingTester(new TestPersonAttributesGroupTestDefinition(key3, testKey));
@Override public boolean test(IPerson person) { // Get the list of values for the attribute Object[] vals = person.getAttributeValues(getAttributeName()); // No values, test passed if (vals == null) { return true; } else { // Loop through the values of the attribute, if one is equal // to the test case the test fails and returns false for (int i = 0; i < vals.length; i++) { Object obj = (Object) vals[i]; if (obj != null) { String val = getStringTransformedValue(obj); if (val.equalsIgnoreCase(testValue)) { return false; } } } // None of the values equaled the test case, test passed return true; } }