@@ -0,0 +1,2093 @@
+package uk.org.taverna.scufl2.api.property;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.net.URI;%0Aimport java.util.Set;%0A%0Aimport org.junit.Test;%0A%0Apublic class TestAddProperty %7B%0A%0A%09private static final URI EXAMPLE_COM = URI.create(%22http://example.com/%22);%0A%09private static final URI CONSTANT = EXAMPLE_COM.resolve(%22#constant%22);%0A%09private static final URI PROPERTY = EXAMPLE_COM.resolve(%22#property%22);%0A%09private static final URI SOME_TYPE = EXAMPLE_COM.resolve(%22#SomeType%22);%0A%0A%09@Test%0A%09public void addPropertyResource() throws Exception %7B%0A%09%09PropertyResource propertyResource = new PropertyResource();%0A%09%09PropertyResource propResource = propertyResource.addPropertyResource(PROPERTY, SOME_TYPE);%0A%09%09// No need to fill in propResource as we can check same-ness below%0A%0A%09%09Set%3CPropertyObject%3E properties = propertyResource.getProperties().get(PROPERTY);%0A%09%09assertEquals(1, properties.size());%0A%09%09assertEquals(propResource, properties.iterator().next());%0A%09%7D%0A%0A%09@Test%0A%09public void addPropertyURI() throws Exception %7B%0A%09%09PropertyResource propertyResource = new PropertyResource();%0A%09%09propertyResource.addPropertyURI(PROPERTY, CONSTANT);%0A%0A%09%09Set%3CPropertyObject%3E properties = propertyResource.getProperties().get(%0A%09%09%09%09PROPERTY);%0A%09%09assertEquals(1, properties.size());%0A%09%09PropertyResource propRes = (PropertyResource) properties.iterator()%0A%09%09.next();%0A%09%09assertEquals(CONSTANT, propRes.getResourceURI());%0A%09%09assertNull(propRes.getTypeURI());%0A%09%09assertTrue(propRes.getProperties().isEmpty());%0A%09%7D%0A%0A%09@Test%0A%09public void addStringLiteral() throws Exception %7B%0A%09%09PropertyResource propertyResource = new PropertyResource();%0A%09%09propertyResource.addProperty(PROPERTY, %22Hello there%22);%0A%0A%09%09Set%3CPropertyObject%3E properties = propertyResource.getProperties().get(PROPERTY);%0A%09%09assertEquals(1, properties.size());%0A%09%09PropertyLiteral propertyLiteral = (PropertyLiteral) properties.iterator().next();%0A%09%09assertEquals(%22Hello there%22, propertyLiteral.getLiteralValue());%0A%09%09assertEquals(PropertyLiteral.XSD_STRING, propertyLiteral.getLiteralType());%0A%09%7D%0A%0A%7D%0A

Test adding properties