// --------------------------------------------------------------------------------
// Create and store an object graph in the repository
// --------------------------------------------------------------------------------
MultiValue multiValue = new MultiValue();
multiValue.setPath("/test");
ArrayList values = new ArrayList();
values.add("Value1");
values.add("Value2");
values.add("Value3");
values.add("Value4");
multiValue.setMultiValues(values);
ocm.insert(multiValue);
ocm.save();
// --------------------------------------------------------------------------------
// Get the object
// --------------------------------------------------------------------------------
multiValue = (MultiValue) ocm.getObject( "/test");
assertNotNull("Object is null", multiValue);
assertNull("nullMultiValues field is not null", multiValue.getNullMultiValues());
assertTrue("Incorrect number of values", multiValue.getMultiValues().size() == 4);
assertTrue("Incorrect collection element", ((String) multiValue.getMultiValues().iterator().next()).equals("Value1"));
// --------------------------------------------------------------------------------
// Update the object
// --------------------------------------------------------------------------------
values = new ArrayList();
values.add("Value1");
values.add("Value2");
values.add("Value3");
values.add("Value4");
values.add("Value5");
multiValue.setMultiValues(values);
ocm.update(multiValue);
ocm.save();
// --------------------------------------------------------------------------------
// Get the object
// --------------------------------------------------------------------------------
multiValue = (MultiValue) ocm.getObject( "/test");
assertNotNull("Object is null", multiValue);
assertNull("nullMultiValues field is not null", multiValue.getNullMultiValues());
assertTrue("Incorrect number of values", multiValue.getMultiValues().size() == 5);
assertTrue("Incorrect collection element", ((String) multiValue.getMultiValues().iterator().next()).equals("Value1"));
}
catch (Exception e)
{