[572133] Change BVTValidationBatch from an IPlatformRunnable to an IApplication

Signed-off-by: Nitin Dahyabhai <thatnitind@gmail.com>
Change-Id: I1b32bf7a91ae75cd6eaf5b9ac2319dce988ff729
diff --git a/plugins/org.eclipse.jst.j2ee.webservice.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee.webservice.ui/META-INF/MANIFEST.MF
index 34e23c1..b8affb8 100644
--- a/plugins/org.eclipse.jst.j2ee.webservice.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.j2ee.webservice.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.j2ee.webservice.ui; singleton:=true
-Bundle-Version: 1.1.700.qualifier
+Bundle-Version: 1.1.800.qualifier
 Bundle-Activator: org.eclipse.jst.j2ee.internal.webservice.plugin.WebServiceUIPlugin
 Bundle-Vendor: %pluginVendor
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.j2ee.webservice.ui/pom.xml b/plugins/org.eclipse.jst.j2ee.webservice.ui/pom.xml
index ac99aa6..0d0ccc1 100644
--- a/plugins/org.eclipse.jst.j2ee.webservice.ui/pom.xml
+++ b/plugins/org.eclipse.jst.j2ee.webservice.ui/pom.xml
@@ -21,6 +21,6 @@
 
   <groupId>org.eclipse.webtools.javaee</groupId>
   <artifactId>org.eclipse.jst.j2ee.webservice.ui</artifactId>
-  <version>1.1.700-SNAPSHOT</version>
+  <version>1.1.800-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/plugins/org.eclipse.jst.j2ee.webservice.ui/webservices_ui/org/eclipse/jst/j2ee/internal/webservice/WebServiceViewerSynchronization.java b/plugins/org.eclipse.jst.j2ee.webservice.ui/webservices_ui/org/eclipse/jst/j2ee/internal/webservice/WebServiceViewerSynchronization.java
index 456ddf8..81c9aab 100644
--- a/plugins/org.eclipse.jst.j2ee.webservice.ui/webservices_ui/org/eclipse/jst/j2ee/internal/webservice/WebServiceViewerSynchronization.java
+++ b/plugins/org.eclipse.jst.j2ee.webservice.ui/webservices_ui/org/eclipse/jst/j2ee/internal/webservice/WebServiceViewerSynchronization.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2021 IBM Corporation 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
@@ -26,7 +26,6 @@
 import org.eclipse.wst.common.internal.emfworkbench.integration.DynamicAdapterFactory;
 import org.eclipse.wst.common.project.facet.core.internal.FacetedProjectPropertyTester;
 import org.eclipse.wst.project.facet.ProductManager;
