Package com.impetus.kundera.graph

Examples of com.impetus.kundera.graph.Node


     * .
     */
    @Test
    public void testHandleRemove()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.REMOVE);
        state.handleRemove(storeNode);

        Assert.assertEquals(RemovedState.class, storeNode.getCurrentNodeState().getClass());

        for (Node childNode : storeNode.getChildren().values())
        {
            Assert.assertEquals(BillingCounter.class, childNode.getDataClass());
            Assert.assertEquals(RemovedState.class, childNode.getCurrentNodeState().getClass());
        }
    }
View Full Code Here


     * .
     */
    @Test
    public void testHandleRefresh()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.REFRESH);
        try
        {
            state.handleRefresh(storeNode);
            Assert.fail("Refresh operation in Removed state should have thrown exception");
        }
View Full Code Here

     * .
     */
    @Test
    public void testHandleMerge()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.MERGE);
        try
        {
            state.handleMerge(storeNode);
            Assert.fail("Merge operation in Removed state should have thrown exception");
        }
View Full Code Here

     * .
     */
    @Test
    public void testHandleDetach()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.DETACH);
        state.handleDetach(storeNode);

        Assert.assertEquals(DetachedState.class, storeNode.getCurrentNodeState().getClass());

        for (Node childNode : storeNode.getChildren().values())
        {
            Assert.assertEquals(BillingCounter.class, childNode.getDataClass());
            Assert.assertEquals(DetachedState.class, childNode.getCurrentNodeState().getClass());
        }
    }
View Full Code Here

     * .
     */
    @Test
    public void testHandleClose()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.PERSIST);
        state.handleClose(storeNode);
    }
View Full Code Here

     * .
     */
    @Test
    public void testHandleLock()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.PERSIST);
        state.handleLock(storeNode);
    }
View Full Code Here

     * .
     */
    @Test
    public void testHandleCommit()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.PERSIST);
        state.handleCommit(storeNode);

        Assert.assertEquals(TransientState.class, storeNode.getCurrentNodeState().getClass());

        for (Node childNode : storeNode.getChildren().values())
        {
            Assert.assertEquals(BillingCounter.class, childNode.getDataClass());
            Assert.assertEquals(RemovedState.class, childNode.getCurrentNodeState().getClass());
        }
    }
View Full Code Here

    @Test
    public void testHandleRollback()
    {
        // Extended
        pc.setPersistenceContextType(PersistenceContextType.EXTENDED);
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.PERSIST);
        state.handleRollback(storeNode);

        Assert.assertEquals(ManagedState.class, storeNode.getCurrentNodeState().getClass());

        for (Node childNode : storeNode.getChildren().values())
        {
            Assert.assertEquals(BillingCounter.class, childNode.getDataClass());
            Assert.assertEquals(RemovedState.class, childNode.getCurrentNodeState().getClass());
        }

        // Transactional
        pc.setPersistenceContextType(PersistenceContextType.TRANSACTION);
        storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.PERSIST);
        state.handleRollback(storeNode);

        Assert.assertEquals(DetachedState.class, storeNode.getCurrentNodeState().getClass());

        for (Node childNode : storeNode.getChildren().values())
        {
            Assert.assertEquals(BillingCounter.class, childNode.getDataClass());
            Assert.assertEquals(RemovedState.class, childNode.getCurrentNodeState().getClass());
        }
    }
View Full Code Here

     * .
     */
    @Test
    public void testHandleFind()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.PERSIST);
        state.handleFind(storeNode);
    }
View Full Code Here

     * .
     */
    @Test
    public void testHandleGetReference()
    {
        Node storeNode = StoreBuilder.buildStoreNode(pc, state, CascadeType.PERSIST);
        state.handleGetReference(storeNode);
    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.graph.Node

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.