diff options
Diffstat (limited to 'tests/org.eclipse.jst.ws.tests')
5 files changed, 155 insertions, 9 deletions
diff --git a/tests/org.eclipse.jst.ws.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.jst.ws.tests/.settings/org.eclipse.jdt.core.prefs index 8f43d8c78..5af02d52d 100644 --- a/tests/org.eclipse.jst.ws.tests/.settings/org.eclipse.jdt.core.prefs +++ b/tests/org.eclipse.jst.ws.tests/.settings/org.eclipse.jdt.core.prefs @@ -1,21 +1,17 @@ -#Mon Jan 30 10:36:41 EST 2006 +#Tue Mar 20 16:58:35 EST 2007 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.deprecation=ignore org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning @@ -54,4 +50,3 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 diff --git a/tests/org.eclipse.jst.ws.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.jst.ws.tests/META-INF/MANIFEST.MF index b7d821de6..373e5ebae 100644 --- a/tests/org.eclipse.jst.ws.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.jst.ws.tests/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %PLUGIN_NAME -Bundle-SymbolicName: org.eclipse.jst.ws.tests +Bundle-SymbolicName: org.eclipse.jst.ws.tests;singleton:=true Bundle-Version: 1.0.200.qualifier Bundle-ClassPath: tests.jar Bundle-Activator: org.eclipse.jst.ws.tests.plugin.TestsPlugin @@ -38,5 +38,6 @@ Require-Bundle: org.eclipse.jst.ws.consumption.ui, org.eclipse.jdt.launching, org.eclipse.jdt.debug.ui, org.eclipse.jst.server.tomcat.core, - org.eclipse.wst.common.project.facet.core + org.eclipse.wst.common.project.facet.core, + org.eclipse.wst.ws.explorer Eclipse-LazyStart: true diff --git a/tests/org.eclipse.jst.ws.tests/plugin.properties b/tests/org.eclipse.jst.ws.tests/plugin.properties index 6f05835fc..7e39471b1 100644 --- a/tests/org.eclipse.jst.ws.tests/plugin.properties +++ b/tests/org.eclipse.jst.ws.tests/plugin.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2006 IBM Corporation and others. +# Copyright (c) 2006, 2007 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 @@ -10,6 +10,7 @@ # yyyymmdd bug Email and other contact information # -------- -------- ----------------------------------------------------------- # 20060424 138060 kathy@ca.ibm.com - Kathy Chan +# 20070327 172339 kathy@ca.ibm.com - Kathy Chan ############################################################################### # @@ -17,3 +18,8 @@ # PLUGIN_NAME=Java Web Services Tools Tests PLUGIN_PROVIDER=Eclipse.org + +POPUP_TEST_WSDL=Test with Web Services Explorer +ACTION_GENERATE_JAVA_SKELETON=Generate Java bean skeleton +ACTION_GENERATE_JAVA_PROXY=Generate Client + diff --git a/tests/org.eclipse.jst.ws.tests/plugin.xml b/tests/org.eclipse.jst.ws.tests/plugin.xml index 7bf65fb5f..af4559b4f 100644 --- a/tests/org.eclipse.jst.ws.tests/plugin.xml +++ b/tests/org.eclipse.jst.ws.tests/plugin.xml @@ -2,5 +2,61 @@ <?eclipse version="3.0"?> <plugin> + <extension + point="org.eclipse.ui.popupMenus"> + + <objectContribution + objectClass="org.eclipse.jst.j2ee.webservice.wsdd.ServletLink" + nameFilter="*" + id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard.java"> + <action + label="%ACTION_GENERATE_JAVA_SKELETON" + class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard" + menubarPath="additions" + id="org.eclipse.jst.ws.creation.ui.wizard.serverwizard"> + </action> + </objectContribution> + + <objectContribution + objectClass="org.eclipse.jst.j2ee.webservice.wsdd.ServletLink" + nameFilter="*" + id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard"> + <action + label="%ACTION_GENERATE_JAVA_PROXY" + class="org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard" + menubarPath="additions" + id="org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard"> + </action> + </objectContribution> + + <objectContribution + objectClass="org.eclipse.jst.j2ee.webservice.wsdd.ServletLink" + nameFilter="*" + id="org.eclipse.jst.ws.internal.consumption.ui.action.WSDLFileMenu"> + <action + label="%POPUP_TEST_WSDL" + class="org.eclipse.wst.ws.internal.explorer.popup.PopupTestWSDL" + menubarPath="additions" + id="org.eclipse.wst.ws.internal.explorer.popup.PopupTestWSDL"> + </action> + </objectContribution> + + </extension> + +<extension point="org.eclipse.core.runtime.adapters"> + <factory + class="org.eclipse.jst.ws.tests.util.WSCustomAdapterFactory" + adaptableType="org.eclipse.jst.j2ee.webservice.wsdd.ServletLink"> + <adapter type="org.eclipse.core.resources.IFile"/> + </factory> + </extension> + + <extension point="org.eclipse.core.runtime.adapters"> + <factory + class="org.eclipse.jst.ws.tests.util.WSCustomAdapterFactory" + adaptableType="org.eclipse.jst.j2ee.webservice.wsdd.ServletLink"> + <adapter type="java.lang.String"/> + </factory> + </extension> </plugin> diff --git a/tests/org.eclipse.jst.ws.tests/tests/org/eclipse/jst/ws/tests/util/WSCustomAdapterFactory.java b/tests/org.eclipse.jst.ws.tests/tests/org/eclipse/jst/ws/tests/util/WSCustomAdapterFactory.java new file mode 100644 index 000000000..128c48cd4 --- /dev/null +++ b/tests/org.eclipse.jst.ws.tests/tests/org/eclipse/jst/ws/tests/util/WSCustomAdapterFactory.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2007 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * yyyymmdd bug Email and other contact information + * -------- -------- ----------------------------------------------------------- + * 20070327 172339 kathy@ca.ibm.com - Kathy Chan + *******************************************************************************/ +package org.eclipse.jst.ws.tests.util; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.core.runtime.IPath; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jem.util.emf.workbench.ProjectUtilities; +import org.eclipse.jst.j2ee.webservice.wsdd.ServletLink; +import org.eclipse.jst.j2ee.webservice.wsdd.ServiceImplBean; +import org.eclipse.jst.j2ee.webservice.wsdd.WebServiceDescription; +import org.eclipse.jst.ws.internal.common.J2EEUtils; +import org.eclipse.jst.ws.internal.common.ResourceUtils; + +public class WSCustomAdapterFactory implements IAdapterFactory { + + private static final Class[] types = { + IFile.class, String.class + }; + + public Object getAdapter(Object adaptableObject, Class adapterType) { + if (adaptableObject instanceof ServletLink) { + System.out.println("getAdapter on "+adaptableObject.toString()); + ServletLink beanLink = (ServletLink) adaptableObject; + + IFile wsdlFile = getWSDLFile(beanLink); + System.out.println("wsdlFile = "+wsdlFile); + if (adapterType == IFile.class) { + return wsdlFile; + } else + if (adapterType == String.class) { + String wsdlFileString = wsdlFile.getLocationURI().toString(); + System.out.println("wsdlFileString = "+wsdlFileString); + return wsdlFileString; + } else { + return null; + } + } + else { + return null; + } + } + + public Class[] getAdapterList() { + return types; + } + + private IFile getWSDLFile(ServiceImplBean bean) { + EObject eObject = bean.eContainer(); + if (eObject == null) + return null; + + eObject = eObject.eContainer(); + + if (eObject instanceof WebServiceDescription) { + WebServiceDescription wsd = (WebServiceDescription) eObject; + + IProject project = ProjectUtilities.getProject(wsd); + + IPath path = J2EEUtils.getWebContentPath(project); + path = path.append(wsd.getWsdlFile()); + return ResourceUtils.getWorkspaceRoot().getFile(path); + + } + return null; + } + + private IFile getWSDLFile(ServletLink link) { + EObject eObject = link.eContainer(); + if (eObject instanceof ServiceImplBean) + return getWSDLFile((ServiceImplBean) eObject); + return null; + } + +} |