Examples of EBStore


Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * @output the method execution without error.
     */
    @Test
    public void createNewEntity() {
        slsbEntityManagerTester.createEBStoreNew(PRIMARY_KEY, ENTITY_NAME);
        EBStore ebstore = slsbEntityManagerTester.findEBStore(PRIMARY_KEY);
        assertNotNull(ebstore, "The entity was not inserted in the database");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * @output the method execution without error.
     */
    @Test
    public void createRemoved() {
        slsbEntityManagerTester.createEBStoreRemoved(PRIMARY_KEY, ENTITY_NAME);
        EBStore ebstore = slsbEntityManagerTester.findEBStore(PRIMARY_KEY);
        assertNotNull(ebstore, "The entity was not re-inserted in the database");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * @output the method execution without error.
     */
    @Test
    public void createManaged() {
        slsbEntityManagerTester.createEBStoreManaged(PRIMARY_KEY, ENTITY_NAME);
        EBStore ebstore = slsbEntityManagerTester.findEBStore(PRIMARY_KEY);
        assertNotNull(ebstore, "The persist operation was not ignored.");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * @output the method execution without error.
     */
    @Test
    public void removeNew() {
        slsbEntityManagerTester.removeEBStoreNew(PRIMARY_KEY, ENTITY_NAME);
        EBStore ebstore = slsbEntityManagerTester.findEBStore(PRIMARY_KEY);
        assertNull(ebstore, "The remove operation was not ignored.");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * @output the method execution without error.
     */
    @Test
    public void removeManaged() {
        slsbEntityManagerTester.removeEBStoreManaged(PRIMARY_KEY, ENTITY_NAME);
        EBStore ebstore = slsbEntityManagerTester.findEBStore(PRIMARY_KEY);
        assertNull(ebstore, "The remove operation failed.");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * @output the method execution without error.
     */
    @Test
    public void removeRemoved() {
        slsbEntityManagerTester.removeEBStoreManaged(PRIMARY_KEY, ENTITY_NAME);
        EBStore ebstore = slsbEntityManagerTester.findEBStore(PRIMARY_KEY);
        assertNull(ebstore, "The remove operation was not ignored.");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * Test if the method contains verifies if the entity is in the db.
     * @param id the entity primary key.
     * @param name the entity name.
     */
    public void containsEBStore(final int id, final String name) {
        EBStore ebstore = completeEBStore(id, name);
        em.persist(ebstore);
        assertTrue(em.contains(ebstore), "The contains methos does not work properly");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * @param id the entity primary key.
     * @param name the entity name.
     * @param newName the name that the entity receives after to be detached.
     */
    public void refreshEBStore(final int id, final String name, final String newName) {
        EBStore ebstore = completeEBStore(id, name);
        em.persist(ebstore);
        //makes the entity detached
        em.clear();
        //changes the entity name
        ebstore.setName(newName);
        //makes a refresh
        em.refresh(ebstore);
        //verifies if the container got the values from the database.
        assertEquals(ebstore.getName(), name, "The entity was not refreshed");
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * Removes the entity from the database.
     *
     */
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    private void removeEntity() {
        EBStore ebstore = entityManager.find(EBStore.class, ENTITY_ID);
        if (ebstore != null) {
            entityManager.remove(ebstore);
        }
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.ebstore.EBStore

     * Removes the entity in the database avoiding an insertion error and
     * inserts a new entity to make the tests.
     */
    public void startup() {
        removeEntity();
        EBStore ebstore = new EBStore();
        ebstore.setId(ENTITY_ID.intValue());
        ebstore.setName(ENTITY_NAME);
        entityManager.persist(ebstore);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.