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

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


    @Test
    public void testFindInstances() throws Exception {

        // The remote interface is asked for instances, which are returned as data objects
        final DummyObjectData instanceData =
            new DummyObjectData(new TestProxyOid(12, true), Movie.class.getName(), true, new TestProxyVersion(3));

        // The data then needs to be decoded into the ObjectAdapter
        final TestProxyAdapter dummyObjectAdapter = new TestProxyAdapter();
        // new DummyOid(12, true), ResolveState.GHOST, "test");
        dummyObjectAdapter.setupObject(new Movie());
View Full Code Here


    @Ignore("need to get working after refactoring")
    @Test
    public void testResolveImmediately() throws Exception {

        final TestProxyAdapter object = new TestProxyAdapter();
        object.setupOid(new TestProxyOid(5));
        object.setupResolveState(ResolveState.GHOST);

        final IdentityData identityData = new DummyReferenceData();
        final ObjectData objectData = new DummyObjectData();
        final ResolveObjectRequest request = new ResolveObjectRequest(session, identityData);
View Full Code Here

                distributionShouldExecuteClientActionForBothChangedObjects(movieData, directorData);
            }

            private DummyObjectData encoderShouldCreateGraphForChangedMovie(final TestProxyAdapter movieAdapter) {
                final DummyObjectData movieData =
                    new DummyObjectData(new TestProxyOid(12, true), Movie.class.getName(), true,
                        new TestProxyVersion(4));
                final DummyEncodeableObjectData expectedMovieName =
                    new DummyEncodeableObjectData("War of the Worlds", String.class.getName());
                final DummyReferenceData expectedDirectorRef =
                    new DummyReferenceData(new TestProxyOid(14, true), Person.class.getName(), new TestProxyVersion(8));
                movieData.setFieldContent(new Data[] { expectedDirectorRef, expectedMovieName });

                one(mockEncoder).encodeGraphForChangedObject(movieAdapter, new KnownObjectsRequest());
                will(returnValue(movieData));
                return movieData;
            }

            private DummyObjectData encoderShouldCreateGraphForChangedDirector(final TestProxyAdapter directorAdapter) {
                final DummyObjectData directorData =
                    new DummyObjectData(new TestProxyOid(14, true), Person.class.getName(), true, new TestProxyVersion(
                        8));
                final DummyEncodeableObjectData expectedDirectorName =
                    new DummyEncodeableObjectData("Unknown", String.class.getName());
                directorData.setFieldContent(new Data[] { expectedDirectorName });
View Full Code Here

    @Test
    public void testClientSideActionWhereTransientObjectMadePersistent() throws Exception {

        final ObjectAdapter transientObject = system.createTransientTestObject();

        final TestProxyOid previousOid = (TestProxyOid) transientObject.getOid();
        final DummyObjectData movieData = new DummyObjectData(previousOid, Movie.class.getName(), true, null);
        final NullData directorData = new DummyNullValue(Person.class.getName());
        final DummyEncodeableObjectData nameData = new DummyEncodeableObjectData("Star Wars", String.class.getName());
        movieData.setFieldContent(new Data[] { directorData, nameData });

        mockery.checking(new Expectations() {
            {
                // this returns results data with new oid and version
                final TestProxyOid newOid = new TestProxyOid(123, true);
                newOid.setupPrevious(previousOid);
                final DummyReferenceData updateData = new DummyReferenceData(newOid, "type", new TestProxyVersion(456));

                // the server is called with data (movieData) for the object to be persisted
                one(mockDistribution).executeClientAction(with(any(ExecuteClientActionRequest.class)));
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

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.