A
albert kao
The following code has this error compiled in Eclipse:
Implicit super constructor TestCase() is not visible. Must explicitly
invoke another constructor
package com.my.prog;
import junit.framework.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
public abstract class TestProIndexBean extends TestCase {
static {
System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.setProperty(Context.PROVIDER_URL, "iiop://localhost:
7001" );
}
private ProIndex proIndex = null;
private ProIndexHome home = null;
protected void setUp() throws Exception {
super.setUp();
if( home == null ) {
Context context = new InitialContext();
home = (ProIndexHome)PortableRemoteObject.narrow(
context.lookup("com.my.prog.business.ProIndexHome"),
ProIndexHome.class);
}
proIndex = home.create();
}
protected void tearDown() throws Exception {
proIndex.remove();
super.tearDown();
}
public void testProIndexRequest1() throws Exception {
System.out.println("testProIndexRequest1()");
ProIndexRequest request = new ProIndexRequest();
ProIndexResponse actualReturn =
proIndex.getProIndexInfo(request);
this.assertEquals("0000", actualReturn.getCd());
}
}
Implicit super constructor TestCase() is not visible. Must explicitly
invoke another constructor
package com.my.prog;
import junit.framework.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
public abstract class TestProIndexBean extends TestCase {
static {
System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
System.setProperty(Context.PROVIDER_URL, "iiop://localhost:
7001" );
}
private ProIndex proIndex = null;
private ProIndexHome home = null;
protected void setUp() throws Exception {
super.setUp();
if( home == null ) {
Context context = new InitialContext();
home = (ProIndexHome)PortableRemoteObject.narrow(
context.lookup("com.my.prog.business.ProIndexHome"),
ProIndexHome.class);
}
proIndex = home.create();
}
protected void tearDown() throws Exception {
proIndex.remove();
super.tearDown();
}
public void testProIndexRequest1() throws Exception {
System.out.println("testProIndexRequest1()");
ProIndexRequest request = new ProIndexRequest();
ProIndexResponse actualReturn =
proIndex.getProIndexInfo(request);
this.assertEquals("0000", actualReturn.getCd());
}
}