Package org.apache.isis.runtimes.dflt.runtime.testsystem

Examples of org.apache.isis.runtimes.dflt.runtime.testsystem.TestProxyOid


        resetIdentityMap();
    }

    public void testGetObjectByOidWhenEmpty() {
        final ObjectSpecification spec = system.getSpecification(TestPojo.class);
        final Oid oid = new TestProxyOid(10, true);
        try {
            store.getObject(oid, spec);
            fail();
        } catch (final ObjectNotFoundException expected) {
        }
View Full Code Here


    private TestProxyOid registerService15() {
        return registerService(15);
    }

    private TestProxyOid registerService(final int id) {
        final TestProxyOid oid = new TestProxyOid(id);
        store.registerService("service name", oid);
        resetIdentityMap();
        return oid;
    }
View Full Code Here

public class TestProxyOid_ValueType extends ValueTypeContractTestAbstract<TestProxyOid> {

    @Override
    protected List<TestProxyOid> getObjectsWithSameValue() {
        return Arrays.asList(new TestProxyOid(1, true), new TestProxyOid(1, true));
    }
View Full Code Here

        return Arrays.asList(new TestProxyOid(1, true), new TestProxyOid(1, true));
    }

    @Override
    protected List<TestProxyOid> getObjectsWithDifferentValue() {
        return Arrays.asList(new TestProxyOid(1, false), new TestProxyOid(2, true));
    }
View Full Code Here

        assertEquals(ResolveState.TRANSIENT, adapter.getResolveState());
    }

    @Test
    public void testOid() throws Exception {
        assertEquals(new TestProxyOid(1, false), oid);
    }
View Full Code Here

    public void test2ndPersistentCreationHasDifferentOid() {
        final TestPojo pojo = new TestPojo();
        final ObjectAdapter adapter2 = system.createTransientTestObject(pojo);

        assertNotNull(adapter2);
        assertEquals(new TestProxyOid(2, false), adapter2.getOid());
    }
View Full Code Here

    public void test2ndPersistentCreationHasDifferentOid() {
        final TestPojo pojo = new TestPojo();
        final ObjectAdapter adapter2 = system.createPersistentTestObject(pojo);

        assertNotNull(adapter2);
        assertEquals(new TestProxyOid(90001, true), adapter2.getOid());
    }
View Full Code Here

        assertNotNull(adapter2);
        assertEquals(new TestProxyOid(90001, true), adapter2.getOid());
    }

    public void testOidChanged() throws Exception {
        assertEquals(new TestProxyOid(90000, true), oid);
    }
View Full Code Here

        assertEquals(new TestProxyOid(90000, true), oid);
    }

    public void testOidHasPrevious() throws Exception {
        assertNotNull(oid.getPrevious());
        assertEquals(new TestProxyOid(1, false), oid.getPrevious());
    }
View Full Code Here

        system.shutdown();
    }

    @Test
    public void testRestoreCreatesNewAdapter() {
        final DummyObjectData data = new DummyObjectData(new TestProxyOid(5, true), Movie.class.getName(), true, new TestProxyVersion(3));
        final DummyEncodeableObjectData name = new DummyEncodeableObjectData("ET", "java.lang.String");
        final DummyNullValue reference = new DummyNullValue(Person.class.getName());
        // note - the order of the fields is by name, not the order that are
        // defined in the specification
        data.setFieldContent(new Data[] { reference, name });

        final ObjectAdapter object = encoder.decode(data);

        assertTrue(object.getObject() instanceof Movie);

        final Movie movie = (Movie) object.getObject();
        assertEquals("ET", movie.getName());
        assertEquals(new TestProxyOid(5, true), object.getOid());
        assertEquals(new TestProxyVersion(3), object.getVersion());

    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.testsystem.TestProxyOid

Copyright © 2018 www.massapicom. 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.