Package org.apache.stanbol.entityhub.servicesapi.yard

Examples of org.apache.stanbol.entityhub.servicesapi.yard.Yard.create()


    @Test(expected = IllegalArgumentException.class)
    public void testCreateWithExistingId() throws YardException {
        Yard yard = getYard();
        Representation test = create();
        assertNotNull(test);
        yard.create(test.getId()); // throws an IllegalArgumentException
    }

    @Test(expected = IllegalArgumentException.class)
    public void testIsRepresentationWithNull() throws YardException {
        getYard().isRepresentation(null);
View Full Code Here


        String field = "urn:the.field:used.for.this.Test";
        String testValue = "This is a test";
        Yard yard = getYard();
        // use both ways to add the two Representations (should make no differences,
        // but one never can know ...
        Representation test1 = yard.create(id); // create and add
        Representation test2 = yard.getValueFactory().createRepresentation(id2); // create
        test2.add(field, testValue); // add value
        yard.store(test2);// store
        assertTrue(yard.isRepresentation(test1.getId())); // test if stored
        assertTrue(yard.isRepresentation(test2.getId()));
View Full Code Here

        // NOTE: This test needs not to use the create(..) method, because we
        // remove the created representation form the store anyway as part of the
        // test
        String id = "urn:yard.test.testRemoveRepresentationsWithNullValue:representation.id";
        Yard yard = getYard();
        Representation test = yard.create(id); // create and add
        assertTrue(yard.isRepresentation(test.getId()));
        yard.remove(Arrays.asList(test.getId(), null));
        assertFalse(yard.isRepresentation(test.getId()));
    }
View Full Code Here

        // remove the created representation form the store anyway as part of the
        // test
        String id = "urn:yard.test.testRemoveRepresentationsWithNullValue:representation.stored";
        String id2 = "urn:yard.test.testRemoveRepresentationsWithNullValue:representation.notStored";
        Yard yard = getYard();
        Representation test = yard.create(id); // create and add
        assertTrue(yard.isRepresentation(test.getId()));
        yard.remove(Arrays.asList(test.getId(), id2));
        assertFalse(yard.isRepresentation(test.getId()));
        assertFalse(yard.isRepresentation(id2));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.