// =============================
  // Remote interface methods
  //
  public void lookupEntityBean() throws TestFailureException {
    try {
      try {
        BasicBmpHome home = (BasicBmpHome) ejbContext.lookup("stateless/beanReferences/bmp_entity");
        Assert.assertNotNull("The EJBHome looked up is null", home);

        BasicBmpObject object = home.createObject("Enc Bean");
        Assert.assertNotNull("The EJBObject is null", object);
      } catch (Exception e) {
        Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
      }
    } catch (AssertionFailedError afe) {
      throw new TestFailureException(afe);
    }
  }
Esempio n. 2
0
  // =============================
  // Remote interface methods
  //
  public void lookupEntityBean() throws TestFailureException {
    try {
      try {
        final InitialContext ctx = new InitialContext();
        Assert.assertNotNull("The InitialContext is null", ctx);

        final BasicBmpHome home =
            (BasicBmpHome)
                javax.rmi.PortableRemoteObject.narrow(
                    ctx.lookup("java:comp/env/stateless/beanReferences/bmp_entity"),
                    BasicBmpHome.class);
        Assert.assertNotNull("The EJBHome looked up is null", home);

        final BasicBmpObject object = home.createObject("Enc Bean");
        Assert.assertNotNull("The EJBObject is null", object);
      } catch (final Exception e) {
        Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
      }
    } catch (final AssertionFailedError afe) {
      throw new TestFailureException(afe);
    }
  }