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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]