Examples of BMPLocalHome


Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

    }

    @Test
    public void testSimpleCreate() throws Exception {
        DataStore.DATA.clear();
        final BMPLocalHome home = getHome();
        final BMPLocalInterface ejbInstance = home.createWithValue("Hello");
        final Integer pk = (Integer) ejbInstance.getPrimaryKey();
        Assert.assertEquals("Hello", DataStore.DATA.get(pk));
    }
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

    }

    @Test
    public void testFindByPrimaryKey() throws Exception {
        DataStore.DATA.clear();
        final BMPLocalHome home = getHome();
        DataStore.DATA.put(1099, "VALUE1099");
        BMPLocalInterface result = home.findByPrimaryKey(1099);
        Assert.assertEquals("VALUE1099", result.getMyField());
    }
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

    }

    @Test
    public void testSingleResultFinderMethod() throws Exception {
        DataStore.DATA.clear();
        final BMPLocalHome home = getHome();
        DataStore.DATA.put(888, "VALUE888");
        BMPLocalInterface result = home.findByValue("VALUE888");
        Assert.assertEquals("VALUE888", result.getMyField());
        Assert.assertEquals(888, result.getPrimaryKey());
    }
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome


    @Test
    public void testCollectionFinderMethod() throws Exception {
        DataStore.DATA.clear();
        final BMPLocalHome home = getHome();
        DataStore.DATA.put(1000, "Collection");
        DataStore.DATA.put(1001, "Collection");
        Collection<BMPLocalInterface> col = home.findCollection();
        for (BMPLocalInterface result : col) {
            Assert.assertEquals("Collection", result.getMyField());
        }
    }
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

    }

  @Test
  public void testSortedCollectionFinderMethod() throws Exception {
    DataStore.DATA.clear();
    final BMPLocalHome home = getHome();
    for (int i = 1000; i < 2000; i++) {
      DataStore.DATA.put(i, "" + i);
    }
    Collection<BMPLocalInterface> col = home.findSortedCollection();
    Assert.assertTrue("Returned collection must not be empty",
        col.size() > 0);
    // check that returned results are sorted
    Integer previousMyFieldValue = null;
    for (BMPLocalInterface result : col) {
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

  }

  @Test
  public void testSortedEnumerationFinderMethod() throws Exception {
    DataStore.DATA.clear();
    final BMPLocalHome home = getHome();
    for (int i = 1000; i < 2000; i++) {
      DataStore.DATA.put(i, "" + i);
    }
    Enumeration<BMPLocalInterface> enu = home.findSortedEnumeration();
    Assert.assertTrue("Returned enumeration must not be empty",
        enu.hasMoreElements());
    // check that returned results are sorted
    Integer previousMyFieldValue = null;
    while (enu.hasMoreElements()) {
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

  }

    @Test
    public void testRemoveEntityBean() throws Exception {
        DataStore.DATA.clear();
        final BMPLocalHome home = getHome();
        DataStore.DATA.put(56, "Remove");
        BMPLocalInterface result = home.findByPrimaryKey(56);
        Assert.assertEquals("Remove", result.getMyField());
        result.remove();
        Assert.assertFalse(DataStore.DATA.containsKey(56));
        try {
            result.getMyField();
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

    }

    @Test
    public void testCreateRemoveCreate() throws Exception {
        DataStore.DATA.clear();
        final BMPLocalHome home = getHome();

        BMPLocalInterface result = home.createWithValueAndPk(88888, "Hello1");
        Assert.assertEquals("Hello1", result.getMyField());
        result.remove();
        Assert.assertFalse(DataStore.DATA.containsKey(88888));
        try {
            result.getMyField();
            throw new RuntimeException("Expected invocation on removed instance to fail");
        } catch (NoSuchObjectLocalException expected) {

        }
        result = home.createWithValueAndPk(88888, "Hello2");
        Assert.assertEquals("Hello2", result.getMyField());
        result.remove();
        Assert.assertFalse(DataStore.DATA.containsKey(88888));
        try {
            result.getMyField();
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

    }

    @Test
    public void testIsIdentical() throws Exception {
        DataStore.DATA.clear();
        final BMPLocalHome home = getHome();
        DataStore.DATA.put(40, "1");
        DataStore.DATA.put(41, "2");
        BMPLocalInterface bean1 = home.findByPrimaryKey(40);
        BMPLocalInterface bean1_2 = home.findByPrimaryKey(40);
        BMPLocalInterface bean2 = home.findByPrimaryKey(41);
        Assert.assertTrue(bean1.isIdentical(bean1_2));
        Assert.assertFalse(bean1.isIdentical(bean2));
    }
View Full Code Here

Examples of org.jboss.as.test.integration.ejb.entity.bmp.BMPLocalHome

        Assert.assertFalse(bean1.isIdentical(bean2));
    }

    @Test
    public void testEjbHomeMethod() throws Exception {
        final BMPLocalHome home = getHome();
        Assert.assertEquals(SimpleBMPBean.HOME_METHOD_RETURN, home.exampleHomeMethod());
    }
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.