}
private void serviceBindingSetTest(MetaValue metaValue, Map<String, Integer> offsets) throws Exception
{
assertTrue(metaValue instanceof CompositeValue);
CompositeValue bindingSet = (CompositeValue) metaValue;
MetaValue val = bindingSet.get("name");
assertNotNull("property name has no value", val);
assertTrue("property name value is SimpleValue", val instanceof SimpleValue);
Object simpleVal = ((SimpleValue) val).getValue();
assertTrue(simpleVal instanceof String);
String name = (String) simpleVal;
val = bindingSet.get("defaultHostName");
assertNotNull(name + " -- property defaultHostName has no value", val);
assertEquals(name + " -- type of defaultHostName value isn't String", String.class.getName(), val.getMetaType().getClassName());
assertTrue(name + " -- property defaultHostName value is SimpleValue", val instanceof SimpleValue);
// Only do further validation of the binding sets that the AS normally ships;
// ignore any earlier ones that other tests may have added since we don't
// know the correct assertions
if ("ports-default".equals(name) || "ports-01".equals(name) || "ports-02".equals(name) || "ports-03".equals(name))
{
assertEquals(name + " -- correct defaultHostName value", InetAddress.getByName(getServerHost()), InetAddress.getByName((String) ((SimpleValue) val).getValue()));
}
val = bindingSet.get("portOffset");
assertNotNull(name + " -- property portOffset has no value", val);
assertTrue(name + " -- property portOffset value is SimpleValue", val instanceof SimpleValue);
simpleVal = ((SimpleValue) val).getValue();
assertTrue(simpleVal instanceof Integer);
assertTrue(((Integer) simpleVal).intValue() > -1);
offsets.put(name, (Integer) simpleVal);
val = bindingSet.get("overrideBindings");
assertNotNull(name + " -- property overrideBindings has no value", val);
assertTrue(name + " -- property overrideBindings value is CollectionValue", val instanceof CollectionValue);
MetaValue[] elements = ((CollectionValue) val).getElements();
getLog().info(elements);
for (MetaValue element : elements)