Skip to main content
summaryrefslogtreecommitdiffstats
blob: 438d7e97f0c8dbd57fb0f6949b0409707b81ba2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package org.eclipse.ecf.tests.osgi.services.remoteserviceadmin;

import org.eclipse.core.runtime.Assert;
import org.eclipse.ecf.discovery.IServiceInfo;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.DefaultEndpointDescriptionFactory;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.DefaultServiceInfoFactory;
import org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription;

public class EndpointDescriptionFactoryTest extends AbstractMetadataFactoryTest {

	protected void setUp() throws Exception {
		super.setUp();
		discoveryAdvertiser = getDiscoveryAdvertiser();
		Assert.isNotNull(discoveryAdvertiser);
		serviceInfoFactory = new DefaultServiceInfoFactory();
		Assert.isNotNull(serviceInfoFactory);
		discoveryLocator = getDiscoveryLocator();
		Assert.isNotNull(discoveryLocator);
		endpointDescriptionFactory = new DefaultEndpointDescriptionFactory();
		Assert.isNotNull(endpointDescriptionFactory);
	}
	
	public void testCreateRequiredEndpointDescriptionFromServiceInfo() throws Exception {
		EndpointDescription published = createRequiredEndpointDescription();
		assertNotNull(published);
		IServiceInfo serviceInfo = createServiceInfoForDiscovery(published);
		assertNotNull(serviceInfo);
		EndpointDescription received = createEndpointDescriptionFromDiscovery(serviceInfo);
		assertNotNull(received);
		assertTrue(published.equals(received));
	}

	public void testCreateFullEndpointDescriptionFromServiceInfo() throws Exception {
		EndpointDescription published = createFullEndpointDescription();
		assertNotNull(published);
		IServiceInfo serviceInfo = createServiceInfoForDiscovery(published);
		assertNotNull(serviceInfo);
		EndpointDescription received = createEndpointDescriptionFromDiscovery(serviceInfo);
		assertNotNull(received);
		assertTrue(published.equals(received));
	}

}

Back to the top