Compiling in Junit
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   larisa_Mikhaylov
Posted On:   Wednesday, August 14, 2002 12:08 PM

After compiling the following code I get this error class or interface expected public void tearDown() throws Exception // Package Name package net.verio.ehip.resourceejb.infobandit.test; // Import Statements import java.util.*; import javax.ejb.*; import javax.rmi.*; import javax.naming.*; import javax.naming.directory.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import junit.swingui.TestRunner; import net.verio.ehip.common.*; import net.verio.ehip.resourceejb.infobandit.*; public class InfoBanditResourceTest extends TestCase {    More>>

After compiling the following code I get this error

class or interface expected

public void tearDown() throws Exception
// Package Name
package net.verio.ehip.resourceejb.infobandit.test;

// Import Statements
import java.util.*;
import javax.ejb.*;
import javax.rmi.*;
import javax.naming.*;
import javax.naming.directory.*;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.swingui.TestRunner;

import net.verio.ehip.common.*;
import net.verio.ehip.resourceejb.infobandit.*;


public class InfoBanditResourceTest extends TestCase

{
private static Vector mIndividualTestToRun = new Vector();
private InfoBanditResourceRemote InfoBanditRemote;
private static final String localUrl = "t3://localhost:7001";
private static final String devUrl= "t3://129.250.40.131:7001";


public InfoBanditResourceTest(string serverID)

{
super(serverID);

}

public void setUp() throws Exception

{ Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.T3InitialContextFactory");
p.put(Context.PROVIDER_URL, devUrl);


Context ctx = new InitialContext(p);
Object h = ctx.lookup("InfoBanditResourceBean");
InfobanditResourceHome = (InfoBanditResourceHome)PortableRemoteObject.narrow(
h, InfoBanditResourceHome.class);

InfoBanditRemote = home.create();
}

public void tearDown() throws Exception

{
InfoBanditRemote.remove();

}


/*** Tests retrieving a customer's IDS customer ID from the
InfoBandit system by using a server ID
***/

public void testgetIDSCustomerId() throws Exception
{
IDSCustomerId customerID = InfoBanditRemote.getIDSCustomerId ("4609");
assertNotNull("return from InforBanditResourceBean should not be null!", customerID);
System.out.println(ObjectAnalyzer.toString(customerID));

}


/*** Tests retrieving a customer's Server ID from the InfoBandit system using IDS customer ID.
***/

public void testgetServerID() throws Exception
{
ServerId serverID= InfoBanditRemote.getServerId("win10412");
assertNotNull("return from InfoBanditResourceBean should not be null!", serverID);
System.out.println(ObjectAnalyzer.toString(serverID));

}



/*** Assembles and returns a test suite for all the test methods of this test case
***/

public static Test Suite()

{
TestSuite suite = null;
if(mIndividualTestToRun.size()==0)

{
suite = new TestSuite(InfoBanditResourceTest.class);

}

else {
suite = new TestSuite();
for (int i=0; i
{
suite.addTest(new InfoBanditResourceClient.class);
mIndividualTestToRun.elementAt(i).toString()));
}
}
return suite;

}

public static void main(String args[])

{
for (int i=0; i
{ if(args[i].indexOf("test")==0)
{mIndividualTestsToRun.add(args[i]);
}
}

junit.swingui.TestRunner.main(new String[]
{
InfoBanditResourcesClient.class.getName(). "-noloading"});
}

}

   <<Less

Re: Compiling in Junit

Posted By:   Jeanne_Boyarsky  
Posted On:   Wednesday, August 14, 2002 05:42 PM

Can you repost your code in pre tags? It's hard to read like this.
About | Sitemap | Contact