FileDocCategorySizeDatePackage
TestPaymentProcessingBean.javaAPI DocExample1049Sat Sep 07 20:42:58 BST 2002com.oreilly.javaxp.xdoclet.ejbdoclet.client

TestPaymentProcessingBean.java

package com.oreilly.javaxp.xdoclet.ejbdoclet.client;

import junit.framework.TestCase;

import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

import com.oreilly.javaxp.xdoclet.ejbdoclet.interfaces.*;

/**
 * @author Brian M. Coyner
 * $version $Id: TestPaymentProcessingBean.java,v 1.2 2002/09/08 01:42:58 jepc Exp $
 */
public class TestPaymentProcessingBean extends TestCase {

    public TestPaymentProcessingBean(String name) {
        super(name);
    }

    public void testPaymentProcessingBean() throws Exception {
        InitialContext context = new InitialContext();

        Object obj = context.lookup(PaymentProcessingBeanHome.JNDI_NAME);
        PaymentProcessingBeanHome home = (PaymentProcessingBeanHome)
                PortableRemoteObject.narrow(obj, PaymentProcessingBeanHome.class);
        PaymentProcessingBean bean = home.create();
        assertTrue("PaymentProcessingBean.makePayment() returned false.",
                   bean.makePayment("12345", 1000.00));
    }
}