Package org.apache.ode.store

Examples of org.apache.ode.store.ConfStoreConnection


    public void tearDown() throws Exception {
        hsqlds.getConnection().createStatement().execute("SHUTDOWN");
    }

    public void testEmpty() {
        ConfStoreConnection conn = cf.getConnection();
        conn.begin();
        assertEquals(0, conn.getDeploymentUnits().size());
        assertNull(conn.getDeploymentUnit("foobar"));
        conn.commit();
        conn.close();
    }
View Full Code Here


        conn.commit();
        conn.close();
    }

    public void testCreateDU() {
        ConfStoreConnection conn = cf.getConnection();
        conn.begin();
        try {
            DeploymentUnitDAO du = conn.createDeploymentUnit("foo");
            assertNotNull(du);
            assertEquals("foo", du.getName());
            assertNotNull(du.getDeployDate());
        } finally {
            conn.commit();
            conn.close();
        }

        conn = cf.getConnection();
        conn.begin();
        try {
            DeploymentUnitDAO du = conn.getDeploymentUnit("foo");
            assertNotNull(du);
            assertEquals("foo", du.getName());
        } finally {
            conn.commit();
        }

    }
View Full Code Here

        }

    }

    public void testRollback() {
        ConfStoreConnection conn = cf.getConnection();
        conn.begin();
        try {
            DeploymentUnitDAO du = conn.createDeploymentUnit("foo");
            assertNotNull(du);
            assertEquals("foo", du.getName());
            assertNotNull(du.getDeployDate());
        } finally {
            conn.rollback();
            conn.close();
        }

        conn = cf.getConnection();
        conn.begin();
        try {
            DeploymentUnitDAO du = conn.getDeploymentUnit("foo");
            assertNull(du);
        } finally {
            conn.commit();
        }

    }
View Full Code Here

        }

    }
   
    public void testGetDeploymentUnits() {
        ConfStoreConnection conn = cf.getConnection();
        conn.begin();
        try {
            conn.createDeploymentUnit("foo1");
            conn.createDeploymentUnit("foo2");
            conn.createDeploymentUnit("foo3");
            conn.createDeploymentUnit("foo4");
        } finally {
            conn.commit();
            conn.close();
        }
        conn = cf.getConnection();
        conn.begin();
        try {
            assertNotNull(conn.getDeploymentUnit("foo1"));
            assertNotNull(conn.getDeploymentUnit("foo2"));
            assertNotNull(conn.getDeploymentUnit("foo3"));
            assertNotNull(conn.getDeploymentUnit("foo4"));
            assertNull(conn.getDeploymentUnit("foo5"));
        } finally {
            conn.commit();
        }
    }
View Full Code Here

    }
   
   
    public void testCreateProcess() {
        QName foobar = new QName("foo","bar");
        ConfStoreConnection conn = cf.getConnection();
        conn.begin();
        try {
            DeploymentUnitDAO du = conn.createDeploymentUnit("foo1");
            ProcessConfDAO p = du.createProcess(foobar,foobar,1);
            assertEquals(foobar,p.getPID());
            assertEquals(foobar,p.getType());
            assertNotNull(p.getDeploymentUnit());
            assertEquals("foo1", p.getDeploymentUnit().getName());
        } finally {
            conn.commit();
            conn.close();
        }
       
        conn = cf.getConnection();
        conn.begin();
        try {
            DeploymentUnitDAO du = conn.getDeploymentUnit("foo1");
            ProcessConfDAO p = du.getProcess(foobar);
            assertNotNull(p);
            assertNotNull(du.getProcesses());
           
            assertEquals(foobar,p.getPID());
            assertEquals(foobar,p.getType());

        } finally {
            conn.commit();
            conn.close();
        }
       
    }
View Full Code Here

       
    }
   
    public void testProcessProperties() {
        QName foobar = new QName("foo","bar");
        ConfStoreConnection conn = cf.getConnection();
        conn.begin();
        try {
            DeploymentUnitDAO du = conn.createDeploymentUnit("foo1");
            ProcessConfDAO p = du.createProcess(foobar,foobar,1);
            p.setProperty(foobar,"baz");
        } finally {
            conn.commit();
            conn.close();
        }
       
        conn = cf.getConnection();
        conn.begin();
        try {
            DeploymentUnitDAO du = conn.getDeploymentUnit("foo1");
            ProcessConfDAO p = du.getProcess(foobar);
            assertNotNull(p.getProperty(foobar));
            assertEquals("baz", p.getProperty(foobar));
            assertNotNull(p.getPropertyNames());
            assertTrue(p.getPropertyNames().contains(foobar));
        } finally {
            conn.commit();
            conn.close();
        }
       
       
    }
View Full Code Here

    abstract class Callable<V> implements java.util.concurrent.Callable<V> {
        public V call() {
            boolean success = false;
            // in JTA, transaction is bigger than the session
            connectionFactory.beginTransaction();
            ConfStoreConnection conn = getConnection();
            try {
                V r = call(conn);
                connectionFactory.commitTransaction();
                success = true;
                return r;
View Full Code Here

        hsqlds.getConnection().createStatement().execute("SHUTDOWN");
    }

    public void testEmpty() {
        cf.beginTransaction();
        ConfStoreConnection conn = cf.getConnection();
        assertEquals(0, conn.getDeploymentUnits().size());
        assertNull(conn.getDeploymentUnit("foobar"));
        cf.commitTransaction();
    }
View Full Code Here

        cf.commitTransaction();
    }

    public void testCreateDU() {
        cf.beginTransaction();
        ConfStoreConnection conn = cf.getConnection();
        try {
            DeploymentUnitDAO du = conn.createDeploymentUnit("foo");
            assertNotNull(du);
            assertEquals("foo", du.getName());
            assertNotNull(du.getDeployDate());
        } finally {
            cf.commitTransaction();
        }

        cf.beginTransaction();
        conn = cf.getConnection();
        try {
            DeploymentUnitDAO du = conn.getDeploymentUnit("foo");
            assertNotNull(du);
            assertEquals("foo", du.getName());
        } finally {
            cf.commitTransaction();
        }
View Full Code Here

    }

    public void testRollback() {
        cf.beginTransaction();
        ConfStoreConnection conn = cf.getConnection();
        try {
            DeploymentUnitDAO du = conn.createDeploymentUnit("foo");
            assertNotNull(du);
            assertEquals("foo", du.getName());
            assertNotNull(du.getDeployDate());
        } finally {
            cf.rollbackTransaction();
        }

        cf.beginTransaction();
        conn = cf.getConnection();
        try {
            DeploymentUnitDAO du = conn.getDeploymentUnit("foo");
            assertNull(du);
        } finally {
            cf.commitTransaction();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.ode.store.ConfStoreConnection

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.