hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor A. Deruga" <ingva...@hotbox.ru>
Subject Problem with JUnit
Date Sun, 14 Nov 2004 08:28:54 GMT
Hi, All!

I had a working program and I've tried to add some junit tests to it (some 
bugs were still there). This is what I have in my build.xml (I'm using 
Eclipse IDE + ant build file):
//---------------------------------------Target-----------------------------------
	<target name="test" description="Launch JUnit tests" depends="jar">
		<junit printsummary="on">
			<classpath refid="test.class.path"/>
			<formatter type="plain"/>
			<test name="src.server.test.impl.IMServerImplTest" />
		</junit>
	</target>
//---------------------------------------End of Target----------------------

Here's a part of my hivemodule.xml:

//---------------------------------------Config-----------------------------------
	<service-point id="IMServer" interface="src.server.api.IMServer">
    	<invoke-factory model="singleton">
    	  <construct class="src.server.impl.IMServerImpl"/>
	    </invoke-factory>
    	<interceptor service-id="hivemind.LoggingInterceptor"/>
	</service-point>   
//---------------------------------------End of Config----------------------

Here's my IMServer interface description:

//---------------------------------------Code-----------------------------------
public interface IMServer extends GWService{
//---------------------------------------End of Code----------------------

And HERE's what it says when I try to run all this stuff:

//---------------------------Error messages-----------------------------------
HiveMind service point is not instantiated: 
org.apache.hivemind.ApplicationRuntimeException: Service 
src.server.api.IMServer does not implement the requested interface 
(src.server.api.IMServer).  The declared service interface type is 
src.server.api.IMServer.
//-----------------------End of error messages------------------------------

But it does implement src.server.api.IMServer!!! Here's the declaration of 
IMServerImpl class:

//---------------------------------------Code-----------------------------------
public class IMServerImpl implements IMServer, ConnectionHandlerFactory, 
GWService {
//---------------------------------------End of Code----------------------


I don't believe that the error is in code. I have a "run" target that starts 
this server and it works fine. Any Ideas on what's this all about? I'm 
working on it for a second day and it's still at the same point :(

One more thing ;)
The testing code (maybe, the error is in this part?):

//---------------------------------------Code-----------------------------------
		try {
			Registry r = RegistryBuilder.constructDefaultRegistry();
			IMServer server = (IMServer)r.getService(IMServer.class);
		} catch(Exception e){
			System.out.println("Exception: " + e.getMessage());
		}
//---------------------------------------End of Code----------------------

Sincerely
	Igor

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message