Results 1 to 4 of 4
- 01-20-2011, 11:31 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 9
- Rep Power
- 0
Junit3 error: Implicit super constructor TestCase() is not visible
The following code has this error compiled in Eclipse:
Implicit super constructor TestCase() is not visible. Must explicitly invoke another constructor
Java Code: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()); } }
- 01-21-2011, 09:20 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Is that supposed to be abstract?
- 01-21-2011, 01:25 PM #3
Member
- Join Date
- Apr 2010
- Posts
- 9
- Rep Power
- 0
Removing "abstract" has this error compiled in with junit 3.8.2 & jdk6 & Eclipse:
Implicit super constructor TestCase() is not visible for default constructor. Must define an explicit constructor
public class TestProIndexBean extends TestCase {
- 01-21-2011, 01:37 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Can you see the code for TestCase?
Ah.
Hang on, I wonder if they removed the public no-args constructor?
In any case that shouldn't be relied on, so create a constructor that uses the named constructor:
It's been a while since I've used JUnit 3, though, so I can't remember if this is how they're supposed to be written.Java Code:public TestProIndexBean() { super("TestProIndexBean"); }
Similar Threads
-
calling variable using super super..
By Stephen Douglas in forum New To JavaReplies: 7Last Post: 08-16-2010, 06:12 AM -
Private constructor and super()
By Basit56 in forum Advanced JavaReplies: 9Last Post: 08-21-2009, 06:19 AM -
Getting Error while running Junit testcase in Eclipse
By Indu in forum EclipseReplies: 0Last Post: 06-26-2009, 07:40 AM -
constructor ... is not visible
By emceenugget in forum New To JavaReplies: 2Last Post: 09-27-2008, 05:12 AM -
error with super.xxxxx
By Rgfirefly24 in forum New To JavaReplies: 1Last Post: 08-06-2007, 08:13 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks