inner
);
//
// Create the proxy node.
Node created = outer.create(
URI.create("urn:node/000"),
URI.create("urn:type/created")
);
//
// Check the created node property.
assertEquals(
"0",
created.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
//
// Re-request the node.
Node selected = outer.select(
created.ident()
);
//
// Check the node properties.
assertEquals(
"1",
created.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
assertEquals(
"1",
selected.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
//
// Check they are the same thing.
assertEquals(
created,
selected
);
assertSame(
created,
selected
);
//
// Update the node.
Node updated = outer.update(
created.ident(),
new SimpleDateProperty(
created,
URI.create("urn:property/timestamp"),
new Date()
)
);
assertEquals(
"2",
created.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
assertEquals(
"2",
selected.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
assertEquals(
"2",
updated.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
//
// Update the node.
selected.properties().set(
URI.create("urn:property/colour"),
"green"
);
assertEquals(
"green",
created.properties().get(
URI.create("urn:property/colour")
).value()
);
assertEquals(
"green",
selected.properties().get(
URI.create("urn:property/colour")
).value()
);
assertEquals(
"green",
updated.properties().get(
URI.create("urn:property/colour")
).value()
);
assertEquals(
"3",
created.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
assertEquals(
"3",
selected.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
assertEquals(
"3",
updated.properties().get(
CountedNodeServer.SERIAL_PROPERTY_URI
).value()
);
}