Package org.apache.isis.core.specsupport.scenarios

Examples of org.apache.isis.core.specsupport.scenarios.InMemoryDB


    private Action addToInMemoryDB() {
        return new Action() {
           
            @Override
            public Object invoke(Invocation invocation) throws Throwable {
                final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
                final String name = (String)invocation.getParameter(0);
                final SimpleObject obj = new SimpleObject();
                obj.setName(name);
                inMemoryDB.put(SimpleObject.class, name, obj);
                return obj;
            }
           
            @Override
            public void describeTo(Description description) {
View Full Code Here


        };
    }

    // helper
    private List<SimpleObject> allSimpleObjects() {
        final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
        return inMemoryDB.findAll(SimpleObject.class);
    }
View Full Code Here

public class CatalogOfFixturesGlue extends CukeGlueAbstract {

   
    @Before(value={"@unit", "@SimpleObjectsFixture"}, order=20000)
    public void unitFixtures() throws Throwable {
        final InMemoryDB inMemoryDB = new InMemoryDBForSimpleApp(this.scenarioExecution());
        inMemoryDB.getElseCreate(SimpleObject.class, "Foo");
        inMemoryDB.getElseCreate(SimpleObject.class, "Bar");
        inMemoryDB.getElseCreate(SimpleObject.class, "Baz");
        putVar("isis", "in-memory-db", inMemoryDB);
    }
View Full Code Here

public class CatalogOfFixturesGlue extends CukeGlueAbstract {

   
    @Before(value={"@unit", "@ToDoItemsFixture"}, order=20000)
    public void unitFixtures() throws Throwable {
        final InMemoryDB inMemoryDB = new InMemoryDBForToDoApp(this.scenarioExecution());
        inMemoryDB.getElseCreate(ToDoItem.class, "Write blog post");
        inMemoryDB.getElseCreate(ToDoItem.class, "Pick up bread");
        final ToDoItem t3 = inMemoryDB.getElseCreate(ToDoItem.class, "Pick up butter");
        t3.setComplete(true);
        putVar("isis", "in-memory-db", inMemoryDB);
    }
View Full Code Here

            }
        });
    }

    private List<ToDoItem> findItems(final Predicate<ToDoItem> predicate) {
        final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
        final List<ToDoItem> items = inMemoryDB.findAll(ToDoItem.class);
        return Lists.newArrayList(Iterables.filter(items, predicate));
    }
View Full Code Here

            }
        });
    }

    private List<ToDoItem> findItems(final Predicate<ToDoItem> predicate) {
        final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
        final List<ToDoItem> items = inMemoryDB.findAll(ToDoItem.class);
        return Lists.newArrayList(Iterables.filter(items, predicate));
    }
View Full Code Here

public class CatalogOfFixturesGlue extends CukeGlueAbstract {

   
    @Before(value={"@unit", "@SimpleObjectsFixture"}, order=20000)
    public void unitFixtures() throws Throwable {
        final InMemoryDB inMemoryDB = new InMemoryDBForSimpleApp(this.scenarioExecution());
        inMemoryDB.getElseCreate(SimpleObject.class, "Foo");
        inMemoryDB.getElseCreate(SimpleObject.class, "Bar");
        inMemoryDB.getElseCreate(SimpleObject.class, "Baz");
        putVar("isis", "in-memory-db", inMemoryDB);
    }
View Full Code Here

    private Action addToInMemoryDB() {
        return new Action() {
           
            @Override
            public Object invoke(Invocation invocation) throws Throwable {
                final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
                final String name = (String)invocation.getParameter(0);
                final SimpleObject obj = new SimpleObject();
                obj.setName(name);
                inMemoryDB.put(SimpleObject.class, name, obj);
                return obj;
            }
           
            @Override
            public void describeTo(Description description) {
View Full Code Here

        };
    }

    // helper
    private List<SimpleObject> allSimpleObjects() {
        final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
        return inMemoryDB.findAll(SimpleObject.class);
    }
View Full Code Here

            }
        });
    }

    private List<ToDoItem> findItems(final Predicate<ToDoItem> predicate) {
        final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
        final List<ToDoItem> items = inMemoryDB.findAll(ToDoItem.class);
        return Lists.newArrayList(Iterables.filter(items, predicate));
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.specsupport.scenarios.InMemoryDB

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.