Package org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.PersistenceCommand


        final ObjectSpecification specification = object.getSpecification();
        ObjectAdapter[] retrievedInstance = store.getInstances(new PersistenceQueryFindByTitle(specification, "changed"));
        assertEquals(0, retrievedInstance.length);

        ((TestProxyAdapter) object).setupTitleString("changed title");
        final PersistenceCommand command = store.createSaveObjectCommand(object);
        assertEquals(object, command.onObject());
        store.execute(Collections.<PersistenceCommand> singletonList(command));

        resetIdentityMap();

        retrievedInstance = store.getInstances(new PersistenceQueryFindByTitle(specification, "changed"));
View Full Code Here


        assertEquals(1, retrievedInstance.length);
        assertNotSame(object, retrievedInstance[0]);
    }

    public void testRemoveInstance() throws Exception {
        final PersistenceCommand command = store.createDestroyObjectCommand(object);
        assertEquals(object, command.onObject());
        store.execute(Collections.<PersistenceCommand> singletonList(command));

        resetIdentityMap();

        final ObjectSpecification specification = object.getSpecification();
View Full Code Here

    protected void resetIdentityMap() {
        IsisContext.getPersistenceSession().testReset();
    }

    protected void addObjectToStore(final ObjectAdapter object) {
        final PersistenceCommand command = store.createCreateObjectCommand(object);
        assertEquals(object, command.onObject());
        store.execute(Collections.<PersistenceCommand> singletonList(command));
    }
View Full Code Here

        store.hasInstances(specification);
    }

    @Test
    public void execute() throws Exception {
        final PersistenceCommand command = context.mock(PersistenceCommand.class);
        final List<PersistenceCommand> commands = new ArrayList<PersistenceCommand>();
        commands.add(command);

        context.checking(new Expectations() {
            {
View Full Code Here

    }

    @Override
    public void write(final List<PersistenceCommand> commands) {
        final ClientConnection connection = getConnection();
        PersistenceCommand currentCommand = null;
        try {
            connection.request('W', "");
            final NoSqlCommandContext context = new FileClientCommandContext(connection);
            for (final PersistenceCommand command : commands) {
                currentCommand = command;
View Full Code Here

        store.hasInstances(specification);
    }

    @Test
    public void execute() throws Exception {
        final PersistenceCommand command = context.mock(PersistenceCommand.class);
        final List<PersistenceCommand> commands = new ArrayList<PersistenceCommand>();
        commands.add(command);

        context.checking(new Expectations() {
            {
View Full Code Here

        ObjectAdapter[] retrievedInstance =
            store.getInstances(new PersistenceQueryFindByTitle(specification, "changed"));
        assertEquals(0, retrievedInstance.length);

        ((TestProxyAdapter) object).setupTitleString("changed title");
        final PersistenceCommand command = store.createSaveObjectCommand(object);
        assertEquals(object, command.onObject());
        store.execute(Collections.<PersistenceCommand> singletonList(command));

        resetIdentityMap();

        retrievedInstance = store.getInstances(new PersistenceQueryFindByTitle(specification, "changed"));
View Full Code Here

        assertEquals(1, retrievedInstance.length);
        assertNotSame(object, retrievedInstance[0]);
    }

    public void testRemoveInstance() throws Exception {
        final PersistenceCommand command = store.createDestroyObjectCommand(object);
        assertEquals(object, command.onObject());
        store.execute(Collections.<PersistenceCommand> singletonList(command));

        resetIdentityMap();

        final ObjectSpecification specification = object.getSpecification();
View Full Code Here

    }

    @Override
    public void write(final List<PersistenceCommand> commands) {
        final ClientConnection connection = getConnection();
        PersistenceCommand currentCommand = null;
        try {
            connection.request('W', "");
            final NoSqlCommandContext context = new FileClientCommandContext(connection);
            for (final PersistenceCommand command : commands) {
                currentCommand = command;
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.PersistenceCommand

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.