Work on the MetaContactListService test suite

cusax-fix
Emil Ivov 20 years ago
parent 734ea860c5
commit 72209b4462

@ -64,7 +64,6 @@ oscar.auto.start.5= \
file:sc-bundles/meta-cl-slick.jar \
file:sc-bundles/protocol-icq-slick.jar \
oscar.auto.start.100= \
file:sc-bundles/slick-runner.jar

@ -24,59 +24,59 @@
public class Activator implements BundleActivator
{
private Logger logger = Logger.getLogger(Activator.class.getName());
private UIService uiService = null;
private CommunicatorMain communicatorMain = new CommunicatorMain();
private LoginManager loginManager;
private LoginManager loginManager;
private BundleContext bundleContext;
public void start(BundleContext bundleContext) throws Exception
{
this.bundleContext = bundleContext;
this.loginManager = new LoginManager(bundleContext);
try
{
logger.logEntry();
//Create the ui service
this.uiService =
new UIServiceImpl();
//ServiceReference clistReference
//= bundleContext.getServiceReference(MetaContactListService.class.getName());
//MetaContactListService contactListService
//= (MetaContactListService)bundleContext.getService(clistReference);
logger.info("UI Service...[ STARTED ]");
bundleContext.registerService(
UIService.class.getName(), this.uiService, null);
logger.info("UI Service ...[REGISTERED]");
//communicatorMain.setContactList(contactListService);
communicatorMain.showCommunicator();
loginManager.showLoginWindow(communicatorMain.getMainFrame());
}
finally
{
logger.logExit();
}
}
public void stop(BundleContext bundleContext) throws Exception
{
logger.info("UI Service ...[STOPED]");
}
}

@ -0,0 +1,33 @@
package net.java.sip.communicator.slick.contactlist;
import org.osgi.framework.*;
import net.java.sip.communicator.service.contactlist.*;
public class MclSlickFixture
extends junit.framework.TestCase
{
public static BundleContext bundleContext = null;
public MetaContactListService metaClService = null;
public MclSlickFixture(Object obj)
{
}
/**
* Find a reference of the meta contact list service and set the
* corresponding field.
*/
public void setUp()
{
ServiceReference ref = bundleContext.getServiceReference(
MetaContactListService.class.getName());
metaClService
= (MetaContactListService)bundleContext.getService(ref);
}
public void tearDown()
{
}
}

@ -21,25 +21,23 @@ public class MetaContactListServiceLick
{
private static final Logger logger =
Logger.getLogger(MetaContactListServiceLick.class);
/**
* The bundle context that we get upon activation.
*/
protected static BundleContext bundleContext = null;
/**
* Register
*/
public void start(BundleContext context) throws Exception
{
this.bundleContext = context;
MclSlickFixture.bundleContext = context;
setName("MetaContactListServiceLick");
Hashtable properties = new Hashtable();
properties.put("service.pid", getName());
addTestSuite(TestMetaContactList.class);
logger.debug("Service " + getClass().getName() + " [ STARTED ]");
addTestSuite(TestMetaContactList.class);
bundleContext.registerService(getClass().getName(), this, properties);
context.registerService(getClass().getName(), this, properties);
logger.debug("Service " + getClass().getName() + " [REGISTERED]");
}

@ -10,6 +10,11 @@
public class TestMetaContactList
extends TestCase
{
/**
* A reference to the SLICK fixture.
*/
MclSlickFixture fixture = new MclSlickFixture(getClass().getName());
public TestMetaContactList(String name)
{
super(name);
@ -18,16 +23,18 @@ public TestMetaContactList(String name)
protected void setUp() throws Exception
{
super.setUp();
fixture.setUp();
}
protected void tearDown() throws Exception
{
fixture.tearDown();
super.tearDown();
}
public void testContactListRetrieving()
{
System.out.println("-= DUPE =-");
}
}

@ -0,0 +1,154 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.slick.contactlist.mockprovider;
import java.util.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
/**
* A mock protocol provider implementation that comes with a single operation
* set (OperationSetPersistentPresence) for use by the MetaContactListSlcik.
*
* @author Emil Ivov
*/
public class MockProvider
implements ProtocolProviderService
{
public MockProvider()
{
}
/**
* Registers the specified listener with this provider so that it would
* receive notifications on changes of its state or other properties such
* as its local address and display name.
*
* @param listener the listener to register.
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public void addRegistrationStateChangeListener(
RegistrationStateChangeListener listener)
{
}
/**
* Returns the short name of the protocol that the implementation of this
* provider is based upon (like SIP, Jabber, ICQ/AIM, or others for
* example).
*
* @return a String containing the short name of the protocol this
* service is implementing (most often that would be a name in
* ProtocolNames).
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public String getProtocolName()
{
return "";
}
/**
* Returns the state of the registration of this protocol provider with
* the corresponding registration service.
*
* @return ProviderRegistrationState
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public RegistrationState getRegistrationState()
{
return null;
}
/**
* Returns an array containing all operation sets supported by the
* current implementation.
*
* @return a java.util.Map containing instance of all supported
* operation sets mapped against their class names (e.g.
* OperationSetPresence.class.getName()) .
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public Map getSupportedOperationSets()
{
return null;
}
/**
* Indicates whether or not this provider is registered
*
* @return true if the provider is currently registered and false
* otherwise.
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public boolean isRegistered()
{
return false;
}
/**
* Starts the registration process.
*
* @param authority the security authority that will be used for
* resolving any security challenges that may be returned during the
* registration or at any moment while wer're registered.
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public void register(SecurityAuthority authority)
{
}
/**
* Removes the specified listener.
*
* @param listener the listener to remove.
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public void removeRegistrationStateChangeListener(
RegistrationStateChangeListener listener)
{
}
/**
* Makes the service implementation close all open sockets and release
* any resources that it might have taken and prepare for
* shutdown/garbage collection.
*
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public void shutdown()
{
}
/**
* Ends the registration of this protocol provider with the current
* registration service.
*
* @todo Implement this
* net.java.sip.communicator.service.protocol.ProtocolProviderService
* method
*/
public void unregister()
{
}
}
Loading…
Cancel
Save