стоит у меня IDE - Ibm rational application development v. 7.0 не могу импортировать com.ibm.etools.service.locator.ServiceLocatorManager; посматрел тут F:\Program Files\IBM\SDP70\runtimes\base_v61\plugins нету где его скачать? по сути етот библиотека должна быть встроенна, всю папку сделал обыскал тоже нет. Как я понел етот библиотека нужна чтобы был доступ к home-методу EJB-компонента. Вот код Код | package calculator.test;
import java.rmi.RemoteException;
import com.ibm.etools.service.locator.ServiceLocatorManager; // тут ошибка (Невозможно разрешить ServiceLocatorManager )
import ejbs.BasicCalculator; import ejbs.BasicCalculatorHome; import junit.framework.TestCase;
public class BasicCalculatorTest extends TestCase {
BasicCalculator aBasicCalculator = null;
/* * Setup before each test case */ protected void setUp() throws Exception { super.setUp(); aBasicCalculator = createBasicCalculator(); }
protected void tearDown() throws Exception { aBasicCalculator = null; }
public void testSimpleAddition() throws Exception {
assertTrue("Calculator instance is not null", aBasicCalculator != null);
double result = aBasicCalculator.addTwoNumbers(2, 2); assertTrue("2+2=4", result == 4);
}
public void testSimpleAdditionNotSame() throws Exception {
double result = aBasicCalculator.addTwoNumbers(2, 2); assertNotSame("2+2 does not = 5", new Double(result), new Double(5)); }
public void testDesignedToFail() throws Exception {
double result = aBasicCalculator.addTwoNumbers(1, 1); assertTrue("1 + 1 = 3", result == 3);
} /* * Rational generated code snippet to access EJB */
private BasicCalculator createBasicCalculator() { // строка ниже ошибка (Невозможно разрешить ServiceLocatorManager ) BasicCalculatorHome aBasicCalculatorHome = (BasicCalculatorHome) ServiceLocatorManager .getRemoteHome(STATIC_BasicCalculatorHome_REF_NAME, STATIC_BasicCalculatorHome_CLASS); try { if (aBasicCalculatorHome != null) { return aBasicCalculatorHome.create(); } } catch (javax.ejb.CreateException ce) { ce.printStackTrace(); } catch (RemoteException re) { re.printStackTrace(); } return null; }
private final static String STATIC_BasicCalculatorHome_REF_NAME = "ejb/BasicCalculator";
private final static Class STATIC_BasicCalculatorHome_CLASS = BasicCalculatorHome.class; }
|
|