-import org.eclipse.jst.j2ee.internal.webservice.WebServiceUIResourceHandler;
 
 public class WebServiceViewerSynchronization implements WebServiceManagerListener{
 	
diff --git a/tests/org.eclipse.jst.j2ee.core.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.jst.j2ee.core.tests/META-INF/MANIFEST.MF
index 5524db7..cd6e82b 100644
--- a/tests/org.eclipse.jst.j2ee.core.tests/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.jst.j2ee.core.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.jst.j2ee.core.tests
-Bundle-Version: 1.1.500.qualifier
+Bundle-Version: 1.1.600.qualifier
 Bundle-ClassPath: tests.jar
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/tests/org.eclipse.jst.j2ee.core.tests/commonArchiveTests/org/eclipse/jst/j2ee/core/tests/bvt/AutomatedBVT.java b/tests/org.eclipse.jst.j2ee.core.tests/commonArchiveTests/org/eclipse/jst/j2ee/core/tests/bvt/AutomatedBVT.java
index 304969d..9091414 100644
--- a/tests/org.eclipse.jst.j2ee.core.tests/commonArchiveTests/org/eclipse/jst/j2ee/core/tests/bvt/AutomatedBVT.java
+++ b/tests/org.eclipse.jst.j2ee.core.tests/commonArchiveTests/org/eclipse/jst/j2ee/core/tests/bvt/AutomatedBVT.java
@@ -23,13 +23,14 @@
  */
 public class AutomatedBVT extends TestSuite {
 
-    public static String baseDirectory = System.getProperty("user.dir") + java.io.File.separatorChar + "commonArchiveResources" + java.io.File.separatorChar;
+    public static String baseDirectory;
     
     static {
         try {
         	AutomatedBVT.baseDirectory = FileLocator.toFileURL(Platform.getBundle("org.eclipse.jst.j2ee.core.tests").getEntry("")).getFile() + "commonArchiveResources" + java.io.File.separatorChar;
 		} catch (Exception e) { 
 			System.err.println("Using working directory since a workspace URL could not be located.");
+			baseDirectory = System.getProperty("user.dir") + java.io.File.separatorChar + "commonArchiveResources" + java.io.File.separatorChar;
 		} 
     }
 
diff --git a/tests/org.eclipse.jst.j2ee.core.tests/pom.xml b/tests/org.eclipse.jst.j2ee.core.tests/pom.xml
index 8c5d0c1..922ae0a 100644
--- a/tests/org.eclipse.jst.j2ee.core.tests/pom.xml
+++ b/tests/org.eclipse.jst.j2ee.core.tests/pom.xml
@@ -21,7 +21,7 @@
 
   <groupId>org.eclipse.webtools.javaee</groupId>
   <artifactId>org.eclipse.jst.j2ee.core.tests</artifactId>
-  <version>1.1.500-SNAPSHOT</version>
+  <version>1.1.600-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
   
   <!-- Do not sign inner jars, see bug 274743 - Some unit tests are sensitive to details of build -->
diff --git a/tests/org.eclipse.jst.validation.test/META-INF/MANIFEST.MF b/tests/org.eclipse.jst.validation.test/META-INF/MANIFEST.MF
index 4baedd6..7f15415 100644
--- a/tests/org.eclipse.jst.validation.test/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.jst.validation.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.jst.validation.test;singleton:=true
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.1.300.qualifier
 Bundle-Localization: plugin
 Bundle-Activator: org.eclipse.jst.validation.test.BVTValidationPlugin
 Require-Bundle: org.eclipse.core.runtime,
diff --git a/tests/org.eclipse.jst.validation.test/pom.xml b/tests/org.eclipse.jst.validation.test/pom.xml
index 4eca4d3..1a87973 100644
--- a/tests/org.eclipse.jst.validation.test/pom.xml
+++ b/tests/org.eclipse.jst.validation.test/pom.xml
@@ -21,6 +21,6 @@
 
   <groupId>org.eclipse.webtools.javaee</groupId>
   <artifactId>org.eclipse.jst.validation.test</artifactId>
-  <version>1.1.200-SNAPSHOT</version>
+  <version>1.1.300-SNAPSHOT</version>
   <packaging>eclipse-test-plugin</packaging>
 </project>
diff --git a/tests/org.eclipse.jst.validation.test/test/org/eclipse/jst/validation/test/BVTValidationBatch.java b/tests/org.eclipse.jst.validation.test/test/org/eclipse/jst/validation/test/BVTValidationBatch.java
index 56d2207..365659e 100644
--- a/tests/org.eclipse.jst.validation.test/test/org/eclipse/jst/validation/test/BVTValidationBatch.java
+++ b/tests/org.eclipse.jst.validation.test/test/org/eclipse/jst/validation/test/BVTValidationBatch.java
@@ -5,14 +5,15 @@
 import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPlatformRunnable;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
 import org.eclipse.jem.util.logger.proxy.Logger;
 import org.eclipse.jst.validation.test.internal.util.BVTRunner;
 import org.eclipse.jst.validation.test.internal.util.BVTValidationUtility;
 /**
  */
-public class BVTValidationBatch implements IPlatformRunnable {
+public class BVTValidationBatch implements IApplication {
 	private String _dir = null; // The test cases (.ear, .jar) are identified through a relative directory, and this is the parent of that relative directory.
 	private boolean _verbose = false;
 	static Boolean _passed = null;
@@ -101,7 +102,14 @@
 		catch(CoreException exc) {
 			throw new BVTValidationException(exc);
 		}
-		return _passed;
+		return _passed.booleanValue() ? EXIT_OK : _passed;
+	}
+
+	public Object start(IApplicationContext context) throws Exception {
+		return run(context.getArguments().get(IApplicationContext.APPLICATION_ARGS));
+	}
+
+	public void stop() {
 	}
 	
 }
diff --git a/tests/org.eclipse.jst.validation.test/test/org/eclipse/jst/validation/test/internal/registry/BVTValidationRegistryReader.java b/tests/org.eclipse.jst.validation.test/test/org/eclipse/jst/validation/test/internal/registry/BVTValidationRegistryReader.java
index bb7b0ba..ed5920c 100644
--- a/tests/org.eclipse.jst.validation.test/test/org/eclipse/jst/validation/test/internal/registry/BVTValidationRegistryReader.java
+++ b/tests/org.eclipse.jst.validation.test/test/org/eclipse/jst/validation/test/internal/registry/BVTValidationRegistryReader.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2021 IBM Corporation 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
@@ -22,7 +22,7 @@
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IExtension;
 import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginRegistry;
+import org.eclipse.core.runtime.IExtensionRegistry;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jem.util.logger.proxy.Logger;
@@ -445,7 +445,7 @@
 		 * Returns the operation extension point
 		 */
 		private IExtensionPoint getTestcaseExtensionPoint() {
-			IPluginRegistry registry = Platform.getPluginRegistry();
+			IExtensionRegistry registry = Platform.getExtensionRegistry();
 			IExtensionPoint extensionPoint = registry.getExtensionPoint(PLUGIN_ID, VALIDATOR_TESTCASE_EXT_PT_ID);
 			if (extensionPoint == null) {
 				// If this happens it means that someone removed the "validator" extension point declaration 
@@ -642,7 +642,7 @@
 		 * Returns the TestCase extension point
 		 */
 		private IExtensionPoint getOperationTestcaseExtensionPoint() {
-			IPluginRegistry registry = Platform.getPluginRegistry();
+			IExtensionRegistry registry = Platform.getExtensionRegistry();
 			IExtensionPoint extensionPoint = registry.getExtensionPoint(PLUGIN_ID, VALIDATOR_OPERATION_TESTCASE_EXT_PT_ID);
 			if (extensionPoint == null) {
 				// If this happens it means that someone removed the "optest" extension point declaration 
@@ -802,7 +802,7 @@
 		 * Returns the TestCaseSetup extension point
 		 */
 		private IExtensionPoint getSetupExtensionPoint() {
-			IPluginRegistry registry = Platform.getPluginRegistry();
+			IExtensionRegistry registry = Platform.getExtensionRegistry();
 			IExtensionPoint extensionPoint = registry.getExtensionPoint(PLUGIN_ID, VALIDATOR_SETUP_EXT_PT_ID);
 			if (extensionPoint == null) {
 				// If this happens it means that someone removed the "validator" extension point declaration