// Return the array of standard bindings + the pos of the added binding
IndexedArray result = new IndexedArray();
// Scan for the standard binding
ManagedProperty prop = properties.get("standardBindings");
assertNotNull("Missing property standardBindings", prop);
MetaValue val = prop.getValue();
assertNotNull("property standardBindings has no value", val);
assertTrue("property standardBindings value is CollectionValue", val instanceof CollectionValue);
MetaValue[] refreshedElements = ((CollectionValue) val).getElements();
// FIXME Using a fixed count of expected # of bindings is stupid; it changes whenever
// new stuff is added or old stuff removed. Here we just confirm there are a
// reasonable # of bindings (as of 12/2009 there are > 25) which is also stupid
// but a bit less so
assertTrue(refreshedElements.length > 10);
result.array = refreshedElements; // pass back to caller
boolean sawAdded = false;
for (int i = 0; i < refreshedElements.length; i++)
{
MetaValue mv = refreshedElements[i];
if ("AddedStandardBinding".equals(getSimpleValue(mv, "serviceName")))
{
sawAdded = true;
assertEquals("correct bindingName in standard binding", "bindingName", getSimpleValue(mv, "bindingName"));
assertEquals("correct description in standard binding", "description", getSimpleValue(mv, "description"));
assertNull("correct hostName in standardBinding", getSimpleValue(mv, "hostName"));
assertEquals("correct port in standard binding", basePort, getSimpleValue(mv, "port", Integer.class).intValue());
assertFalse("correct fixedPort in standard binding", getSimpleValue(mv, "fixedPort", Boolean.class).booleanValue());
assertFalse("correct fixedHostName in standard binding", getSimpleValue(mv, "fixedHostName", Boolean.class).booleanValue());
result.index = i; // tell caller which pos has the added binding
break;
}
}
assertTrue("saw standard binding", sawAdded);
// Check that our standard binding metadata generated the expected actual bindings
prop = properties.get("serviceBindings");
assertNotNull("Missing property serviceBindings", prop);
log.info("serviceBindings: " + prop);
val = prop.getValue();
assertNotNull("property serviceBindings has no value", val);
assertTrue("property serviceBindings value is CompositeValue", val instanceof CompositeValue);
CompositeValue compVal = (CompositeValue) val;
assertEquals("correct number of standard bindings", offsets.size(), compVal.values().size());
for (String bindingSetName : offsets.keySet())