Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,27 @@ public static void valueTypes(WrapperCloud wrapper) throws Exception {

assertNotNull("Value of " + property.getName() + " is null. ", value);
assertTrue(AspectPropertyValue.class.isAssignableFrom(value.getClass()));
AspectPropertyValue<?> propertyValue =
(AspectPropertyValue<?>) value;
// A property the 51Degrees client script populates, such
// as HasWebDriver or IsVisible, has no value at all on a
// request that carries no client script evidence, and
// this request carries none. Asking such a value for its
// type throws, so what is checked here is that the reason
// for there being no value was given, which is what a
// caller reads.
if (propertyValue.hasValue() == false) {
assertNotNull("Property '" + property.getName() +
"' has no value and no reason was given.",
propertyValue.getNoValueMessage());
continue;
}
assertTrue("Value of '" + property.getName() +
"' was of type " + ((AspectPropertyValue<?>) value).getValue().getClass().getSimpleName() +
"' was of type " + propertyValue.getValue().getClass().getSimpleName() +
" but should have been " + expectedType.getSimpleName() +
".",
expectedType.isAssignableFrom(
((AspectPropertyValue<?>) value).getValue().getClass()));
propertyValue.getValue().getClass()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,27 @@ public static void valueTypes(Wrapper wrapper) throws Exception {
expectedType = property.getType();
assertNotNull("Value of " + property.getName() + " is null. ", value);
assertTrue(AspectPropertyValue.class.isAssignableFrom(value.getClass()));
AspectPropertyValue<?> propertyValue =
(AspectPropertyValue<?>) value;
// A property the 51Degrees client script populates, such
// as HasWebDriver or IsVisible, has no value at all on a
// request that carries no client script evidence, and
// this request carries none. Asking such a value for its
// type throws, so what is checked here is that the reason
// for there being no value was given, which is what a
// caller reads.
if (propertyValue.hasValue() == false) {
assertNotNull("Property '" + property.getName() +
"' has no value and no reason was given.",
propertyValue.getNoValueMessage());
continue;
}
assertTrue("Value of '" + property.getName() +
"' was of type " + ((AspectPropertyValue<?>) value).getValue().getClass().getSimpleName() +
"' was of type " + propertyValue.getValue().getClass().getSimpleName() +
" but should have been " + expectedType.getSimpleName() +
".",
expectedType.isAssignableFrom(
((AspectPropertyValue<?>) value).getValue().getClass()));
propertyValue.getValue().getClass()));
}
}
}
Expand Down
Loading