Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkuppe2008-10-25 16:41:54 +0000
committermkuppe2008-10-25 16:41:54 +0000
commitbafe6699cc3c815d883b844ff35bc1752eae4535 (patch)
tree3e6eb5fca1163d27699a8a5cb31916cf3a028fcd
parentb190981e8255939a4ed4e1fd45c31f501e1a0456 (diff)
downloadorg.eclipse.ecf-bafe6699cc3c815d883b844ff35bc1752eae4535.tar.gz
org.eclipse.ecf-bafe6699cc3c815d883b844ff35bc1752eae4535.tar.xz
org.eclipse.ecf-bafe6699cc3c815d883b844ff35bc1752eae4535.zip
NEW - bug 252092: [Discovery][Composite] Add composite tests
https://bugs.eclipse.org/bugs/show_bug.cgi?id=252092
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/.classpath7
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/.project28
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/.settings/org.eclipse.jdt.core.prefs20
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/META-INF/MANIFEST.MF16
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/about.html28
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/build.properties4
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/config.ini27
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/plugin.properties10
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/src/org/eclipse/ecf/tests/provider/discovery/CompositeDiscoveryContainerTest.java21
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.provider.discovery/src/org/eclipse/ecf/tests/provider/discovery/CompositeServiceInfoComporator.java42
11 files changed, 207 insertions, 0 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.classpath b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.classpath
new file mode 100644
index 000000000..7cdeb7319
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.project b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.project
new file mode 100644
index 000000000..0c7a2059d
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ecf.tests.provider.discovery</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.settings/org.eclipse.jdt.core.prefs b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..5b28f8bfb
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,20 @@
+#Fri May 02 09:35:43 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.source=1.3
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.settings/org.eclipse.pde.core.prefs b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..38a01704a
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+#Sun Oct 07 16:26:19 PDT 2007
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/META-INF/MANIFEST.MF b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..8c2a2cd81
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %plugin.name
+Bundle-SymbolicName: org.eclipse.ecf.tests.provider.discovery
+Bundle-Version: 2.1.0.qualifier
+Import-Package: org.osgi.framework;version="1.4.0",
+ org.osgi.util.tracker;version="1.3.3"
+Require-Bundle: org.junit,
+ org.eclipse.ecf,
+ org.eclipse.ecf.discovery,
+ org.eclipse.equinox.common,
+ org.eclipse.ecf.tests.discovery,
+ org.eclipse.ecf.provider.discovery
+Bundle-Vendor: %plugin.provider
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
+ J2SE-1.4
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/about.html b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/about.html
new file mode 100644
index 000000000..2535c6aaa
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 14, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/build.properties b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/build.properties
new file mode 100644
index 000000000..34d2e4d2d
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/config.ini b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/config.ini
new file mode 100644
index 000000000..4ad8683a1
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/config.ini
@@ -0,0 +1,27 @@
+# Eclipse runtime configuration file
+# This file contains a number of key/value pairs that are merged into the
+# System properties on system startup. The values control the way the
+# runtime is structured and runs.
+
+# The comma-separated list of bundles which are automatically installed and optionally started
+# once the system is up and running. Each entry if of the form
+# <URL | simple bundle location>[@ [<startlevel>] [":start"]]
+# If the startlevel is omitted then the framework will use the default start level for the bundle.
+# If the "start" tag is added then the bundle will be marked as started after being installed.
+# Simple bundle locations are interepreted as relative to the framework's parent directory.
+# The startlevel indicates the OSGi start level at which the bundle should run.
+# If this value is not set, the system computes an appropriate default.
+osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.core.runtime@start, org.eclipse.equinox.log@4:start, org.eclipse.ecf.provider.jslp@4:start, org.eclipse.ecf.provider.jmdns@4:start
+
+# The product to run. A given Eclipse configuration may contain many products.
+# The product identified will supply the branding (window icons, title bar text) etc
+# as well as define the default application to run.
+eclipse.product=org.eclipse.sdk.ide
+# The default workspace location
+osgi.instance.area.default=@user.home/workspace
+
+# entry required for gtk configurations of eclipse to enable stand-alone help
+osgi.ws=gtk
+
+# End of file marker - must be here
+eof=eof
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/plugin.properties b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/plugin.properties
new file mode 100644
index 000000000..72f1aa314
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/plugin.properties
@@ -0,0 +1,10 @@
+/****************************************************************************
+* Copyright (c) 2007 Versant Corp., IBM Corp. and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+*****************************************************************************/
+plugin.name = ECF Discovery Provider Tests
+plugin.provider = Eclipse.org
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/src/org/eclipse/ecf/tests/provider/discovery/CompositeDiscoveryContainerTest.java b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/src/org/eclipse/ecf/tests/provider/discovery/CompositeDiscoveryContainerTest.java
new file mode 100644
index 000000000..5c815eeb7
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/src/org/eclipse/ecf/tests/provider/discovery/CompositeDiscoveryContainerTest.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Versant Corp.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.tests.provider.discovery;
+
+import org.eclipse.ecf.tests.discovery.DiscoveryTest;
+
+public class CompositeDiscoveryContainerTest extends DiscoveryTest {
+
+ public CompositeDiscoveryContainerTest() {
+ super("ecf.discovery.*");
+ setComparator(new CompositeServiceInfoComporator());
+ }
+}
diff --git a/tests/bundles/org.eclipse.ecf.tests.provider.discovery/src/org/eclipse/ecf/tests/provider/discovery/CompositeServiceInfoComporator.java b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/src/org/eclipse/ecf/tests/provider/discovery/CompositeServiceInfoComporator.java
new file mode 100644
index 000000000..7bd5d86b3
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.provider.discovery/src/org/eclipse/ecf/tests/provider/discovery/CompositeServiceInfoComporator.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Versant Corp.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Markus Kuppe (mkuppe <at> versant <dot> com) - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.tests.provider.discovery;
+
+import java.net.URI;
+
+import org.eclipse.ecf.discovery.IServiceInfo;
+import org.eclipse.ecf.discovery.identity.IServiceID;
+import org.eclipse.ecf.tests.discovery.ServiceInfoComparator;
+
+public class CompositeServiceInfoComporator extends ServiceInfoComparator {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ecf.tests.discovery.ServiceInfoComparator#compare(java.lang.Object, java.lang.Object)
+ */
+ public int compare(Object arg0, Object arg1) {
+ if (arg0 instanceof IServiceInfo && arg1 instanceof IServiceInfo) {
+ final IServiceInfo first = (IServiceInfo) arg0;
+ final IServiceInfo second = (IServiceInfo) arg1;
+ final URI uri1 = first.getLocation();
+ final URI uri2 = second.getLocation();
+ IServiceID firstID = first.getServiceID();
+ IServiceID secondID = second.getServiceID();
+ //TODO-mkuppe No prio, weight and protocol atm in the JSLP testcase
+ boolean serviceIDs = firstID.getName().equals(secondID.getName()) && firstID.getServiceName().equals(secondID.getServiceName()) && firstID.getServiceTypeID().equals(secondID.getServiceTypeID());
+ final boolean result = (serviceIDs && uri1.getHost().equals(uri2.getHost()) && uri1.getPort() == uri2.getPort()/* && first.getPriority() == second.getPriority() && first.getWeight() == second.getWeight() */&& compareServiceProperties(first.getServiceProperties(), second.getServiceProperties()));
+ if (result == true) {
+ return 0;
+ }
+ }
+ return -1;
+ }
+
+}

Back to the top