Package org.jboss.as.test.integration.ejb.entity.cmp.optimisticlock.interfaces

Examples of org.jboss.as.test.integration.ejb.entity.cmp.optimisticlock.interfaces.CmpEntityLocal


    /**
     * @ejb.interface-method
     */
    public void testReadStrategyPass(String jndiName, Integer id) throws Exception {
        log.debug("testReadStrategyPass> begin");
        CmpEntityLocal entity = getCmpEntityHome(jndiName).findByPrimaryKey(id);
        entity.setIntegerGroup1(new Integer(111));
        entity.getStringGroup1();
        entity.getDoubleGroup1();
        getFacade().modifyGroup2InRequiresNew(jndiName, id);
        log.debug("testReadStrategyPass> done");
    }
View Full Code Here


    /**
     * @ejb.interface-method
     */
    public void testReadStrategyFail(String jndiName, Integer id) throws Exception {
        log.debug("testReadStrategyFail> begin");
        CmpEntityLocal entity = getCmpEntityHome(jndiName).findByPrimaryKey(id);
        entity.setIntegerGroup1(new Integer(111));
        entity.getStringGroup2();
        entity.getDoubleGroup1();
        getFacade().modifyGroup2InRequiresNew(jndiName, id);
        log.debug("testReadStrategyFail> done");
    }
View Full Code Here

    /**
     * @ejb.interface-method
     */
    public void testModifiedStrategyPass(String jndiName, Integer id) throws Exception {
        log.debug("testModifiedStrategyPass> begin");
        CmpEntityLocal entity = getCmpEntityHome(jndiName).findByPrimaryKey(id);
        entity.setIntegerGroup1(new Integer(111));
        entity.setStringGroup1("modified in testModifiedStrategyPass");
        entity.setDoubleGroup1(new Double(111.111));
        getFacade().modifyGroup2InRequiresNew(jndiName, id);
        log.debug("testModifiedStrategyPass> done");
    }
View Full Code Here

    /**
     * @ejb.interface-method
     */
    public void testModifiedStrategyFail(String jndiName, Integer id) throws Exception {
        log.debug("testModifiedStrategyFail> begin");
        CmpEntityLocal entity = getCmpEntityHome(jndiName).findByPrimaryKey(id);
        entity.setStringGroup2("modified by testModifiedStrategyFail");
        getFacade().modifyGroup2InRequiresNew(jndiName, id);
        log.debug("testModifiedStrategyFail> done");
    }
View Full Code Here

     * @ejb.interface-method
     * @ejb.transaction type="RequiresNew"
     */
    public void modifyGroup2InRequiresNew(String jndiName, Integer id) throws Exception {
        log.debug("modifyGroup2InRequiresNew");
        CmpEntityLocal entity = getCmpEntityHome(jndiName).findByPrimaryKey(id);
        entity.setIntegerGroup2(new Integer(222));
        entity.setStringGroup2("modified by modifyGroup2InRequiresNew");
        entity.setDoubleGroup2(new Double(222.222));
    }
View Full Code Here

     * @ejb.interface-method
     * @ejb.transaction type="RequiresNew"
     */
    public void modifyGroup1InRequiresNew(String jndiName, Integer id) throws Exception {
        log.info("modifyGroup1InRequiresNew> begin");
        CmpEntityLocal entity = getCmpEntityHome(jndiName).findByPrimaryKey(id);
        entity.setIntegerGroup1(new Integer(333));
        entity.setStringGroup1("modified by modifyGroup1InRequiresNew");
        entity.setDoubleGroup1(new Double(333.333));
        log.info("modifyGroup1InRequiresNew> done");
    }
View Full Code Here

    /**
     * @ejb.interface-method
     */
    public void testUpdateLockOnSync(String jndiName, Integer id) throws Exception {
        log.debug("testUpdateLockOnSync> begin");
        CmpEntityLocal entity = getCmpEntityHome(jndiName).findById(id);
        entity.setStringGroup1("FIRST UPDATE");

        entity = getCmpEntityHome(jndiName).findById(id);
        entity.setStringGroup1("SECOND UPDATE");

        log.debug("testUpdateLockOnSync> done");
    }
View Full Code Here

    /**
     * @ejb.interface-method
     */
    public void testExplicitVersionUpdateOnSync(String jndiName, Integer id) throws Exception {
        log.debug("testExplicitVersionUpdateOnSync> begin");
        CmpEntityLocal entity = getCmpEntityHome(jndiName).findById(id);
        if (entity.getVersionField().longValue() != 1)
            throw new Exception("entity.getVersionField().longValue() != 1");
        entity.setStringGroup1("FIRST UPDATE");

        entity = getCmpEntityHome(jndiName).findById(id);
        if (entity.getVersionField().longValue() != 2)
            throw new Exception("entity.getVersionField().longValue() != 2");
        entity.setStringGroup1("SECOND UPDATE");

        log.debug("testExplicitVersionUpdateOnSync> done");
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.test.integration.ejb.entity.cmp.optimisticlock.interfaces.CmpEntityLocal

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.