Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2009-02-20 03:52:45 -0500
committermkuppe2009-02-20 03:52:45 -0500
commitb832c7084c65424e9c304f147a6e26e7a2040ae0 (patch)
tree845d353c9d3448980628988b783ba7a2ab4f5ba8 /tests/bundles/org.eclipse.ecf.tests.provider.jslp
parent74bda13381615f599d47b775e3f973e333d164ca (diff)
downloadorg.eclipse.ecf-b832c7084c65424e9c304f147a6e26e7a2040ae0.tar.gz
org.eclipse.ecf-b832c7084c65424e9c304f147a6e26e7a2040ae0.tar.xz
org.eclipse.ecf-b832c7084c65424e9c304f147a6e26e7a2040ae0.zip
Code cleanups
Diffstat (limited to 'tests/bundles/org.eclipse.ecf.tests.provider.jslp')
-rwxr-xr-xtests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java60
1 files changed, 31 insertions, 29 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java b/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java
index 96e3fc18f..7b0a2bc89 100755
--- a/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.jslp/src/org/eclipse/ecf/tests/provider/jslp/JSLPTestComparator.java
@@ -16,9 +16,9 @@ import java.util.Comparator;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.discovery.IServiceInfo;
+import org.eclipse.ecf.discovery.IServiceProperties;
import org.eclipse.ecf.discovery.identity.IServiceID;
import org.eclipse.ecf.discovery.identity.IServiceTypeID;
-import org.eclipse.ecf.provider.jslp.identity.JSLPServiceID;
/**
* Used for testing equality
@@ -28,38 +28,40 @@ public class JSLPTestComparator implements Comparator {
/* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
- public int compare(Object arg0, Object arg1) {
+ public int compare(final Object arg0, final Object arg1) {
if(arg0 instanceof IServiceInfo && arg1 instanceof IServiceInfo) {
- IServiceInfo first = (IServiceInfo) arg0;
- IServiceInfo second = (IServiceInfo) arg1;
+ final IServiceInfo first = (IServiceInfo) arg0;
+ final IServiceInfo second = (IServiceInfo) arg1;
- IServiceID firstID = (JSLPServiceID) first.getServiceID();
- IServiceID secondID = (JSLPServiceID) second.getServiceID();
- IServiceTypeID firstTypeID = firstID.getServiceTypeID();
- IServiceTypeID secondTypeID = secondID.getServiceTypeID();
+ final IServiceID firstID = first.getServiceID();
+ final IServiceID secondID = second.getServiceID();
+ final IServiceTypeID firstTypeID = firstID.getServiceTypeID();
+ final IServiceTypeID secondTypeID = secondID.getServiceTypeID();
- boolean protocolsSame = Arrays.equals(firstTypeID.getProtocols(), secondTypeID.getProtocols());
- boolean weightSame = first.getWeight() == second.getWeight();
- boolean prioSame = first.getPriority() == second.getPriority();
- String firstName = firstID.getName();
- String secondName = secondID.getName();
- boolean nameSame = firstName.equals(secondName);
- String[] firstServices = firstTypeID.getServices();
- String[] secondServices = secondTypeID.getServices();
- boolean serviceSame = Arrays.equals(firstServices, secondServices);
- Namespace firstNamespace = firstID.getNamespace();
- Namespace secondNamespace = secondID.getNamespace();
- boolean namespaceSame = firstNamespace.equals(secondNamespace);
- String firstNA = firstTypeID.getNamingAuthority();
- String secondsSA = secondTypeID.getNamingAuthority();
- boolean naSame = firstNA.equals(secondsSA);
- URI firstLocation = first.getLocation();
- URI secondLocation = second.getLocation();
- boolean locationSame = firstLocation.equals(secondLocation);
- boolean scopesSame = Arrays.equals(firstTypeID.getScopes(), secondTypeID.getScopes());
- boolean propertySame = first.getServiceProperties().equals(second.getServiceProperties());
- boolean result = protocolsSame && weightSame && prioSame && nameSame && namespaceSame && serviceSame && naSame && locationSame && scopesSame && propertySame;
+ final boolean protocolsSame = Arrays.equals(firstTypeID.getProtocols(), secondTypeID.getProtocols());
+ final boolean weightSame = first.getWeight() == second.getWeight();
+ final boolean prioSame = first.getPriority() == second.getPriority();
+ final String firstName = firstID.getName();
+ final String secondName = secondID.getName();
+ final boolean nameSame = firstName.equals(secondName);
+ final String[] firstServices = firstTypeID.getServices();
+ final String[] secondServices = secondTypeID.getServices();
+ final boolean serviceSame = Arrays.equals(firstServices, secondServices);
+ final Namespace firstNamespace = firstID.getNamespace();
+ final Namespace secondNamespace = secondID.getNamespace();
+ final boolean namespaceSame = firstNamespace.equals(secondNamespace);
+ final String firstNA = firstTypeID.getNamingAuthority();
+ final String secondsSA = secondTypeID.getNamingAuthority();
+ final boolean naSame = firstNA.equals(secondsSA);
+ final URI firstLocation = first.getLocation();
+ final URI secondLocation = second.getLocation();
+ final boolean locationSame = firstLocation.equals(secondLocation);
+ final boolean scopesSame = Arrays.equals(firstTypeID.getScopes(), secondTypeID.getScopes());
+ final IServiceProperties firstProperty = first.getServiceProperties();
+ final IServiceProperties secondProperty = second.getServiceProperties();
+ final boolean propertySame = firstProperty.equals(secondProperty);
+ final boolean result = protocolsSame && weightSame && prioSame && nameSame && namespaceSame && serviceSame && naSame && locationSame && scopesSame && propertySame;
if(result == true) {
return 0;
}

Back to the top