use of org.eclipse.ecf.core.identity.Namespace in project ecf by eclipse.
the class ServiceIDTest method testServiceIDFactoryNullScope.
/*
* org.eclipse.ecf.discovery.identity.IServiceIDFactory.createServiceID(Namespace, String[], String[], String[], String, String)
*/
public void testServiceIDFactoryNullScope() {
try {
Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, services, null, protocols, namingAuthority);
} catch (IDCreateException e) {
return;
}
fail("Invalid services may cause InvalidIDException");
}
use of org.eclipse.ecf.core.identity.Namespace in project ecf by eclipse.
the class ServiceIDTest method testServiceIDFactory.
/*
* org.eclipse.ecf.discovery.identity.IServiceIDFactory.createServiceID(Namespace, String, String)
*/
public void testServiceIDFactory() {
Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
IServiceTypeID serviceType = ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, services, scopes, protocols, namingAuthority);
assertNotNull(serviceType);
assertEquals(namingAuthority, serviceType.getNamingAuthority());
assertTrue(Arrays.equals(services, serviceType.getServices()));
assertTrue(Arrays.equals(scopes, serviceType.getScopes()));
assertTrue(Arrays.equals(protocols, serviceType.getProtocols()));
}
use of org.eclipse.ecf.core.identity.Namespace in project ecf by eclipse.
the class ServiceIDTest method testServiceIDFactoryNullNA.
/*
* org.eclipse.ecf.discovery.identity.IServiceIDFactory.createServiceID(Namespace, String[], String[], String[], String, String)
*/
public void testServiceIDFactoryNullNA() {
try {
Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, services, scopes, protocols, null);
} catch (IDCreateException e) {
return;
}
fail("Invalid services may cause InvalidIDException");
}
use of org.eclipse.ecf.core.identity.Namespace in project ecf by eclipse.
the class ServiceIDTest method testServiceIDFactoryNullServices.
/*
* org.eclipse.ecf.discovery.identity.IServiceIDFactory.createServiceID(Namespace, String[], String[], String[], String, String)
*/
public void testServiceIDFactoryNullServices() {
try {
Namespace namespaceByName = IDFactory.getDefault().getNamespaceByName(namespace);
ServiceIDFactory.getDefault().createServiceTypeID(namespaceByName, null, scopes, protocols, namingAuthority);
} catch (IDCreateException e) {
return;
}
fail("Invalid services may cause InvalidIDException");
}
use of org.eclipse.ecf.core.identity.Namespace in project ecf by eclipse.
the class AbstractClientContainer method connect.
// IContainer implementation methods
public void connect(ID targetID, IConnectContext connectContext1) throws ContainerConnectException {
if (targetID == null)
// $NON-NLS-1$
throw new ContainerConnectException("targetID cannot be null");
Namespace targetNamespace = targetID.getNamespace();
Namespace connectNamespace = getConnectNamespace();
if (connectNamespace == null)
// $NON-NLS-1$
throw new ContainerConnectException("targetID namespace cannot be null");
if (!(targetNamespace.getName().equals(connectNamespace.getName())))
// $NON-NLS-1$
throw new ContainerConnectException("targetID of incorrect type");
fireContainerEvent(new ContainerConnectingEvent(containerID, targetID));
synchronized (connectLock) {
if (connectedID == null) {
connectedID = targetID;
this.connectContext = connectContext1;
} else if (!connectedID.equals(targetID))
// $NON-NLS-1$
throw new ContainerConnectException("Already connected to " + connectedID.getName());
}
fireContainerEvent(new ContainerConnectedEvent(containerID, targetID));
}
Aggregations