JBoss Tools SVN: r21305 - in trunk/jsf: plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check and 19 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-04-07 09:39:19 -0400 (Wed, 07 Apr 2010)
New Revision: 21305
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/JSFNaturesInfoDialog.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/KBNaturesInfoDialog.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/AddJSFCapabilitiesWizard.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/MarkerUtils.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/QuickFixPage.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/QuickFixWizard.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.classpath
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.project
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/.jsdtscope
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.jdt.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.common.component
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/Messages.properties
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/User.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/META-INF/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/demo/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/demo/Messages.properties
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/demo/User.class
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/faces-config.xml
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/lib/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/lib/jsf-api.jar
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/lib/jsf-impl.jar
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/index.jsp
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/hello.jsp
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/inputUserName.jsp
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/build.properties
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/build.xml
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckTest/
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFNaturesInfoDialog_JBIDE5701.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/KbNaturesInfoDialog_JBIDE6125.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/NaturesInfoDialogTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestUtil.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/naturesCheckTest/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesInfoDialog.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/plugin.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6125 - fixed
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java 2010-04-07 13:27:06 UTC (rev 21304)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -12,17 +12,12 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.jsf.ui.editor.check.ProjectNaturesChecker;
-import org.jboss.tools.jsf.ui.editor.check.ProjectNaturesPartListener;
import org.osgi.framework.BundleContext;
public class JsfUiPlugin extends BaseUIPlugin {
-
- private ProjectNaturesPartListener partListener = new ProjectNaturesPartListener();
public static String PLUGIN_ID = "org.jboss.tools.jsf.ui"; //$NON-NLS-1$
@@ -31,8 +26,7 @@
public void start(BundleContext context) throws Exception {
super.start(context);
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- window.getPartService().addPartListener(partListener);
+ ProjectNaturesChecker.getInstance();
}
public static JsfUiPlugin getDefault() {
@@ -60,14 +54,6 @@
@Override
public void stop(BundleContext context) throws Exception {
- if (partListener != null) {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- window.getPartService().removePartListener(partListener);
- partListener = null;
- }
- ProjectNaturesChecker naturesChecker = ProjectNaturesChecker.getInstance();
- naturesChecker.dispose();
- naturesChecker = null;
super.stop(context);
}
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java 2010-04-07 13:27:06 UTC (rev 21304)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.jsf.ui.editor.check;
-
-import org.eclipse.core.resources.IProject;
-import org.jboss.tools.jsf.ui.action.AddJSFNatureActionDelegate;
-
-/**
- *
- * @author yzhishko
- *
- */
-
-public class AddJSFCapabilitiesDelegate extends AddJSFNatureActionDelegate {
-
- private static AddJSFCapabilitiesDelegate instance = new AddJSFCapabilitiesDelegate();
-
- private AddJSFCapabilitiesDelegate() {
- }
-
- public static AddJSFCapabilitiesDelegate getInstance(IProject project) {
- instance.setProject(project);
- return instance;
- }
-
- public void setProject(IProject project) {
- this.project = project;
- }
-
-}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/JSFNaturesInfoDialog.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/JSFNaturesInfoDialog.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/JSFNaturesInfoDialog.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.editor.check;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.jsf.ui.editor.check.wizards.AddJSFCapabilitiesWizard;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class JSFNaturesInfoDialog extends ProjectNaturesInfoDialog {
+
+ private static final String fixButtonLabel = "Add JSF Capabilities..."; //$NON-NLS-1$
+
+ public JSFNaturesInfoDialog(IProject project) {
+ super(project, fixButtonLabel);
+ }
+
+ @Override
+ protected void fixButtonPressed() {
+ BusyIndicator.showWhile(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell().getDisplay(),
+ new Runnable() {
+ public void run() {
+ AddJSFCapabilitiesWizard.getInstance(project).run(
+ null);
+ }
+ });
+ }
+
+ @Override
+ protected String getMessageInfo() {
+ String dialogMessage = "JBoss Tools Editor might not fully work in project \"" + project.getName() + //$NON-NLS-1$
+ "\" because it does not have JSF and code completion enabled completely.\n\n" //$NON-NLS-1$
+ + "Please use the Configure menu on the project or \"Add JSF Capabilities...\" fix button to enable JSF if " //$NON-NLS-1$
+ + "you want all features of the editor working."; //$NON-NLS-1$
+ return dialogMessage;
+ }
+
+ @Override
+ protected void skipButtonPressed() {
+ try {
+ project.setPersistentProperty(
+ ProjectNaturesChecker.IS_JSF_NATURES_CHECK_NEED, Boolean
+ .toString(!isRemember));
+ } catch (CoreException e) {
+ }
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/KBNaturesInfoDialog.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/KBNaturesInfoDialog.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/KBNaturesInfoDialog.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.editor.check;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.internal.views.markers.MarkerSupportInternalUtilities;
+import org.eclipse.ui.views.markers.internal.MarkerMessages;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
+import org.jboss.tools.jsf.ui.editor.check.wizards.QuickFixWizard;
+import org.jboss.tools.jst.web.kb.internal.KbProject;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class KBNaturesInfoDialog extends ProjectNaturesInfoDialog {
+
+ private static final String fixButtonLabel = "Enable JSF Code Completion..."; //$NON-NLS-1$
+
+ public KBNaturesInfoDialog(IProject project) {
+ super(project, fixButtonLabel);
+ }
+
+ @Override
+ protected void fixButtonPressed() {
+ try {
+ IMarker kbProblemMarker = null;
+ IMarker[] markers = project.findMarkers(null, false, 1);
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ String _type = marker.getType();
+ if (_type != null
+ && _type.equals(KbProject.KB_PROBLEM_MARKER_TYPE)) {
+ kbProblemMarker = marker;
+ break;
+ }
+ }
+ if (kbProblemMarker != null) {
+ Map<IMarkerResolution, List<IMarker>> resolutions = new LinkedHashMap<IMarkerResolution, List<IMarker>>(
+ 0);
+ List<IMarker> markerList = new ArrayList<IMarker>(0);
+ IMarkerResolution[] markerResolutions = IDE
+ .getMarkerHelpRegistry()
+ .getResolutions(kbProblemMarker);
+ markerList.add(kbProblemMarker);
+ resolutions.put(markerResolutions[0], markerList);
+ String markerDescription = kbProblemMarker.getAttribute(
+ IMarker.MESSAGE,
+ MarkerSupportInternalUtilities.EMPTY_STRING);
+ String description = NLS.bind(
+ MarkerMessages.MarkerResolutionDialog_Description,
+ markerDescription);
+ QuickFixWizard fixWizard = new QuickFixWizard(description,
+ resolutions);
+ fixWizard
+ .setWindowTitle(MarkerMessages.resolveMarkerAction_dialogTitle);
+ WizardDialog dialog = new QuickFixWizardDialog(PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow().getShell(),
+ fixWizard);
+ dialog.open();
+ }
+ } catch (CoreException e) {
+ JsfUiPlugin.getDefault().logError(e);
+ }
+
+ }
+
+ @Override
+ protected String getMessageInfo() {
+ String dialogMessage = "The project \"" + project.getName() + //$NON-NLS-1$
+ "\" does not have JSF code completion and validation enabled completely.\n\n" //$NON-NLS-1$
+ + "Please use \"Enabale JSF Code Completion...\" fix button if " //$NON-NLS-1$
+ + "you want these features working."; //$NON-NLS-1$
+ return dialogMessage;
+ }
+
+ private class QuickFixWizardDialog extends WizardDialog {
+
+ /**
+ * @param parentShell
+ * @param newWizard
+ */
+ public QuickFixWizardDialog(Shell parentShell, IWizard newWizard) {
+ super(parentShell, newWizard);
+ setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER
+ | SWT.MODELESS | SWT.RESIZE | getDefaultOrientation());
+ }
+
+ }
+
+ @Override
+ protected void skipButtonPressed() {
+ try {
+ project.setPersistentProperty(
+ ProjectNaturesChecker.IS_KB_NATURES_CHECK_NEED, Boolean
+ .toString(!isRemember));
+ } catch (CoreException e) {
+ }
+ }
+
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java 2010-04-07 13:27:06 UTC (rev 21304)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -10,9 +10,7 @@
******************************************************************************/
package org.jboss.tools.jsf.ui.editor.check;
-import java.util.ArrayList;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceChangeEvent;
@@ -23,7 +21,11 @@
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.reporting.ProblemReportingHelper;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.util.FileUtil;
@@ -39,29 +41,40 @@
public class ProjectNaturesChecker implements IResourceChangeListener {
+ private ProjectNaturesPartListener partListener = new ProjectNaturesPartListener();
private static final String SEARCH_CLASS = "javax.faces.webapp.FacesServlet"; //$NON-NLS-1$
- public static final QualifiedName IS_NATURES_CHECK_NEED = new QualifiedName(
- "", "Is natures check"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final QualifiedName IS_JSF_NATURES_CHECK_NEED = new QualifiedName(
+ "", "Is JSF natures check"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final QualifiedName IS_KB_NATURES_CHECK_NEED = new QualifiedName(
+ "", "Is KB natures check"); //$NON-NLS-1$ //$NON-NLS-2$
public static final QualifiedName IS_JSF_CHECK_NEED = new QualifiedName(
"", "Is JSF check"); //$NON-NLS-1$ //$NON-NLS-2$
private Set<IProject> projectsCollection;
- private static final String JSF_NATURE = "JavaServer Faces Nature"; //$NON-NLS-1$
- private static final String KB_NATURE = "Knowledge Base Nature"; //$NON-NLS-1$
private static final String STRUTS_NATURE_ID = "org.jboss.tools.struts.strutsnature"; //$NON-NLS-1$
-
+
private static ProjectNaturesChecker checker;
-
- public static ProjectNaturesChecker getInstance(){
+
+ public static ProjectNaturesChecker getInstance() {
if (checker == null) {
checker = new ProjectNaturesChecker();
}
return checker;
}
-
+
private ProjectNaturesChecker() {
projectsCollection = new HashSet<IProject>(0);
ResourcesPlugin.getWorkspace().addResourceChangeListener(this,
IResourceChangeEvent.POST_CHANGE);
+ IWorkbenchWindow window = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ window.getPartService().addPartListener(partListener);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
+ .addDisposeListener(new DisposeListener() {
+
+ public void widgetDisposed(DisposeEvent e) {
+ dispose();
+ }
+ });
}
public void resourceChanged(final IResourceChangeEvent event) {
@@ -81,40 +94,45 @@
}
addProject(project);
boolean isJSFCheck = true;
- boolean isNaturesCheck = true;
+ boolean isJSFNaturesCheck = true;
+ boolean isKBNaturesCheck = true;
updateProjectPersistentProperties(project);
isJSFCheck = Boolean.parseBoolean(project
.getPersistentProperty(IS_JSF_CHECK_NEED));
- isNaturesCheck = Boolean.parseBoolean(project
- .getPersistentProperty(IS_NATURES_CHECK_NEED));
+ isJSFNaturesCheck = Boolean.parseBoolean(project
+ .getPersistentProperty(IS_JSF_NATURES_CHECK_NEED));
+ isKBNaturesCheck = Boolean.parseBoolean(project
+ .getPersistentProperty(IS_KB_NATURES_CHECK_NEED));
if (isJSFCheck) {
- if (isNaturesCheck) {
- String[] missingNatures = getMissingNatures(project);
- if (missingNatures != null) {
- KbProject.checkKBBuilderInstalled(project);
- ProjectNaturesInfoDialog dialog = new ProjectNaturesInfoDialog(
- missingNatures, project);
+ String missingNature = checkMissingNatures(project);
+ if (missingNature != null) {
+ KbProject.checkKBBuilderInstalled(project);
+ ProjectNaturesInfoDialog dialog = null;
+ if (KbProject.NATURE_ID.equals(missingNature)
+ && isKBNaturesCheck) {
+ dialog = new KBNaturesInfoDialog(project);
+ } else if (WebProject.JSF_NATURE_ID.equals(missingNature)
+ && isJSFNaturesCheck) {
+ dialog = new JSFNaturesInfoDialog(project);
+ }
+ if (dialog != null) {
dialog.open();
}
}
}
}
- private String[] getMissingNatures(IProject project) throws CoreException {
- List<String> missingNatures = new ArrayList<String>(0);
+ private String checkMissingNatures(IProject project) throws CoreException {
if (project.getNature(STRUTS_NATURE_ID) != null) {
return null;
}
- if (project.getNature(IKbProject.NATURE_ID) == null) {
- missingNatures.add(JSF_NATURE);
- }
if (project.getNature(WebProject.JSF_NATURE_ID) == null) {
- missingNatures.add(KB_NATURE);
+ return WebProject.JSF_NATURE_ID;
}
- if (missingNatures.size() == 0) {
- return null;
+ if (project.getNature(IKbProject.NATURE_ID) == null) {
+ return IKbProject.NATURE_ID;
}
- return missingNatures.toArray(new String[0]);
+ return null;
}
private void handleResourceChangeEvent(IResourceChangeEvent changeEvent) {
@@ -138,7 +156,8 @@
try {
updateProjectJSFPersistents(project);
} catch (CoreException e) {
- ProblemReportingHelper.reportProblem(JspEditorPlugin.PLUGIN_ID, e);
+ ProblemReportingHelper.reportProblem(
+ JspEditorPlugin.PLUGIN_ID, e);
}
}
}
@@ -152,9 +171,14 @@
if (jsfCheckString == null) {
updateProjectJSFPersistents(project);
}
- if (project.getPersistentProperty(IS_NATURES_CHECK_NEED) == null) {
- project.setPersistentProperty(IS_NATURES_CHECK_NEED, "true"); //$NON-NLS-1$
+ if (project.getPersistentProperty(IS_JSF_NATURES_CHECK_NEED) == null) {
+ project
+ .setPersistentProperty(IS_JSF_NATURES_CHECK_NEED,
+ "true"); //$NON-NLS-1$
}
+ if (project.getPersistentProperty(IS_KB_NATURES_CHECK_NEED) == null) {
+ project.setPersistentProperty(IS_KB_NATURES_CHECK_NEED, "true"); //$NON-NLS-1$
+ }
}
}
@@ -169,6 +193,12 @@
}
public void dispose() {
+ if (partListener != null) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ window.getPartService().removePartListener(partListener);
+ partListener = null;
+ }
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
projectsCollection.clear();
}
@@ -179,7 +209,7 @@
updateProjectJSFPersistents(project);
} catch (CoreException e) {
ProblemReportingHelper.reportProblem(JspEditorPlugin.PLUGIN_ID, e);
- }
+ }
}
private void processRemoveProject(IProject project) {
@@ -202,5 +232,5 @@
}
}
}
-
+
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesInfoDialog.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesInfoDialog.java 2010-04-07 13:27:06 UTC (rev 21304)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesInfoDialog.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -13,8 +13,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
@@ -39,21 +37,21 @@
*
*/
-public class ProjectNaturesInfoDialog extends MessageDialog {
+public abstract class ProjectNaturesInfoDialog extends MessageDialog {
private Button button;
private Link link;
- private boolean isRemember = false;
+ protected boolean isRemember = false;
private static final String QUESTION = "Do not show this dialog again!"; //$NON-NLS-1$
private static final String TITLE = "Missing Natures"; //$NON-NLS-1$
- private IProject project;
+ protected IProject project;
- public ProjectNaturesInfoDialog(String[] missingNatures, IProject project) {
+ protected ProjectNaturesInfoDialog(IProject project, String fixButtonLabel) {
super(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
TITLE, null, "", INFORMATION, //$NON-NLS-1$
- new String[] {"Add JSF Capabilities...", IDialogConstants.OK_LABEL }, 0); //$NON-NLS-1$
+ new String[] { fixButtonLabel, "Skip" }, 0); //$NON-NLS-1$
this.project = project;
- message = getMessageInfo(missingNatures, project);
+ message = getMessageInfo();
}
@Override
@@ -99,22 +97,13 @@
@Override
protected void buttonPressed(int buttonId) {
+ super.buttonPressed(buttonId);
if (buttonId == 0) {
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- AddJSFCapabilitiesDelegate.getInstance(project).run(null);
- }
- });
+ fixButtonPressed();
}
if (buttonId == 1) {
- try {
- project.setPersistentProperty(
- ProjectNaturesChecker.IS_NATURES_CHECK_NEED, Boolean
- .toString(!isRemember));
- } catch (CoreException e) {
- }
+ skipButtonPressed();
}
- super.buttonPressed(buttonId);
}
private void processLink(Link link) {
@@ -138,22 +127,11 @@
}
});
}
+
+ protected abstract String getMessageInfo();
- @SuppressWarnings("unused")
- private String arrayToString(String[] strings) {
- StringBuilder builder = new StringBuilder(""); //$NON-NLS-1$
- for (int i = 0; i < strings.length; i++) {
- builder.append(strings[i] + "\n"); //$NON-NLS-1$
- }
- return builder.toString();
- }
+ protected abstract void fixButtonPressed();
+
+ protected abstract void skipButtonPressed();
- private String getMessageInfo(String[] missingNatures, IProject project) {
- String dialogMessage = "JBoss Tools Visual Editor might not fully work in project \"" + project.getName() + //$NON-NLS-1$
- "\" because it does not have JSF and code completion enabled completely.\n\n" //$NON-NLS-1$
- + "Please use the Configure menu on the project to enable JSF if " //$NON-NLS-1$
- + "you want all features of the editor working."; //$NON-NLS-1$
- return dialogMessage;
- }
-
}
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/AddJSFCapabilitiesWizard.java (from rev 21297, trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/AddJSFCapabilitiesWizard.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/AddJSFCapabilitiesWizard.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.editor.check.wizards;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.jsf.ui.action.AddJSFNatureActionDelegate;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class AddJSFCapabilitiesWizard extends AddJSFNatureActionDelegate {
+
+ private static AddJSFCapabilitiesWizard instance = new AddJSFCapabilitiesWizard();
+
+ private AddJSFCapabilitiesWizard() {
+ }
+
+ public static AddJSFCapabilitiesWizard getInstance(IProject project) {
+ instance.setProject(project);
+ return instance;
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/MarkerUtils.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/MarkerUtils.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/MarkerUtils.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.editor.check.wizards;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
+import org.eclipse.ui.statushandlers.StatusAdapter;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class MarkerUtils {
+
+ static final IMarker[] EMPTY_MARKER_ARRAY = new IMarker[0];
+
+ /**
+ * Return a StatusAdapter for the error
+ *
+ * @param exception
+ * @return StatusAdapter
+ */
+ static final StatusAdapter errorFor(Throwable exception) {
+ IStatus status = new Status(IStatus.ERROR,
+ IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, exception
+ .getLocalizedMessage(), exception);
+ return new StatusAdapter(status);
+ }
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/QuickFixPage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/QuickFixPage.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/QuickFixPage.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,654 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.editor.check.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+import java.util.Map;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
+import org.eclipse.ui.internal.views.markers.ExtendedMarkersView;
+import org.eclipse.ui.internal.views.markers.MarkerSupportInternalUtilities;
+import org.eclipse.ui.statushandlers.StatusManager;
+import org.eclipse.ui.views.markers.WorkbenchMarkerResolution;
+import org.eclipse.ui.views.markers.internal.MarkerMessages;
+import org.eclipse.ui.views.markers.internal.Util;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class QuickFixPage extends WizardPage {
+
+ private Map resolutions;
+ private ListViewer resolutionsList;
+ private CheckboxTableViewer markersTable;
+ /**
+ * Create a new instance of the receiver.
+ *
+ * @param problemDescription
+ * the description of the problem being fixed
+ * @param resolutions
+ * {@link Map} with key of {@link IMarkerResolution} and value of
+ * {@link Collection} of {@link IMarker}
+ */
+ public QuickFixPage(String problemDescription, Map resolutions) {
+ super(problemDescription);
+ this.resolutions = resolutions;
+ setTitle(MarkerMessages.resolveMarkerAction_dialogTitle);
+ setMessage(problemDescription);
+ }
+
+ public void createControl(Composite parent) {
+
+ initializeDialogUnits(parent);
+
+ // Create a new composite as there is the title bar seperator
+ // to deal with
+ Composite control = new Composite(parent, SWT.NONE);
+ control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ setControl(control);
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(control,
+ IWorkbenchHelpContextIds.PROBLEMS_VIEW);
+
+ FormLayout layout = new FormLayout();
+ layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.spacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ control.setLayout(layout);
+
+ Label resolutionsLabel = new Label(control, SWT.NONE);
+ resolutionsLabel
+ .setText(MarkerMessages.MarkerResolutionDialog_Resolutions_List_Title);
+
+ resolutionsLabel.setLayoutData(new FormData());
+
+ createResolutionsList(control);
+
+ FormData listData = new FormData();
+ listData.top = new FormAttachment(resolutionsLabel, 0);
+ listData.left = new FormAttachment(0);
+ listData.right = new FormAttachment(100, 0);
+ listData.height = convertHeightInCharsToPixels(10);
+ resolutionsList.getControl().setLayoutData(listData);
+
+ Label title = new Label(control, SWT.NONE);
+ title
+ .setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Title);
+ FormData labelData = new FormData();
+ labelData.top = new FormAttachment(resolutionsList.getControl(), 0);
+ labelData.left = new FormAttachment(0);
+ title.setLayoutData(labelData);
+
+ createMarkerTable(control);
+
+ Composite buttons = createTableButtons(control);
+ FormData buttonData = new FormData();
+ buttonData.top = new FormAttachment(title, 0);
+ buttonData.right = new FormAttachment(100);
+ buttonData.height = convertHeightInCharsToPixels(10);
+ buttons.setLayoutData(buttonData);
+
+ FormData tableData = new FormData();
+ tableData.top = new FormAttachment(buttons, 0, SWT.TOP);
+ tableData.left = new FormAttachment(0);
+ tableData.bottom = new FormAttachment(100);
+ tableData.right = new FormAttachment(buttons, 0);
+ tableData.height = convertHeightInCharsToPixels(10);
+ markersTable.getControl().setLayoutData(tableData);
+
+ Dialog.applyDialogFont(control);
+
+ resolutionsList.setSelection(new StructuredSelection(resolutionsList
+ .getElementAt(0)));
+
+ markersTable.setAllChecked(true);
+ }
+
+ /**
+ * Create the table buttons for the receiver.
+ *
+ * @param control
+ * @return {@link Composite}
+ */
+ private Composite createTableButtons(Composite control) {
+
+ Composite buttonComposite = new Composite(control, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ buttonComposite.setLayout(layout);
+
+ Button selectAll = new Button(buttonComposite, SWT.PUSH);
+ selectAll.setText(MarkerMessages.selectAllAction_title);
+ selectAll.setLayoutData(new GridData(SWT.FILL, SWT.NONE, false, false));
+
+ selectAll.addSelectionListener(new SelectionAdapter() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse
+ * .swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent arg0) {
+ markersTable.setAllChecked(true);
+ setPageComplete(!resolutionsList.getSelection().isEmpty());
+ }
+ });
+
+ Button deselectAll = new Button(buttonComposite, SWT.PUSH);
+ deselectAll.setText(MarkerMessages.filtersDialog_deselectAll);
+ deselectAll
+ .setLayoutData(new GridData(SWT.FILL, SWT.NONE, false, false));
+
+ deselectAll.addSelectionListener(new SelectionAdapter() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse
+ * .swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent arg0) {
+ markersTable.setAllChecked(false);
+ setPageComplete(false);
+ }
+ });
+
+ return buttonComposite;
+ }
+
+ /**
+ * @param control
+ */
+ private void createResolutionsList(Composite control) {
+ resolutionsList = new ListViewer(control, SWT.BORDER | SWT.SINGLE
+ | SWT.V_SCROLL);
+ resolutionsList.setContentProvider(new IStructuredContentProvider() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.IStructuredContentProvider#getElements
+ * (java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ return resolutions.keySet().toArray();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse
+ * .jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+
+ }
+ });
+
+ resolutionsList.setLabelProvider(new LabelProvider() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ return ((IMarkerResolution) element).getLabel();
+ }
+ });
+
+ resolutionsList.setInput(this);
+
+ resolutionsList.setComparator(new ViewerComparator() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse
+ * .jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ return ((IMarkerResolution) e1).getLabel().compareTo(
+ ((IMarkerResolution) e1).getLabel());
+ }
+ });
+
+ resolutionsList
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.jface.viewers.ISelectionChangedListener#
+ * selectionChanged
+ * (org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+
+ markersTable.refresh();
+
+ IWorkbenchWindow window = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow();
+ if (window == null)
+ return;
+ IWorkbenchPage page = window.getActivePage();
+ if (page == null)
+ return;
+
+ }
+
+ });
+ }
+
+ /**
+ * Create the table that shows the markers.
+ *
+ * @param control
+ */
+ private void createMarkerTable(Composite control) {
+ markersTable = CheckboxTableViewer.newCheckList(control, SWT.BORDER
+ | SWT.V_SCROLL | SWT.SINGLE);
+
+ createTableColumns();
+
+ markersTable.setContentProvider(new IStructuredContentProvider() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.IStructuredContentProvider#getElements
+ * (java.lang.Object)
+ */
+ public Object[] getElements(Object inputElement) {
+ IMarkerResolution selected = getSelectedResolution();
+ if (selected == null) {
+ return new Object[0];
+ }
+
+ if (resolutions.containsKey(selected)) {
+ return ((Collection) resolutions.get(selected)).toArray();
+ }
+ return MarkerUtils.EMPTY_MARKER_ARRAY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse
+ * .jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+
+ }
+ });
+
+ markersTable.setLabelProvider(new ITableLabelProvider() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(
+ * java.lang.Object, int)
+ */
+ public Image getColumnImage(Object element, int columnIndex) {
+ if (columnIndex == 0)
+ return Util.getImage(((IMarker) element).getAttribute(
+ IMarker.SEVERITY, -1));
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java
+ * .lang.Object, int)
+ */
+ public String getColumnText(Object element, int columnIndex) {
+ IMarker marker = (IMarker) element;
+ if (columnIndex == 0)
+ return Util.getResourceName(marker);
+
+ // Is the location override set?
+ String locationString = marker.getAttribute(IMarker.LOCATION,
+ MarkerSupportInternalUtilities.EMPTY_STRING);
+ if (locationString.length() > 0) {
+ return locationString;
+ }
+
+ // No override so use line number
+ int lineNumber = marker.getAttribute(IMarker.LINE_NUMBER, -1);
+ String lineNumberString = null;
+ if (lineNumber < 0)
+ lineNumberString = MarkerMessages.Unknown;
+ else
+ lineNumberString = NLS.bind(
+ MarkerMessages.label_lineNumber, Integer
+ .toString(lineNumber));
+
+ return lineNumberString;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.
+ * eclipse.jface.viewers.ILabelProviderListener)
+ */
+ public void addListener(ILabelProviderListener listener) {
+ // do nothing
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
+ */
+ public void dispose() {
+ // do nothing
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(
+ * java.lang.Object, java.lang.String)
+ */
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org
+ * .eclipse.jface.viewers.ILabelProviderListener)
+ */
+ public void removeListener(ILabelProviderListener listener) {
+ // do nothing
+
+ }
+ });
+
+ markersTable.addCheckStateListener(new ICheckStateListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged
+ * (org.eclipse.jface.viewers.CheckStateChangedEvent)
+ */
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if (event.getChecked() == true) {
+ setPageComplete(true);
+ } else {
+ setPageComplete(markersTable.getCheckedElements().length > 0);
+ }
+
+ }
+ });
+
+ markersTable
+ .addSelectionChangedListener(new ISelectionChangedListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.jface.viewers.ISelectionChangedListener#
+ * selectionChanged
+ * (org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+
+ if (event.getSelection().isEmpty())
+ return;
+ IMarker marker = (IMarker) ((IStructuredSelection) event
+ .getSelection()).getFirstElement();
+ ExtendedMarkersView.openMarkerInEditor(marker,
+ PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow()
+ .getActivePage());
+
+ }
+ });
+
+ markersTable.setInput(this);
+ }
+
+ /**
+ * Create the table columns for the receiver.
+ */
+ private void createTableColumns() {
+ TableLayout layout = new TableLayout();
+
+ Table table = markersTable.getTable();
+ table.setLayout(layout);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
+
+ layout.addColumnData(new ColumnWeightData(70, true));
+ TableColumn tc = new TableColumn(table, SWT.NONE, 0);
+ tc
+ .setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Location);
+ layout.addColumnData(new ColumnWeightData(30, true));
+ tc = new TableColumn(table, SWT.NONE, 0);
+ tc
+ .setText(MarkerMessages.MarkerResolutionDialog_Problems_List_Resource);
+
+ }
+
+ /**
+ * Return the marker being edited.
+ *
+ * @return IMarker or <code>null</code>
+ */
+ public IMarker getSelectedMarker() {
+ ISelection selection = markersTable.getSelection();
+ if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
+ IStructuredSelection struct = (IStructuredSelection) selection;
+ if (struct.size() == 1)
+ return (IMarker) struct.getFirstElement();
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.WizardPage#isPageComplete()
+ */
+ public boolean isPageComplete() {
+ return true;
+ }
+
+ /**
+ * Finish has been pressed. Process the resolutions. monitor the monitor to
+ * report to.
+ */
+ /**
+ * @param monitor
+ */
+ /**
+ * @param monitor
+ */
+ void performFinish(IProgressMonitor monitor) {
+
+ final IMarkerResolution resolution = getSelectedResolution();
+ if (resolution == null)
+ return;
+
+ final Object[] checked = markersTable.getCheckedElements();
+ if (checked.length == 0)
+ return;
+
+ if (resolution instanceof WorkbenchMarkerResolution) {
+
+ try {
+ getWizard().getContainer().run(false, true,
+ new IRunnableWithProgress() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.operation.IRunnableWithProgress
+ * #run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void run(IProgressMonitor monitor) {
+ IMarker[] markers = new IMarker[checked.length];
+ System.arraycopy(checked, 0, markers, 0,
+ checked.length);
+ ((WorkbenchMarkerResolution) resolution).run(
+ markers, monitor);
+ }
+
+ });
+ } catch (InvocationTargetException e) {
+ StatusManager.getManager().handle(MarkerUtils.errorFor(e));
+ } catch (InterruptedException e) {
+ StatusManager.getManager().handle(MarkerUtils.errorFor(e));
+ }
+
+ } else {
+
+ try {
+ getWizard().getContainer().run(false, true,
+ new IRunnableWithProgress() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.operation.IRunnableWithProgress
+ * #run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void run(IProgressMonitor monitor) {
+ monitor
+ .beginTask(
+ MarkerMessages.MarkerResolutionDialog_Fixing,
+ checked.length);
+ for (int i = 0; i < checked.length; i++) {
+ // Allow paint events and wake up the button
+ getShell().getDisplay().readAndDispatch();
+ if (monitor.isCanceled())
+ return;
+ IMarker marker = (IMarker) checked[i];
+ monitor.subTask(Util.getProperty(
+ IMarker.MESSAGE, marker));
+ resolution.run(marker);
+ monitor.worked(1);
+ }
+ }
+
+ });
+ } catch (InvocationTargetException e) {
+ StatusManager.getManager().handle(MarkerUtils.errorFor(e));
+ } catch (InterruptedException e) {
+ StatusManager.getManager().handle(MarkerUtils.errorFor(e));
+ }
+
+ }
+
+ }
+
+ /**
+ * Return the marker resolution that is currently selected/
+ *
+ * @return IMarkerResolution or <code>null</code> if there is no selection.
+ */
+ private IMarkerResolution getSelectedResolution() {
+ ISelection selection = resolutionsList.getSelection();
+ if (!(selection instanceof IStructuredSelection)) {
+ return null;
+ }
+
+ Object first = ((IStructuredSelection) selection).getFirstElement();
+
+ return (IMarkerResolution) first;
+
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/QuickFixWizard.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/QuickFixWizard.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/wizards/QuickFixWizard.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.editor.check.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.internal.ide.IDEInternalWorkbenchImages;
+import org.eclipse.ui.internal.ide.StatusUtil;
+import org.eclipse.ui.statushandlers.StatusManager;
+import org.eclipse.ui.views.markers.internal.MarkerMessages;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class QuickFixWizard extends Wizard {
+
+ private Map resolutionMap;
+ private String description;
+
+ /**
+ * Create the wizard with the map of resolutions.
+ *
+ * @param description
+ * the description of the problem
+ * @param resolutions
+ * Map key {@link IMarkerResolution} value {@link IMarker} []
+ * @param site
+ * the {@link IWorkbenchPartSite} to open the markers in
+ */
+ public QuickFixWizard(String description, Map resolutions) {
+ super();
+ this.resolutionMap = resolutions;
+ this.description = description;
+ setDefaultPageImageDescriptor(IDEInternalWorkbenchImages
+ .getImageDescriptor(IDEInternalWorkbenchImages.IMG_DLGBAN_QUICKFIX_DLG));
+ setNeedsProgressMonitor(true);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
+ public void addPages() {
+ super.addPages();
+ addPage(new QuickFixPage(description, resolutionMap));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ public boolean performFinish() {
+ IRunnableWithProgress finishRunnable = new IRunnableWithProgress() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse
+ * .core.runtime.IProgressMonitor)
+ */
+ public void run(IProgressMonitor monitor) {
+ IWizardPage[] pages = getPages();
+ monitor.beginTask(MarkerMessages.MarkerResolutionDialog_Fixing,
+ (10 * pages.length) + 1);
+ monitor.worked(1);
+ for (int i = 0; i < pages.length; i++) {
+ // Allow for cancel event processing
+ getShell().getDisplay().readAndDispatch();
+ if (monitor.isCanceled())
+ return;
+ QuickFixPage wizardPage = (QuickFixPage) pages[i];
+ wizardPage
+ .performFinish(new SubProgressMonitor(monitor, 10));
+ monitor.worked(1);
+ }
+ monitor.done();
+
+ }
+ };
+
+ try {
+ getContainer().run(false, true, finishRunnable);
+ } catch (InvocationTargetException e) {
+ StatusManager.getManager().handle(
+ StatusUtil.newStatus(IStatus.ERROR,
+ e.getLocalizedMessage(), e));
+ return false;
+ } catch (InterruptedException e) {
+ StatusManager.getManager().handle(
+ StatusUtil.newStatus(IStatus.ERROR,
+ e.getLocalizedMessage(), e));
+ return false;
+ }
+
+ return true;
+ }
+
+}
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.classpath
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.classpath (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.classpath 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.web"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_16">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.java"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.project (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.project 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>naturesCheckKBTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ </natures>
+</projectDescription>
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/.jsdtscope
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/.jsdtscope (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/.jsdtscope 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.jdt.core.prefs 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,7 @@
+#Wed Apr 07 16:00:34 EEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.common.component 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="naturesCheckKBTest">
+<wb-resource deploy-path="/" source-path="/WebContent"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/JavaSource"/>
+<property name="context-root" value="naturesCheckKBTest"/>
+<property name="java-output-path" value="/naturesCheckKBTest/WebContent/WEB-INF/classes"/>
+</wb-module>
+</project-modules>
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="Apache Tomcat v6.0"/>
+ <fixed facet="jst.web"/>
+ <fixed facet="jst.java"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.web" version="2.5"/>
+</faceted-project>
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.jsdt.ui.superType.container (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.jsdt.ui.superType.container 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.jsdt.ui.superType.name (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/.settings/org.eclipse.wst.jsdt.ui.superType.name 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/Messages.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/Messages.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/Messages.properties 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,3 @@
+header=Hello Demo Application
+prompt_message=Name:
+hello_message=Hello
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/User.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/User.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/JavaSource/demo/User.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package demo;
+
+/**
+ * Created by JBoss Developer Studio
+ */
+public class User {
+
+ private String name;
+
+ /**
+ * @return User Name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param User Name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/META-INF/MANIFEST.MF 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/demo/Messages.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/demo/Messages.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/demo/Messages.properties 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,3 @@
+header=Hello Demo Application
+prompt_message=Name:
+hello_message=Hello
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/demo/User.class
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/classes/demo/User.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/faces-config.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/faces-config.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/faces-config.xml 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+ <managed-bean>
+ <description>User Name Bean</description>
+ <managed-bean-name>user</managed-bean-name>
+ <managed-bean-class>demo.User</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>name</property-name>
+ <property-class>java.lang.String</property-class>
+ <value/>
+ </managed-property>
+ </managed-bean>
+ <navigation-rule>
+ <from-view-id>/pages/inputUserName.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>hello</from-outcome>
+ <to-view-id>/pages/hello.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <application>
+ <locale-config/>
+ </application>
+ <factory/>
+ <lifecycle/>
+</faces-config>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/lib/jsf-api.jar
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/lib/jsf-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/lib/jsf-impl.jar
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/lib/jsf-impl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/WEB-INF/web.xml 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <display-name>naturesCheckKBTest</display-name>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+</web-app>
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/index.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/index.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/index.jsp 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,7 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+ <body>
+ <jsp:forward page="/pages/inputUserName.jsf" />
+ </body>
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/hello.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/hello.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/hello.jsp 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,20 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<f:loadBundle var="Message" basename="demo.Messages" />
+
+<html>
+ <head>
+ <title>Hello!</title>
+ </head>
+
+ <body>
+ <f:view>
+ <h3>
+ <h:outputText value="#{Message.hello_message}" />,
+ <h:outputText value="#{user.name}" />!
+ </h3>
+ </f:view>
+ </body>
+
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/inputUserName.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/inputUserName.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/WebContent/pages/inputUserName.jsp 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,28 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<f:loadBundle var="Message" basename="demo.Messages"/>
+
+<html>
+ <head>
+ <title>Input User Name Page</title>
+ </head>
+ <body>
+
+ <f:view>
+ <h1><h:outputText value="#{Message.header}"/></h1>
+
+ <h:messages style="color: red"/>
+
+ <h:form id="greetingForm">
+ <h:outputText value="#{Message.prompt_message}"/>
+ <h:inputText value="#{user.name}" required="true">
+ <f:validateLength maximum="30" minimum="3"/>
+ </h:inputText>
+
+ <h:commandButton action="hello" value="Say Hello!" />
+
+ </h:form>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/build.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/build.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/build.properties 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,3 @@
+#
+#Wed Apr 07 16:00:34 EEST 2010
+classpath.external=
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/build.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/build.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckKBTest/ant/build.xml 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,74 @@
+<project name="KickStart" default="deploy" basedir="../">
+
+ <!-- Project settings -->
+ <property file="${basedir}/ant/build.properties" />
+
+ <property name="project.name" value="KickStart" />
+ <property name="web.content.dir" value="${basedir}/WebContent" />
+ <property name="web-inf.dir" value="${web.content.dir}/WEB-INF" />
+ <property name="build.dir" value="build" />
+ <property name="war.name" value="${build.dir}/${project.name}.war" />
+
+ <!-- Define a folder for deployment -->
+ <property name="deploy.dir" value="deploy" />
+
+ <!-- Compile classpath -->
+ <path id="compile.classpath">
+ <fileset dir="${webinf.dir}/lib">
+ <include name="**/*.jar" />
+ </fileset>
+ <pathelement path="${classpath}" />
+ <pathelement path="${classpath.external}" />
+ <pathelement path="${webinf.dir}/classes" />
+ </path>
+
+ <!-- Copy any resource or configuration files -->
+ <target name="copyResources">
+ <copy todir="${web-inf.dir}/classes" includeEmptyDirs="no">
+ <fileset dir="JavaSource">
+ <patternset>
+ <include name="**/*.*" />
+ <exclude name="**/*.java" />
+ </patternset>
+ </fileset>
+ </copy>
+ </target>
+
+ <!-- Check timestamp on files -->
+ <target name="prepare">
+ <tstamp />
+ </target>
+
+ <!-- Remove classes directory for clean build -->
+ <target name="clean" description="Prepare for clean build">
+ <delete dir="${web-inf.dir}/classes" failonerror="false"/>
+ <mkdir dir="${web-inf.dir}/classes" />
+ </target>
+
+ <!-- Normal build of application -->
+ <target name="compile" depends="prepare, copyResources">
+ <javac srcdir="JavaSource" destdir="${web-inf.dir}/classes">
+ <classpath refid="compile.classpath" />
+ </javac>
+ </target>
+
+ <!-- Build Project -->
+ <target name="build" depends="prepare, compile" />
+
+ <!-- Rebuild Project -->
+ <target name="rebuild" depends="clean, prepare, compile" />
+
+ <!-- Build WAR -->
+ <target name="war" depends="build">
+ <mkdir dir="${build.dir}" />
+ <war warfile="${war.name}" basedir="${web.content.dir}" webxml="${web-inf.dir}/web.xml">
+ <exclude name="WEB-INF/web.xml" />
+ </war>
+ </target>
+
+ <target name="deploy" depends="war">
+ <delete dir="${deploy.dir}/${project.name}" failonerror="false"/>
+ <copy file="${war.name}" todir="${deploy.dir}" />
+ </target>
+
+</project>
\ No newline at end of file
Copied: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/projects/naturesCheckTest (from rev 21297, trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/naturesCheckTest)
Copied: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFNaturesInfoDialog_JBIDE5701.java (from rev 21297, trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java)
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFNaturesInfoDialog_JBIDE5701.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JSFNaturesInfoDialog_JBIDE5701.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.test;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class JSFNaturesInfoDialog_JBIDE5701 extends NaturesInfoDialogTest {
+
+ private static final String testProjectName = "naturesCheckTest"; //$NON-NLS-1$
+ private static final String TEST_STRING = "JBoss Tools Editor might not fully work in project \"" //$NON-NLS-1$
+ + testProjectName +
+ "\" because it does not have JSF and code completion enabled completely.\n\n" + //$NON-NLS-1$
+ "Please use the Configure menu on the project or \"Add JSF Capabilities...\" fix button to enable JSF if " + //$NON-NLS-1$
+ "you want all features of the editor working."; //$NON-NLS-1$
+
+ public JSFNaturesInfoDialog_JBIDE5701(String name) {
+ super(name);
+ }
+
+
+ public void testJSFNaturesChecker() throws Throwable {
+
+ ResultObject resultObject = startCheckerThread();
+
+ openPage(getTestProjectName(), TEST_PAGE_NAME);
+
+ if ("".equals(resultObject.getShellName()) && "".equals(resultObject.getTextLabel())) { //$NON-NLS-1$ //$NON-NLS-2$
+ throw new Exception("Project natures checker dialog hasn't appeared :(("); //$NON-NLS-1$
+ }
+
+ assertEquals(TEST_SHELL_NAME, resultObject.getShellName());
+ assertEquals(getDialogMessage(), resultObject.getTextLabel());
+
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return TEST_STRING;
+ }
+
+ @Override
+ protected String getTestProjectName() {
+ return testProjectName;
+ }
+
+}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2010-04-07 13:27:06 UTC (rev 21304)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -7,21 +7,19 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.jsf.ui.test;
-import org.jboss.tools.jsf.ui.preferences.JSFCapabilitiesPreferencesPage;
import org.jboss.tools.jsf.ui.test.refactoring.ELReferencesRenameTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-
import junit.framework.Test;
import junit.framework.TestSuite;
public class JsfUiAllTests {
public static Test suite() {
- TestSuite suite = new TestSuite("JSF UI tests");
+ TestSuite suite = new TestSuite("JSF UI tests"); //$NON-NLS-1$
suite.addTestSuite(CssClassNewWizardTest.class);
suite.addTestSuite(CssFileNewWizardTest.class);
suite.addTestSuite(CSSStyleDialogTest.class);
@@ -33,11 +31,18 @@
suite.addTestSuite(PropertiesNewWizardTest.class);
suite.addTestSuite(XhtmlFileNewWizardTest.class);
suite.addTestSuite(JsfUiPreferencesPagesTest.class);
- suite.addTest(new ProjectImportTestSetup(new TestSuite(ELReferencesRenameTest.class),
- "org.jboss.tools.jsf.ui.test",
- new String[]{"projects/testJSFProject",},
- new String[]{"testJSFProject"}));
-
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ ELReferencesRenameTest.class), "org.jboss.tools.jsf.ui.test", //$NON-NLS-1$
+ new String[] { "projects/testJSFProject", }, //$NON-NLS-1$
+ new String[] { "testJSFProject" })); //$NON-NLS-1$
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ JSFNaturesInfoDialog_JBIDE5701.class),
+ "org.jboss.tools.jsf.ui.test", "projects/naturesCheckTest", //$NON-NLS-1$ //$NON-NLS-2$
+ "naturesCheckTest")); //$NON-NLS-1$
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ KbNaturesInfoDialog_JBIDE6125.class),
+ "org.jboss.tools.jsf.ui.test", "projects/naturesCheckKBTest", //$NON-NLS-1$ //$NON-NLS-2$
+ "naturesCheckKBTest")); //$NON-NLS-1$
return new TestWizardsProject(suite);
}
}
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/KbNaturesInfoDialog_JBIDE6125.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/KbNaturesInfoDialog_JBIDE6125.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/KbNaturesInfoDialog_JBIDE6125.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.test;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class KbNaturesInfoDialog_JBIDE6125 extends NaturesInfoDialogTest {
+
+ private static final String testProjectName = "naturesCheckKBTest"; //$NON-NLS-1$
+ private static final String TEST_STRING = "The project \"" //$NON-NLS-1$
+ + testProjectName
+ + "\" does not have JSF code completion and validation enabled completely.\n\n" + //$NON-NLS-1$
+ "Please use \"Enabale JSF Code Completion...\" fix button if " + //$NON-NLS-1$
+ "you want these features working."; //$NON-NLS-1$
+
+ public KbNaturesInfoDialog_JBIDE6125(String name) {
+ super(name);
+ }
+
+ public void testKBNaturesChecker() throws Throwable {
+
+ ResultObject resultObject = startCheckerThread();
+
+ openPage(getTestProjectName(), TEST_PAGE_NAME);
+
+ if ("".equals(resultObject.getShellName()) && "".equals(resultObject.getTextLabel())) { //$NON-NLS-1$ //$NON-NLS-2$
+ throw new Exception(
+ "Project natures checker dialog hasn't appeared :(("); //$NON-NLS-1$
+ }
+
+ assertEquals(TEST_SHELL_NAME, resultObject.getShellName());
+ assertEquals(getDialogMessage(), resultObject.getTextLabel());
+
+ }
+
+ @Override
+ protected String getDialogMessage() {
+ return TEST_STRING;
+ }
+
+ @Override
+ protected String getTestProjectName() {
+ return testProjectName;
+ }
+
+}
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/NaturesInfoDialogTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/NaturesInfoDialogTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/NaturesInfoDialogTest.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.test;
+
+import junit.framework.TestCase;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart;
+import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public abstract class NaturesInfoDialogTest extends TestCase{
+
+ protected static final String TEST_PAGE_NAME = "inputUserName.jsp"; //$NON-NLS-1$
+ protected static final String TEST_SHELL_NAME = "Missing Natures"; //$NON-NLS-1$
+ private volatile boolean isCheckNeed = true;
+ private static IProject testProject;
+
+ protected NaturesInfoDialogTest(String name) {
+ super(name);
+ }
+
+ protected final class ResultObject {
+ private String shellName = ""; //$NON-NLS-1$
+ private String textLabel = ""; //$NON-NLS-1$
+
+ public String getShellName() {
+ return shellName;
+ }
+
+ public void setShellName(String shellName) {
+ this.shellName = shellName;
+ }
+
+ public String getTextLabel() {
+ return textLabel;
+ }
+
+ public void setTextLabel(String textLabel) {
+ this.textLabel = textLabel;
+ }
+
+ }
+
+ protected final ResultObject startCheckerThread() {
+ final Shell[] shell = new Shell[1];
+ final ResultObject resultObject = new ResultObject();
+ Thread thread = new Thread(new Runnable() {
+ public void run() {
+ TestUtil.waitForIdle();
+ while (shell[0] == null && isCheckNeed) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ Shell[] shells = Display.getCurrent().getShells();
+ shell[0] = findShellWithText(shells, TEST_SHELL_NAME);
+ if (shell[0] != null) {
+ resultObject.setShellName(TEST_SHELL_NAME);
+ Label label = (Label)shell[0].getChildren()[1];
+ resultObject.setTextLabel(label.getText());
+ shell[0].close();
+ }
+ }
+ });
+ }
+ }
+ });
+ thread.start();
+ return resultObject;
+ }
+
+ private static Shell findShellWithText (Shell[] shells, String text){
+ for (int i = 0; i < shells.length; i++) {
+ if (text.equals(shells[i].getText())) {
+ return shells[i];
+ }
+ }
+ return null;
+ }
+
+ protected final void openPage(String projectName, String pagePath) throws Throwable{
+ IFile file = (IFile) testProject.getFolder("WebContent/pages").findMember(pagePath); //$NON-NLS-1$
+
+ assertNotNull("Could not open specified file. componentPage = " //$NON-NLS-1$
+ + pagePath
+ + ";projectName = " + projectName, file);//$NON-NLS-1$
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
+ // open and get editor
+
+ JSPMultiPageEditorPart part = TestUtil.openEditor(input);
+
+ isCheckNeed = false;
+
+ assertNotNull("Editor is not opened", part); //$NON-NLS-1$
+
+ TestUtil.delay(3000);
+
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ System.setProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+ JspEditorPlugin.getDefault().getPreferenceStore().setValue(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE, true);
+ testProject = ProjectImportTestSetup.loadProject(getTestProjectName());
+ testProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ JspEditorPlugin.getDefault().getPreferenceStore().setValue(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE, false);
+ System.setProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER", "false"); //$NON-NLS-1$ //$NON-NLS-2$
+ super.tearDown();
+ }
+
+ protected abstract String getTestProjectName();
+
+ protected abstract String getDialogMessage();
+
+}
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestUtil.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestUtil.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/TestUtil.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.ui.test;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart;
+
+import static junit.framework.Assert.*;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class TestUtil {
+
+ /** Editor in which we open visual page. */
+ public final static String EDITOR_ID = "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"; //$NON-NLS-1$
+
+ /** The Constant MAX_IDLE. */
+ public static final long MAX_IDLE = 15*1000L;
+
+ public static void delay(long waitTimeMillis) {
+ Display display = Display.getCurrent();
+ if (display != null) {
+ long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
+ while (System.currentTimeMillis() < endTimeMillis) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.update();
+ }
+ // Otherwise, perform a simple sleep.
+ else {
+ try {
+ Thread.sleep(waitTimeMillis);
+ } catch (InterruptedException e) {
+ // Ignored.
+ }
+ }
+ }
+
+ public static void waitForIdle(long maxIdle) {
+ long start = System.currentTimeMillis();
+ while (!Job.getJobManager().isIdle()) {
+ delay(500);
+ if ( (System.currentTimeMillis()-start) > maxIdle )
+ throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
+ }
+ }
+
+ public static void waitForIdle() {
+ waitForIdle(MAX_IDLE);
+ }
+
+ public static JSPMultiPageEditorPart openEditor(IEditorInput input) throws PartInitException {
+
+ // get editor
+ JSPMultiPageEditorPart part = (JSPMultiPageEditorPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(
+ input, EDITOR_ID, true);
+
+ assertNotNull(part);
+ return part;
+
+ }
+
+}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/plugin.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/plugin.xml 2010-04-07 13:27:06 UTC (rev 21304)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/plugin.xml 2010-04-07 13:39:19 UTC (rev 21305)
@@ -22,9 +22,6 @@
name="i18nTest"
path="resources/i18nTest"/>
<testProject
- name="naturesCheckTest"
- path="resources/naturesCheckTest"/>
- <testProject
name="jsfLocales"
path="resources/jsfLocales"/>
<testProject
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2010-04-07 13:27:06 UTC (rev 21304)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -79,7 +79,6 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2362Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.MessageResolutionInPreviewTabTest;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.MozDirtyTest_JBIDE5105;
-import org.jboss.tools.jsf.vpe.jsf.test.jbide.NaturesChecker_JBIDE5701;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.NullPointerWithStyleProperty_JBIDE5193;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.OpenOnCssClassTest_JBIDE4775;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.OpenOnInJarPackageFragment_JBIDE5682;
@@ -210,7 +209,6 @@
suite.addTestSuite(MessageResolutionInPreviewTabTest.class);
suite.addTestSuite(OpenOnTLDPackedInJar_JBIDE5693.class);
suite.addTestSuite(PreferencesForEditors_JBIDE5692.class);
- suite.addTestSuite(NaturesChecker_JBIDE5701.class);
suite.addTestSuite(FacetProcessingTest.class);
suite.addTestSuite(RefreshBundles_JBIDE5460.class);
suite.addTestSuite(ExceptionInVPEComments_JBIDE5143.class);
Deleted: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java 2010-04-07 13:27:06 UTC (rev 21304)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/NaturesChecker_JBIDE5701.java 2010-04-07 13:39:19 UTC (rev 21305)
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.jsf.vpe.jsf.test.jbide;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
-import org.jboss.tools.vpe.ui.test.TestUtil;
-import org.jboss.tools.vpe.ui.test.VpeTest;
-
-/**
- *
- * @author yzhishko
- *
- */
-
-public class NaturesChecker_JBIDE5701 extends VpeTest {
-
- private static final String FIRST_TEST_PAGE_NAME = "inputUserName.jsp"; //$NON-NLS-1$
- private static final String TEST_SHELL_NAME = "Missing Natures"; //$NON-NLS-1$
- private static final String TEST_STRING = "JBoss Tools Visual Editor might not fully work in project \"" //$NON-NLS-1$
- + JsfAllTests.IMPORT_NATURES_CHECKER_PROJECT +
- "\" because it does not have JSF and code completion enabled completely.\n\n" + //$NON-NLS-1$
- "Please use the Configure menu on the project to enable JSF if " + //$NON-NLS-1$
- "you want all features of the editor working."; //$NON-NLS-1$
- private static final String SECOND_TEST_PAGE_NAME = "components/commandButton.jsp"; //$NON-NLS-1$
- private volatile boolean isCheckNeed = true;
-
-
- public NaturesChecker_JBIDE5701(String name) {
- super(name);
- }
-
- public void testNaturesChecker() throws Throwable {
-
- ResultObject resultObject = startCheckerThread();
-
- openPage(JsfAllTests.IMPORT_NATURES_CHECKER_PROJECT, FIRST_TEST_PAGE_NAME);
-
- if ("".equals(resultObject.getShellName()) && "".equals(resultObject.getTextLabel())) { //$NON-NLS-1$ //$NON-NLS-2$
- throw new Exception("Project natures checker dialog hasn't appeared :(("); //$NON-NLS-1$
- }
-
- assertEquals(TEST_SHELL_NAME, resultObject.getShellName());
- assertEquals(TEST_STRING, resultObject.getTextLabel());
-
- resultObject = startCheckerThread();
-
- openPage(JsfAllTests.IMPORT_PROJECT_NAME, SECOND_TEST_PAGE_NAME);
-
- if (!"".equals(resultObject.getShellName()) || !"".equals(resultObject.getTextLabel())) { //$NON-NLS-1$ //$NON-NLS-2$
- throw new Exception("Unexpected shell has appeared " + "\"" + resultObject.getShellName() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- }
-
- private class ResultObject {
- private String shellName = ""; //$NON-NLS-1$
- private String textLabel = ""; //$NON-NLS-1$
-
- public String getShellName() {
- return shellName;
- }
-
- public void setShellName(String shellName) {
- this.shellName = shellName;
- }
-
- public String getTextLabel() {
- return textLabel;
- }
-
- public void setTextLabel(String textLabel) {
- this.textLabel = textLabel;
- }
-
- }
-
- private ResultObject startCheckerThread() {
- final Shell[] shell = new Shell[1];
- final ResultObject resultObject = new ResultObject();
- Thread thread = new Thread(new Runnable() {
- public void run() {
- TestUtil.waitForIdle();
- while (shell[0] == null && isCheckNeed) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- Shell[] shells = Display.getCurrent().getShells();
- shell[0] = findShellWithText(shells, TEST_SHELL_NAME);
- if (shell[0] != null) {
- resultObject.setShellName(TEST_SHELL_NAME);
- Label label = (Label)shell[0].getChildren()[1];
- resultObject.setTextLabel(label.getText());
- shell[0].close();
- }
- }
- });
- }
- }
- });
- thread.start();
- return resultObject;
- }
-
- private static Shell findShellWithText (Shell[] shells, String text){
- for (int i = 0; i < shells.length; i++) {
- if (text.equals(shells[i].getText())) {
- return shells[i];
- }
- }
- return null;
- }
-
- private void openPage(String projectName, String pagePath) throws Throwable{
- IFile file = (IFile) TestUtil.getComponentPath(pagePath, projectName);
-
- assertNotNull("Could not open specified file. componentPage = " //$NON-NLS-1$
- + pagePath
- + ";projectName = " + projectName, file);//$NON-NLS-1$
-
- IEditorInput input = new FileEditorInput(file);
-
- assertNotNull("Editor input is null", input); //$NON-NLS-1$
- // open and get editor
-
- JSPMultiPageEditor part = openEditor(input);
-
- isCheckNeed = false;
-
- assertNotNull("Editor is not opened", part); //$NON-NLS-1$
-
- TestUtil.delay(3000);
-
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- System.setProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER", "true"); //$NON-NLS-1$ //$NON-NLS-2$
- JspEditorPlugin.getDefault().getPreferenceStore().setValue(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE, true);
- }
-
- @Override
- protected void tearDown() throws Exception {
- JspEditorPlugin.getDefault().getPreferenceStore().setValue(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE, false);
- System.setProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER", "false"); //$NON-NLS-1$ //$NON-NLS-2$
- super.tearDown();
- }
-
-}
\ No newline at end of file
14 years, 9 months
JBoss Tools SVN: r21304 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-04-07 09:27:06 -0400 (Wed, 07 Apr 2010)
New Revision: 21304
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5808 Added new CDI tests for Stereotypes.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-07 13:08:14 UTC (rev 21303)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-07 13:27:06 UTC (rev 21304)
@@ -22,6 +22,7 @@
import org.jboss.tools.cdi.core.test.tck.QualifierDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.ScopeDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.StereotypeDefinitionTest;
+import org.jboss.tools.cdi.core.test.tck.StereotypeInheritenceTest;
import org.jboss.tools.cdi.core.test.tck.ValidationTest;
/**
@@ -40,6 +41,7 @@
suite.addTestSuite(StereotypeDefinitionTest.class);
suite.addTestSuite(DefaultNamedTest.class);
suite.addTestSuite(EnterpriseStereotypeDefinitionTest.class);
+ suite.addTestSuite(StereotypeInheritenceTest.class);
suite.addTestSuite(ValidationTest.class);
return suite;
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java 2010-04-07 13:27:06 UTC (rev 21304)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck;
+
+import java.util.Set;
+
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.IBean;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class StereotypeInheritenceTest extends TCKTest {
+
+ /**
+ * section 2.7.1.5 a)
+ * section 2.7.1.5 b)
+ *
+ * @throws JavaModelException
+ */
+ public void testInheritence() throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.inheritance.Horse");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ assertTrue("The bean should be an alternative.", bean.isAlternative());
+ assertEquals("Wrong EL name.", "horse", bean.getName());
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeInheritenceTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21303 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-04-07 09:08:14 -0400 (Wed, 07 Apr 2010)
New Revision: 21303
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5808 Added new CDI tests for Stereotypes.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-07 12:38:56 UTC (rev 21302)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-07 13:08:14 UTC (rev 21303)
@@ -17,6 +17,7 @@
import org.jboss.tools.cdi.core.test.tck.DefaultNamedTest;
import org.jboss.tools.cdi.core.test.tck.EnterpriseQualifierDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.EnterpriseScopeDefinitionTest;
+import org.jboss.tools.cdi.core.test.tck.EnterpriseStereotypeDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.NameDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.QualifierDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.ScopeDefinitionTest;
@@ -38,6 +39,7 @@
suite.addTestSuite(EnterpriseScopeDefinitionTest.class);
suite.addTestSuite(StereotypeDefinitionTest.class);
suite.addTestSuite(DefaultNamedTest.class);
+ suite.addTestSuite(EnterpriseStereotypeDefinitionTest.class);
suite.addTestSuite(ValidationTest.class);
return suite;
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java 2010-04-07 13:08:14 UTC (rev 21303)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck;
+
+import java.util.Set;
+
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.IBean;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class EnterpriseStereotypeDefinitionTest extends TCKTest {
+
+ /**
+ * section 4.1 am)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeDeclaredInheritedIsInherited()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.BorderCollieLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 ama)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeNotDeclaredInheritedIsNotInherited()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.BarracudaLocal");
+ IBean bean = beans.iterator().next();
+ assertFalse("Wrong scope type",
+ "javax.enterprise.context.RequestScoped".equals(bean.getScope()
+ .getSourceType().getFullyQualifiedName()));
+ }
+
+ /**
+ * section 4.1 aq)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.EnglishBorderCollieLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 aqa)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeNotDeclaredInheritedIsNotIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.TameBarracudaLocal");
+ IBean bean = beans.iterator().next();
+ assertFalse("Wrong scope type",
+ "javax.enterprise.context.RequestScoped".equals(bean.getScope()
+ .getSourceType().getFullyQualifiedName()));
+ }
+
+ /**
+ * section 4.1 hhj)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeScopeIsOverriddenByInheritedScope()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.ChihuahuaLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.SessionScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 hhk)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.enterprise.MexicanChihuahuaLocal");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.SessionScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/EnterpriseStereotypeDefinitionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21302 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-04-07 08:38:56 -0400 (Wed, 07 Apr 2010)
New Revision: 21302
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5927
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java 2010-04-07 12:35:58 UTC (rev 21301)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java 2010-04-07 12:38:56 UTC (rev 21302)
@@ -28,6 +28,7 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.text.TextSelection;
import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
import org.eclipse.swt.widgets.Shell;
@@ -46,6 +47,7 @@
import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
* @author Daniel Azarov
@@ -55,6 +57,7 @@
private static final String JAVA_EXT = "java"; //$NON-NLS-1$
static private IFile editorFile;
+ static private TextSelection selection;
private IEditorPart editor;
private Shell shell;
@@ -95,7 +98,8 @@
boolean separatorIsAdded = false;
if(JAVA_EXT.equalsIgnoreCase(ext)){
- IBean bean = getBean(editorFile);
+ selection = (TextSelection)editor.getEditorSite().getSelectionProvider().getSelection();
+ IBean bean = getBean(editorFile, selection);
if(bean != null){
mm.add(new RenameNamedBeanAction());
@@ -108,7 +112,7 @@
}
}
- private IBean getBean(IFile file){
+ private IBean getBean(IFile file, TextSelection selection){
IProject project = file.getProject();
CDICoreNature cdiNature = CDICorePlugin.getCDI(file.getProject(), true);
if(cdiNature == null)
@@ -122,8 +126,11 @@
Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
for(IBean bean : beans){
- if(bean.getName() != null)
- return bean;
+ if(bean.getName() != null){
+ ITextSourceReference location = bean.getNameLocation();
+ if(selection.getOffset() >= location.getStartPosition() && (selection.getOffset()+selection.getLength()) <= (location.getStartPosition()+location.getLength()))
+ return bean;
+ }
}
return null;
@@ -193,7 +200,7 @@
public void run(){
saveAndBuild();
- IBean bean = getBean(editorFile);
+ IBean bean = getBean(editorFile, selection);
invokeRenameNamedBeanWizard(bean, shell);
}
}
14 years, 9 months
JBoss Tools SVN: r21301 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-04-07 08:35:58 -0400 (Wed, 07 Apr 2010)
New Revision: 21301
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5808 Added new CDI tests for Stereotypes.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-07 12:18:07 UTC (rev 21300)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSuite.java 2010-04-07 12:35:58 UTC (rev 21301)
@@ -14,6 +14,7 @@
import junit.framework.TestSuite;
import org.jboss.tools.cdi.core.test.tck.BeanDefinitionTest;
+import org.jboss.tools.cdi.core.test.tck.DefaultNamedTest;
import org.jboss.tools.cdi.core.test.tck.EnterpriseQualifierDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.EnterpriseScopeDefinitionTest;
import org.jboss.tools.cdi.core.test.tck.NameDefinitionTest;
@@ -36,6 +37,7 @@
suite.addTestSuite(ScopeDefinitionTest.class);
suite.addTestSuite(EnterpriseScopeDefinitionTest.class);
suite.addTestSuite(StereotypeDefinitionTest.class);
+ suite.addTestSuite(DefaultNamedTest.class);
suite.addTestSuite(ValidationTest.class);
return suite;
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java 2010-04-07 12:35:58 UTC (rev 21301)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.test.tck;
+
+import java.util.Set;
+
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.IBean;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class DefaultNamedTest extends TCKTest {
+
+ /**
+ * section 2.7.1.3 aaa)
+ * section 2.5.2 e)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeWithEmptyNamed() throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.defaultNamed.FallowDeer");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong EL name.", "fallowDeer", bean.getName());
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/DefaultNamedTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21300 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test: tck and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-04-07 08:18:07 -0400 (Wed, 07 Apr 2010)
New Revision: 21300
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSetup.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5808 Added new CDI tests for Stereotypes.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSetup.java 2010-04-07 11:58:05 UTC (rev 21299)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreTestSetup.java 2010-04-07 12:18:07 UTC (rev 21300)
@@ -14,6 +14,7 @@
import junit.framework.Test;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.internal.core.JavaModelManager;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
@@ -31,6 +32,7 @@
@Override
protected void setUp() throws Exception {
+ JavaModelManager.getIndexManager().disable();
tckProject = TCKTest.importPreparedProject("/");
}
@@ -41,5 +43,6 @@
tckProject.delete(true, true, null);
JobUtils.waitForIdle();
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ JavaModelManager.getIndexManager().enable();
}
}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java 2010-04-07 11:58:05 UTC (rev 21299)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/StereotypeDefinitionTest.java 2010-04-07 12:18:07 UTC (rev 21300)
@@ -15,6 +15,7 @@
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
* @author Alexey Kazakov
@@ -40,4 +41,152 @@
.size());
assertLocationEquals(declarations, 835, 17);
}
+
+ /**
+ * section 2.7.1.1 aa) section 2.4.4 b)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeWithoutScopeType() throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Reindeer");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
+ bean.getScope().getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 2.7 c) section 2.7.1 b)
+ *
+ * @throws JavaModelException
+ */
+ public void testOneStereotypeAllowed() throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.LongHairedDog");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 2.7.2 e)
+ * section 2.7 d)
+ */
+ public void testMultipleStereotypesAllowed() {
+ Set<IBean> beans = cdiProject.getBeans(true, "org.jboss.jsr299.tck.tests.definition.stereotype.HighlandCow", "org.jboss.jsr299.tck.tests.definition.stereotype.Tame");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertNull("The bean should not have any EL name.", bean.getName());
+ assertContainsQualifierType(bean, "org.jboss.jsr299.tck.tests.definition.stereotype.Tame");
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ Set<? extends ITextSourceReference> declarations = bean.getQualifierDeclarations(false);
+ assertEquals("Wrong number of qualifier declarations", 1, declarations.size());
+ assertLocationEquals(declarations, 877, 5);
+
+ declarations = bean.getStereotypeDeclarations();
+ assertEquals("Wrong number of stereotype declarations", 2, declarations.size());
+ assertLocationEquals(declarations, 835, 23);
+ assertLocationEquals(declarations, 859, 17);
+ }
+
+ /**
+ * section 2.7.2 e) section 2.4.4 e)
+ *
+ * @throws JavaModelException
+ */
+ public void testExplicitScopeOverridesMergedScopesFromMultipleStereotype()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Springbok");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 ab)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeDeclaredInheritedIsInherited()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.BorderCollie");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 aba)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeNotDeclaredInheritedIsNotInherited()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.ShetlandPony");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
+ bean.getScope().getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 ah)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeDeclaredInheritedIsIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.EnglishBorderCollie");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.RequestScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 aha)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeNotDeclaredInheritedIsNotIndirectlyInherited()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.MiniatureClydesdale");
+ assertEquals("Wrong number of beans.", 1, beans.size());
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type", "javax.enterprise.context.Dependent",
+ bean.getScope().getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 hhh)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeScopeIsOverriddenByInheritedScope()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.Chihuahua");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.SessionScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
+
+ /**
+ * section 4.1 hhi)
+ *
+ * @throws JavaModelException
+ */
+ public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
+ throws JavaModelException {
+ Set<IBean> beans = getBeans("org.jboss.jsr299.tck.tests.definition.stereotype.MexicanChihuahua");
+ IBean bean = beans.iterator().next();
+ assertEquals("Wrong scope type",
+ "javax.enterprise.context.SessionScoped", bean.getScope()
+ .getSourceType().getFullyQualifiedName());
+ }
}
\ No newline at end of file
14 years, 9 months
JBoss Tools SVN: r21299 - trunk/as/docs/reference/en-US/images/runtimes_servers.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2010-04-07 07:58:05 -0400 (Wed, 07 Apr 2010)
New Revision: 21299
Modified:
trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_3.png
trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_4b.png
trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_4c.png
Log:
https://jira.jboss.org/jira/browse/JBDS-1143 Jboss AS docs mistakes
screenshots were updated
Modified: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_3.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_4b.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en-US/images/runtimes_servers/runtimes_servers_4c.png
===================================================================
(Binary files differ)
14 years, 9 months
JBoss Tools SVN: r21298 - in branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core: utils and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2010-04-07 05:35:12 -0400 (Wed, 07 Apr 2010)
New Revision: 21298
Modified:
branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
Log:
JBIDE-5591: to 3.1.x branch
Modified: branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
===================================================================
--- branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2010-04-07 08:10:14 UTC (rev 21297)
+++ branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2010-04-07 09:35:12 UTC (rev 21298)
@@ -11,6 +11,7 @@
package org.jboss.tools.ws.creation.core.commands;
+import java.io.File;
import java.util.List;
import org.eclipse.core.commands.ExecutionException;
@@ -18,6 +19,7 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.j2ee.model.ModelProviderManager;
@@ -28,7 +30,14 @@
import org.eclipse.jst.javaee.web.ServletMapping;
import org.eclipse.jst.javaee.web.WebApp;
import org.eclipse.jst.javaee.web.WebFactory;
+import org.eclipse.jst.jee.project.facet.ICreateDeploymentFilesDataModelProperties;
+import org.eclipse.jst.jee.project.facet.WebCreateDeploymentFilesDataModelProvider;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
@@ -41,6 +50,7 @@
private ServiceModel model;
IStatus status;
+ private static String WEB_XML = "web.xml"; //$NON-NLS-1$
public MergeWebXMLCommand(ServiceModel model) {
this.model = model;
@@ -60,7 +70,19 @@
for (int i = 0; i < serviceClasses.size(); i++) {
servletDescriptors[i] = getServletDescriptor(serviceClasses.get(i));
}
-
+ IProject pro = JBossWSCreationUtils.getProjectByName(model.getWebProjectName());
+ if (!hasWebXML(pro)) {
+ IVirtualComponent vc = ComponentCore.createComponent(pro);
+ IDataModel model = DataModelFactory.createDataModel(new WebCreateDeploymentFilesDataModelProvider());
+ model.setProperty(ICreateDeploymentFilesDataModelProperties.GENERATE_DD, vc);
+ model.setProperty(ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT, pro);
+ IDataModelOperation op = model.getDefaultOperation();
+ try {
+ op.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e1) {
+ // Ignore
+ }
+ }
mergeWebXML(servletDescriptors);
return status;
}
@@ -211,7 +233,18 @@
webapp.getServletMappings().add(servletMapping);
}
}
-
+
+ private boolean hasWebXML(IProject pro) {
+ // we are looking for this recursively because though application.xml
+ // is always in META-INF, it's not always in "earcontent" since the
+ // earcontent folder name can be custom
+ File file = JBossWSCreationUtils.findFileByPath(WEB_XML, pro.getLocation().toOSString());
+ if(file == null){
+ return false;
+ }
+ return true;
+ }
+
public class ServletDescriptor {
String _name;
String _className;
Modified: branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
===================================================================
--- branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2010-04-07 08:10:14 UTC (rev 21297)
+++ branches/jbosstools-3.1.x/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2010-04-07 09:35:12 UTC (rev 21298)
@@ -482,5 +482,22 @@
}
return path;
}
-
+ public static File findFileByPath(String name, String path) {
+ File ret = null;
+ File folder = new File(path);
+ if (folder.isDirectory()) {
+ File[] files = folder.listFiles();
+ for (File file : files) {
+ ret = findFileByPath(name, file.getAbsolutePath());
+ if (ret != null) {
+ break;
+ }
+ }
+ } else {
+ if (name.equals(folder.getName())) {
+ ret = folder;
+ }
+ }
+ return ret;
+ }
}
14 years, 9 months
JBoss Tools SVN: r21297 - in trunk/ws: tests/org.jboss.tools.ws.creation.core.test/projects and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2010-04-07 04:10:14 -0400 (Wed, 07 Apr 2010)
New Revision: 21297
Added:
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.classpath
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/.jsdtscope
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.jdt.core.prefs
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.component
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/META-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/WEB-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/WEB-INF/lib/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/build/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/build/classes/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/src/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java
Log:
JBIDE-5991: to trunk
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2010-04-07 06:38:22 UTC (rev 21296)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2010-04-07 08:10:14 UTC (rev 21297)
@@ -11,6 +11,7 @@
package org.jboss.tools.ws.creation.core.commands;
+import java.io.File;
import java.util.List;
import org.eclipse.core.commands.ExecutionException;
@@ -18,6 +19,7 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.j2ee.model.ModelProviderManager;
@@ -28,7 +30,14 @@
import org.eclipse.jst.javaee.web.ServletMapping;
import org.eclipse.jst.javaee.web.WebApp;
import org.eclipse.jst.javaee.web.WebFactory;
+import org.eclipse.jst.jee.project.facet.ICreateDeploymentFilesDataModelProperties;
+import org.eclipse.jst.jee.project.facet.WebCreateDeploymentFilesDataModelProvider;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
import org.jboss.tools.ws.core.utils.StatusUtils;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.core.data.ServletDescriptor;
@@ -42,6 +51,7 @@
private ServiceModel model;
IStatus status;
+ private static String WEB_XML = "web.xml"; //$NON-NLS-1$
public MergeWebXMLCommand(ServiceModel model) {
this.model = model;
@@ -61,7 +71,19 @@
for (int i = 0; i < serviceClasses.size(); i++) {
servletDescriptors[i] = getServletDescriptor(serviceClasses.get(i));
}
-
+ IProject pro = JBossWSCreationUtils.getProjectByName(model.getWebProjectName());
+ if (!hasWebXML(pro)) {
+ IVirtualComponent vc = ComponentCore.createComponent(pro);
+ IDataModel model = DataModelFactory.createDataModel(new WebCreateDeploymentFilesDataModelProvider());
+ model.setProperty(ICreateDeploymentFilesDataModelProperties.GENERATE_DD, vc);
+ model.setProperty(ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT, pro);
+ IDataModelOperation op = model.getDefaultOperation();
+ try {
+ op.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e1) {
+ // Ignore
+ }
+ }
mergeWebXML(servletDescriptors);
return status;
}
@@ -212,4 +234,15 @@
webapp.getServletMappings().add(servletMapping);
}
}
+
+ private boolean hasWebXML(IProject pro) {
+ // we are looking for this recursively because though application.xml
+ // is always in META-INF, it's not always in "earcontent" since the
+ // earcontent folder name can be custom
+ File file = JBossWSCreationUtils.findFileByPath(WEB_XML, pro.getLocation().toOSString());
+ if(file == null){
+ return false;
+ }
+ return true;
+ }
}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.classpath (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.classpath 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1,12 @@
+<?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/jdk1.5.0_15">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.java"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>WebTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/.jsdtscope
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/.jsdtscope (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/.jsdtscope 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.jdt.core.prefs 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1,7 @@
+#Wed Apr 07 14:51:03 CST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.component 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="WebTest">
+<wb-resource deploy-path="/" source-path="/WebContent"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
+<property name="context-root" value="WebTest"/>
+<property name="java-output-path" value="/WebTest/build/classes"/>
+</wb-module>
+</project-modules>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.web" version="2.5"/>
+</faceted-project>
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.common.project.facet.core.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.container (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.container 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.name (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/.settings/org.eclipse.wst.jsdt.ui.superType.name 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/META-INF/MANIFEST.MF 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/WebTest/WebContent/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java 2010-04-07 06:38:22 UTC (rev 21296)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java 2010-04-07 08:10:14 UTC (rev 21297)
@@ -17,6 +17,7 @@
import org.jboss.tools.ws.creation.core.test.command.JBossWSClientCommandTest;
import org.jboss.tools.ws.creation.core.test.command.JBossWSJavaFirstCommandTest;
+import org.jboss.tools.ws.creation.core.test.command.JBossWSMergeWebXMLCommandTest;
import org.jboss.tools.ws.creation.core.test.command.JBossWSTopDownCommandTest;
public class JBossWSCreationCoreTests extends TestCase {
@@ -27,6 +28,7 @@
suite.addTestSuite(JBossWSTopDownCommandTest.class);
suite.addTestSuite(JBossWSJavaFirstCommandTest.class);
suite.addTestSuite(JBossWSClientCommandTest.class);
+ suite.addTestSuite(JBossWSMergeWebXMLCommandTest.class);
return suite;
}
}
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java 2010-04-07 08:10:14 UTC (rev 21297)
@@ -0,0 +1,63 @@
+package org.jboss.tools.ws.creation.core.test.command;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.ws.creation.core.commands.MergeWebXMLCommand;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
+
+public class JBossWSMergeWebXMLCommandTest extends TestCase {
+
+ static String BUNDLE = "org.jboss.tools.ws.creation.core.test";
+ IProject prj;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ TestProjectProvider provider = new TestProjectProvider(BUNDLE,
+ "/projects/" + "WebTest", "WebTest", true);
+ prj = provider.getProject();
+ JobUtils.delay(3000);
+ }
+
+ public void testMergeWebXMLCommand() throws ExecutionException{
+ File file = JBossWSCreationUtils.findFileByPath("web.xml", prj.getLocation().toOSString());
+ assertTrue("For now, no web.xml",file == null);
+ ServiceModel model = new ServiceModel();
+ model.setUpdateWebxml(true);
+ model.setWebProjectName("WebTest");
+ MergeWebXMLCommand command = new MergeWebXMLCommand(model);
+ command.execute(null, null);
+ file = JBossWSCreationUtils.findFileByPath("web.xml", prj.getLocation().toOSString());
+ assertTrue("For now, web.xml should be there",file != null);
+ }
+
+ protected void tearDown() throws Exception {
+ boolean oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
+ Exception last = null;
+ try {
+ JobUtils.delay(500);
+ try {
+ System.out.println("Deleting " + prj);
+ prj.delete(true, null);
+ JobUtils.delay(500);
+ } catch (Exception e) {
+ System.out.println("Error deleting " + prj);
+ e.printStackTrace();
+ last = e;
+ }
+ } finally {
+ ResourcesUtils.setBuildAutomatically(oldAutoBuilding);
+ }
+
+ if (last != null)
+ throw last;
+ super.tearDown();
+ }
+}
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSMergeWebXMLCommandTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21296 - in trunk/ws/tests: org.jboss.tools.ws.core.test and 55 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2010-04-07 02:38:22 -0400 (Wed, 07 Apr 2010)
New Revision: 21296
Added:
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.classpath
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.project
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.settings/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.settings/org.eclipse.jdt.core.prefs
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/bin/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/build.properties
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/plugin.properties
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.classpath
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.project
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/.jsdtscope
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.jdt.core.prefs
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.jst.common.project.facet.core.prefs
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.common.component
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/META-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/WEB-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/WEB-INF/lib/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/WEB-INF/web.xml
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/HelloWorld.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/HelloWorldService.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/ObjectFactory.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello2.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello2Response.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHelloResponse.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/clientsample/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/clientsample/ClientSample.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/package-info.class
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorld.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorldService.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/ObjectFactory.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello2.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello2Response.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHelloResponse.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/clientsample/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/clientsample/ClientSample.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/package-info.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.classpath
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.project
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.jdt.core.prefs
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.jst.common.project.facet.core.prefs
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.wst.common.component
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/META-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/WEB-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/WEB-INF/lib/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/WEB-INF/web.xml
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/build/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/build/classes/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/hello_world.wsdl
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/src/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.classpath
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.project
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.jst.common.project.facet.core.prefs
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.wst.common.component
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/META-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/WEB-INF/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/WEB-INF/lib/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/WEB-INF/web.xml
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/org/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/org/example/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/org/example/www/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/org/example/www/helloworld/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/org/example/www/helloworld/HelloWorld.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/org/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/org/example/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/org/example/www/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/org/example/www/helloworld/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/org/example/www/helloworld/HelloWorld.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/Activator.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/AbstractJBossWSCommandTest.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSClientCommandTest.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSJavaFirstCommandTest.java
trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSTopDownCommandTest.java
Removed:
trunk/ws/tests/org.jboss.tools.ws.core.test/projects/
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/
Modified:
trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
trunk/ws/tests/org.jboss.tools.ws.core.test/build.properties
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/JBossWSCoreAllTests.java
Log:
JBIDE-6155: add a new test plugin
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF 2010-04-06 20:50:12 UTC (rev 21295)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF 2010-04-07 06:38:22 UTC (rev 21296)
@@ -34,8 +34,7 @@
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: ws-core-test.jar
Export-Package: org.jboss.tools.ws.core.test,
- org.jboss.tools.ws.core.test.classpath,
- org.jboss.tools.ws.core.test.command
+ org.jboss.tools.ws.core.test.classpath
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
Import-Package: org.eclipse.jdt.launching
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/build.properties
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/build.properties 2010-04-06 20:50:12 UTC (rev 21295)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/build.properties 2010-04-07 06:38:22 UTC (rev 21296)
@@ -2,6 +2,4 @@
output.ws-core-test.jar = bin/
bin.includes = META-INF/,\
ws-core-test.jar,\
- projects/,\
plugin.properties
-source.ws-core-test.jar = src/
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/JBossWSCoreAllTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/JBossWSCoreAllTests.java 2010-04-06 20:50:12 UTC (rev 21295)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/JBossWSCoreAllTests.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -16,19 +16,13 @@
import junit.framework.TestSuite;
import org.jboss.tools.ws.core.test.classpath.JBossWSRuntimeManagerTest;
-import org.jboss.tools.ws.core.test.command.JBossWSJavaFirstCommandTest;
-import org.jboss.tools.ws.core.test.command.JBossWSClientCommandTest;
-import org.jboss.tools.ws.core.test.command.JBossWSTopDownCommandTest;
public class JBossWSCoreAllTests extends TestCase {
- public static final String PLUGIN_ID = "org.jboss.tools.common.test";
+ public static final String PLUGIN_ID = "org.jboss.tools.ws.creation.core.test";
public static Test suite ()
{
TestSuite suite = new TestSuite(JBossWSCoreAllTests.class.getName());
suite.addTestSuite(JBossWSRuntimeManagerTest.class);
- suite.addTestSuite(JBossWSJavaFirstCommandTest.class);
- suite.addTestSuite(JBossWSClientCommandTest.class);
- suite.addTestSuite(JBossWSTopDownCommandTest.class);
return suite;
}
}
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.classpath (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.classpath 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.project (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.project 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.ws.creation.core.test</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>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/.settings/org.eclipse.jdt.core.prefs 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,8 @@
+#Tue Apr 06 17:31:09 CST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/META-INF/MANIFEST.MF 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,42 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.tools.ws.creation.core.test
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.ws.creation.core.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit,
+ org.jboss.tools.tests,
+ org.jboss.tools.ws.core,
+ org.eclipse.core.resources,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.ui.ide,
+ org.jboss.tools.common.test,
+ org.jboss.tools.ws.creation.core,
+ org.eclipse.wst.command.env.ui,
+ org.eclipse.wst.ws,
+ org.jboss.tools.ws.creation.ui,
+ org.eclipse.jst.j2ee,
+ org.eclipse.jst.j2ee.core,
+ org.eclipse.emf.common,
+ org.eclipse.jem,
+ org.eclipse.emf.ecore,
+ org.eclipse.wst.server.core,
+ org.eclipse.debug.core,
+ org.jboss.tools.common,
+ org.jboss.ide.eclipse.as.core,
+ org.eclipse.jdt.core,
+ org.eclipse.ui.console,
+ org.eclipse.jface.text,
+ org.jboss.ide.eclipse.as.classpath.core
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: ws-creation-core-test.jar
+Export-Package: org.jboss.tools.ws.creation.core.test,
+ org.jboss.tools.ws.creation.core.test.command
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Import-Package: org.eclipse.jdt.launching
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/build.properties
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/build.properties (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/build.properties 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,6 @@
+source.ws-creation-core-test.jar = src/
+output.ws-creation-core-test.jar = bin/
+bin.includes = META-INF/,\
+ ws-creation-core-test.jar,\
+ projects/,\
+ plugin.properties
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/plugin.properties
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/plugin.properties (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/plugin.properties 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.ws.creation.core.test
+Bundle-Vendor.0 = JBoss by Red Hat
+Bundle-Name.0 = WS Test Plug-in
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.classpath (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.classpath 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="JBossWS_Runtime/testjbosswsruntime"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.project (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.project 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ClientTest</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/.jsdtscope
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/.jsdtscope (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/.jsdtscope 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.jdt.core.prefs 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,12 @@
+#Wed Jun 25 17:14:18 CST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+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.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.jst.common.project.facet.core.prefs (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.jst.common.project.facet.core.prefs 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,3 @@
+#Wed Jun 25 17:15:07 CST 2008
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:JAVA1.5/owners=jst.java\:5.0
+eclipse.preferences.version=1
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.common.component 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="ClientTest">
+<wb-resource deploy-path="/" source-path="/WebContent"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
+<property name="context-root" value="ClientTest"/>
+<property name="java-output-path"/>
+</wb-module>
+</project-modules>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="org.jboss.ide.eclipse.as.runtime.42"/>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.web" version="2.4"/>
+ <installed facet="jbossws.core" version="2.0"/>
+ <installed facet="jst.java" version="5.0"/>
+</faceted-project>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.jsdt.ui.superType.container (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.jsdt.ui.superType.container 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.jsdt.ui.superType.name (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/.settings/org.eclipse.wst.jsdt.ui.superType.name 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/META-INF/MANIFEST.MF 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/WebContent/WEB-INF/web.xml 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>
+ ClientTest</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/HelloWorld.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/HelloWorld.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/HelloWorldService.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/HelloWorldService.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/ObjectFactory.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/ObjectFactory.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello2.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello2Response.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHello2Response.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHelloResponse.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/SayHelloResponse.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/clientsample/ClientSample.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/clientsample/ClientSample.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/package-info.class
===================================================================
(Binary files differ)
Property changes on: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/build/classes/org/example/www/helloworld/package-info.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorld.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorld.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorld.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,50 @@
+
+package org.example.www.helloworld;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "HelloWorld", targetNamespace = "http://www.example.org/HelloWorld")
+public interface HelloWorld {
+
+
+ /**
+ *
+ * @param sayHelloRequest
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod(action = "http://www.example.org/HelloWorld/sayHello")
+ @WebResult(name = "sayHelloResponse", targetNamespace = "")
+ @RequestWrapper(localName = "sayHello", targetNamespace = "http://www.example.org/HelloWorld", className = "org.example.www.helloworld.SayHello")
+ @ResponseWrapper(localName = "sayHelloResponse", targetNamespace = "http://www.example.org/HelloWorld", className = "org.example.www.helloworld.SayHelloResponse")
+ public String sayHello(
+ @WebParam(name = "sayHelloRequest", targetNamespace = "")
+ String sayHelloRequest);
+
+ /**
+ *
+ * @param sayHelloRequest2
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod(action = "http://www.example.org/HelloWorld/sayHello2")
+ @WebResult(name = "sayHelloResponse2", targetNamespace = "")
+ @RequestWrapper(localName = "sayHello2", targetNamespace = "http://www.example.org/HelloWorld", className = "org.example.www.helloworld.SayHello2")
+ @ResponseWrapper(localName = "sayHello2Response", targetNamespace = "http://www.example.org/HelloWorld", className = "org.example.www.helloworld.SayHello2Response")
+ public String sayHello2(
+ @WebParam(name = "sayHelloRequest2", targetNamespace = "")
+ String sayHelloRequest2);
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorldService.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorldService.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/HelloWorldService.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,53 @@
+
+package org.example.www.helloworld;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+@WebServiceClient(name = "HelloWorldService", targetNamespace = "http://www.example.org/HelloWorld", wsdlLocation = "http://localhost:8080/JavaFirstTestProject/HelloWorld?wsdl")
+public class HelloWorldService
+ extends Service
+{
+
+ private final static URL HELLOWORLDSERVICE_WSDL_LOCATION;
+
+ static {
+ URL url = null;
+ try {
+ url = new URL("http://localhost:8080/JavaFirstTestProject/HelloWorld?wsdl");
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ HELLOWORLDSERVICE_WSDL_LOCATION = url;
+ }
+
+ public HelloWorldService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public HelloWorldService() {
+ super(HELLOWORLDSERVICE_WSDL_LOCATION, new QName("http://www.example.org/HelloWorld", "HelloWorldService"));
+ }
+
+ /**
+ *
+ * @return
+ * returns HelloWorld
+ */
+ @WebEndpoint(name = "HelloWorldPort")
+ public HelloWorld getHelloWorldPort() {
+ return (HelloWorld)super.getPort(new QName("http://www.example.org/HelloWorld", "HelloWorldPort"), HelloWorld.class);
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/ObjectFactory.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/ObjectFactory.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/ObjectFactory.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,107 @@
+
+package org.example.www.helloworld;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.example.www.helloworld package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _SayHello2_QNAME = new QName("http://www.example.org/HelloWorld", "sayHello2");
+ private final static QName _SayHello_QNAME = new QName("http://www.example.org/HelloWorld", "sayHello");
+ private final static QName _SayHello2Response_QNAME = new QName("http://www.example.org/HelloWorld", "sayHello2Response");
+ private final static QName _SayHelloResponse_QNAME = new QName("http://www.example.org/HelloWorld", "sayHelloResponse");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.example.www.helloworld
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link SayHello2Response }
+ *
+ */
+ public SayHello2Response createSayHello2Response() {
+ return new SayHello2Response();
+ }
+
+ /**
+ * Create an instance of {@link SayHello }
+ *
+ */
+ public SayHello createSayHello() {
+ return new SayHello();
+ }
+
+ /**
+ * Create an instance of {@link SayHelloResponse }
+ *
+ */
+ public SayHelloResponse createSayHelloResponse() {
+ return new SayHelloResponse();
+ }
+
+ /**
+ * Create an instance of {@link SayHello2 }
+ *
+ */
+ public SayHello2 createSayHello2() {
+ return new SayHello2();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link SayHello2 }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.example.org/HelloWorld", name = "sayHello2")
+ public JAXBElement<SayHello2> createSayHello2(SayHello2 value) {
+ return new JAXBElement<SayHello2>(_SayHello2_QNAME, SayHello2 .class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link SayHello }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.example.org/HelloWorld", name = "sayHello")
+ public JAXBElement<SayHello> createSayHello(SayHello value) {
+ return new JAXBElement<SayHello>(_SayHello_QNAME, SayHello.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link SayHello2Response }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.example.org/HelloWorld", name = "sayHello2Response")
+ public JAXBElement<SayHello2Response> createSayHello2Response(SayHello2Response value) {
+ return new JAXBElement<SayHello2Response>(_SayHello2Response_QNAME, SayHello2Response.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link SayHelloResponse }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.example.org/HelloWorld", name = "sayHelloResponse")
+ public JAXBElement<SayHelloResponse> createSayHelloResponse(SayHelloResponse value) {
+ return new JAXBElement<SayHelloResponse>(_SayHelloResponse_QNAME, SayHelloResponse.class, null, value);
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,60 @@
+
+package org.example.www.helloworld;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for sayHello complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="sayHello">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="sayHelloRequest" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sayHello", propOrder = {
+ "sayHelloRequest"
+})
+public class SayHello {
+
+ protected String sayHelloRequest;
+
+ /**
+ * Gets the value of the sayHelloRequest property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSayHelloRequest() {
+ return sayHelloRequest;
+ }
+
+ /**
+ * Sets the value of the sayHelloRequest property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSayHelloRequest(String value) {
+ this.sayHelloRequest = value;
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello2.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello2.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello2.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,60 @@
+
+package org.example.www.helloworld;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for sayHello2 complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="sayHello2">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="sayHelloRequest2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sayHello2", propOrder = {
+ "sayHelloRequest2"
+})
+public class SayHello2 {
+
+ protected String sayHelloRequest2;
+
+ /**
+ * Gets the value of the sayHelloRequest2 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSayHelloRequest2() {
+ return sayHelloRequest2;
+ }
+
+ /**
+ * Sets the value of the sayHelloRequest2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSayHelloRequest2(String value) {
+ this.sayHelloRequest2 = value;
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello2Response.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello2Response.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHello2Response.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,60 @@
+
+package org.example.www.helloworld;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for sayHello2Response complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="sayHello2Response">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="sayHelloResponse2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sayHello2Response", propOrder = {
+ "sayHelloResponse2"
+})
+public class SayHello2Response {
+
+ protected String sayHelloResponse2;
+
+ /**
+ * Gets the value of the sayHelloResponse2 property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSayHelloResponse2() {
+ return sayHelloResponse2;
+ }
+
+ /**
+ * Sets the value of the sayHelloResponse2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSayHelloResponse2(String value) {
+ this.sayHelloResponse2 = value;
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHelloResponse.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHelloResponse.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/SayHelloResponse.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,60 @@
+
+package org.example.www.helloworld;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for sayHelloResponse complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="sayHelloResponse">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="sayHelloResponse" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sayHelloResponse", propOrder = {
+ "sayHelloResponse"
+})
+public class SayHelloResponse {
+
+ protected String sayHelloResponse;
+
+ /**
+ * Gets the value of the sayHelloResponse property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSayHelloResponse() {
+ return sayHelloResponse;
+ }
+
+ /**
+ * Sets the value of the sayHelloResponse property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSayHelloResponse(String value) {
+ this.sayHelloResponse = value;
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/clientsample/ClientSample.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/clientsample/ClientSample.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/clientsample/ClientSample.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,19 @@
+package org.example.www.helloworld.clientsample;
+
+import org.example.www.helloworld.*;
+
+public class ClientSample {
+
+ public static void main(String[] args) {
+ System.out.println("***********************");
+ System.out.println("Create Web Service Client...");
+ HelloWorldService service1 = new HelloWorldService();
+ System.out.println("Create Web Service...");
+ HelloWorld port1 = service1.getHelloWorldPort();
+ System.out.println("Create Web Service Operation...");
+ System.out.println("Server said: " + port1.sayHello(args[0]));
+ System.out.println("Server said: " + port1.sayHello2(args[0]));
+ System.out.println("***********************");
+ System.out.println("Call Over!");
+ }
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/package-info.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/package-info.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/ClientTest/src/org/example/www/helloworld/package-info.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,2 @@
+(a)javax.xml.bind.annotation.XmlSchema(namespace = "http://www.example.org/HelloWorld")
+package org.example.www.helloworld;
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.classpath (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.classpath 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,8 @@
+<?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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.project (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.project 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JBossWSTestProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.jdt.core.prefs 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,7 @@
+#Wed Jun 18 13:25:53 CST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.jst.common.project.facet.core.prefs (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.jst.common.project.facet.core.prefs 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,3 @@
+#Wed Jun 18 13:25:53 CST 2008
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:jdk1.5.0_15/owners=jst.java\:5.0
+eclipse.preferences.version=1
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.wst.common.component 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="JBossWSTestProject">
+<wb-resource deploy-path="/" source-path="/WebContent"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
+<property name="context-root" value="JBossWSTestProject"/>
+<property name="java-output-path" value="build/classes"/>
+</wb-module>
+</project-modules>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="jst.web"/>
+ <fixed facet="jst.java"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.web" version="2.4"/>
+</faceted-project>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/META-INF/MANIFEST.MF 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/WebContent/WEB-INF/web.xml 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>
+ JBossWSTestProject</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/hello_world.wsdl
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/hello_world.wsdl (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JBossWSTestProject/hello_world.wsdl 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<wsdl:definitions name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_soap_http"
+ xmlns:x1="http://apache.org/hello_world_soap_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_soap_http/types"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://apache.org/hello_world_soap_http/types"
+ elementFormDefault="qualified">
+ <simpleType name="MyStringType">
+ <restriction base="string">
+ <maxLength value="30" />
+ </restriction>
+ </simpleType>
+
+ <element name="sayHi">
+ <complexType/>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="tns:MyStringType"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeOneWay">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="pingMe">
+ <complexType/>
+ </element>
+ <element name="pingMeResponse">
+ <complexType/>
+ </element>
+ <element name="faultDetail">
+ <complexType>
+ <sequence>
+ <element name="minor" type="short"/>
+ <element name="major" type="short"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part element="x1:sayHi" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part element="x1:sayHiResponse" name="out"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part element="x1:greetMe" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part element="x1:greetMeResponse" name="out"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeOneWayRequest">
+ <wsdl:part element="x1:greetMeOneWay" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeRequest">
+ <wsdl:part name="in" element="x1:pingMe"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeResponse">
+ <wsdl:part name="out" element="x1:pingMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeFault">
+ <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+ <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+ <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMeOneWay">
+ <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="pingMe">
+ <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+ <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+ <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="sayHi">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="sayHiRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="sayHiResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="greetMeResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMeOneWay">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeOneWayRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+
+ <wsdl:operation name="pingMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="pingMeFault">
+ <soap:fault name="pingMeFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.classpath
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.classpath (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.classpath 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,8 @@
+<?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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.project
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.project (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.project 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JavaFirstTestProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.jst.common.project.facet.core.prefs (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.jst.common.project.facet.core.prefs 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,4 @@
+#Tue Jun 24 15:57:11 CST 2008
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:JAVA1.5/owners=jst.java\:5.0
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:jdk1.5.0_15/owners=jst.java\:5.0
+eclipse.preferences.version=1
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.wst.common.component 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="JavaFirstTestProject">
+<wb-resource deploy-path="/" source-path="/WebContent"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
+<property name="context-root" value="JavaFirstTestProject"/>
+<property name="java-output-path" value="build/classes"/>
+</wb-module>
+</project-modules>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.web" version="2.4"/>
+</faceted-project>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/META-INF/MANIFEST.MF 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/WebContent/WEB-INF/web.xml 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>
+ JavaFirstTestProject</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/org/example/www/helloworld/HelloWorld.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/org/example/www/helloworld/HelloWorld.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/build/classes/org/example/www/helloworld/HelloWorld.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,25 @@
+
+package org.example.www.helloworld;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+
+@WebService(name = "HelloWorld", targetNamespace = "http://www.example.org/HelloWorld")
+public class HelloWorld{
+
+
+ @WebMethod(action = "http://www.example.org/HelloWorld/sayHello")
+ @WebResult(name = "sayHelloResponse", partName = "sayHelloResponse")
+ public String sayHello(@WebParam(name = "sayHelloRequest", partName = "sayHelloRequest") String str){
+ return "Hello World";
+ }
+
+ @WebMethod(action = "http://www.example.org/HelloWorld/sayHello2")
+ @WebResult(name = "sayHelloResponse2", partName = "sayHelloResponse2")
+ public String sayHello2(@WebParam(name = "sayHelloRequest2", partName = "sayHelloRequest2") String str){
+ return "Hello qq";
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/org/example/www/helloworld/HelloWorld.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/org/example/www/helloworld/HelloWorld.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/projects/JavaFirstTestProject/src/org/example/www/helloworld/HelloWorld.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,25 @@
+
+package org.example.www.helloworld;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+
+@WebService(name = "HelloWorld", targetNamespace = "http://www.example.org/HelloWorld")
+public class HelloWorld{
+
+
+ @WebMethod(action = "http://www.example.org/HelloWorld/sayHello")
+ @WebResult(name = "sayHelloResponse", partName = "sayHelloResponse")
+ public String sayHello(@WebParam(name = "sayHelloRequest", partName = "sayHelloRequest") String str){
+ return "Hello World";
+ }
+
+ @WebMethod(action = "http://www.example.org/HelloWorld/sayHello2")
+ @WebResult(name = "sayHelloResponse2", partName = "sayHelloResponse2")
+ public String sayHello2(@WebParam(name = "sayHelloRequest2", partName = "sayHelloRequest2") String str){
+ return "Hello qq";
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/Activator.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/Activator.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/Activator.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,50 @@
+package org.jboss.tools.ws.creation.core.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.ws.creation.core.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/JBossWSCreationCoreTests.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.creation.core.test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.jboss.tools.ws.creation.core.test.command.JBossWSClientCommandTest;
+import org.jboss.tools.ws.creation.core.test.command.JBossWSJavaFirstCommandTest;
+import org.jboss.tools.ws.creation.core.test.command.JBossWSTopDownCommandTest;
+
+public class JBossWSCreationCoreTests extends TestCase {
+ public static final String PLUGIN_ID = "org.jboss.tools.ws.creation.core.test";
+ public static Test suite ()
+ {
+ TestSuite suite = new TestSuite(JBossWSCreationCoreTests.class.getName());
+ suite.addTestSuite(JBossWSTopDownCommandTest.class);
+ suite.addTestSuite(JBossWSJavaFirstCommandTest.class);
+ suite.addTestSuite(JBossWSClientCommandTest.class);
+ return suite;
+ }
+}
\ No newline at end of file
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/AbstractJBossWSCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/AbstractJBossWSCommandTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/AbstractJBossWSCommandTest.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,467 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.creation.core.test.command;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.core.IStreamListener;
+import org.eclipse.debug.core.model.IStreamMonitor;
+import org.eclipse.jdt.launching.IVMInstall;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerListener;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerEvent;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.IServer.IOperationListener;
+import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+
+@SuppressWarnings("restriction")
+public abstract class AbstractJBossWSCommandTest extends TestCase {
+ public static final IVMInstall VM_INSTALL = JavaRuntime
+ .getDefaultVMInstall();
+ protected static final IWorkspace ws = ResourcesPlugin.getWorkspace();
+ protected static final IWorkbench wb = PlatformUI.getWorkbench();
+
+ protected static final int DEFAULT_STARTUP_TIME = 150000;
+ protected static final int DEFAULT_SHUTDOWN_TIME = 90000;
+
+ protected static final String JBOSSWS_HOME_DEFAULT = "D:/softinstall/jboss-4.2.3GA/jboss-4.2.3.GA";
+ public static final String JBOSSWS_42_HOME = "jbosstools.test.jboss.home.4.2";
+ public static final String JBOSS_RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
+ public static final String JBOSS_AS_42_HOME = System.getProperty(
+ JBOSSWS_42_HOME, JBOSSWS_HOME_DEFAULT);
+ public static final String JBOSS_SERVER_42 = "org.jboss.ide.eclipse.as.42";
+
+ protected final Set<IResource> resourcesToCleanup = new HashSet<IResource>();
+
+ protected static final IProjectFacetVersion dynamicWebVersion;
+ protected static final IProjectFacetVersion javaVersion;
+ protected static final IProjectFacetVersion jbosswsFacetVersion;
+ private static final IProjectFacet jbosswsFacet;
+
+ static String wsdlFileName = "hello_world.wsdl";
+ static String BUNDLE = "org.jboss.tools.ws.creation.core.test";
+
+ IFacetedProject fproject;
+ protected IRuntime currentRuntime;
+ protected IServer currentServer;
+ protected ServerStateListener stateListener;
+
+ static {
+ javaVersion = ProjectFacetsManager.getProjectFacet("jst.java")
+ .getVersion("5.0");
+ dynamicWebVersion = ProjectFacetsManager.getProjectFacet("jst.web")
+ .getVersion("2.5");
+ jbosswsFacet = ProjectFacetsManager.getProjectFacet("jbossws.core");
+ jbosswsFacetVersion = jbosswsFacet.getVersion("2.0");
+
+ }
+
+ public AbstractJBossWSCommandTest() {
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // create jbossws web project
+
+ createServer(JBOSS_RUNTIME_42, JBOSS_SERVER_42, JBOSS_AS_42_HOME,
+ "default");
+ // first thing's first. Let's add a server state listener
+ stateListener = new ServerStateListener();
+ currentServer.addServerListener(stateListener);
+
+ JobUtils.delay(3000);
+ }
+
+ public IProject createProject(String prjName) throws CoreException {
+ TestProjectProvider provider = new TestProjectProvider(BUNDLE, "/projects/" + prjName,
+ prjName, true);
+ IProject prj = provider.getProject();
+ return prj;
+ }
+
+ protected void tearDown() throws Exception {
+ // Wait until all jobs is finished to avoid delete project problems
+
+ undeployWebProject();
+
+ boolean oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
+ Exception last = null;
+
+ try {
+ JobUtils.delay(500);
+ for (IResource r : this.resourcesToCleanup) {
+ try {
+ System.out.println("Deleting " + r);
+ r.delete(true, null);
+ JobUtils.delay(500);
+ } catch (Exception e) {
+ System.out.println("Error deleting " + r);
+ e.printStackTrace();
+ last = e;
+ }
+ }
+ } finally {
+ ResourcesUtils.setBuildAutomatically(oldAutoBuilding);
+ }
+
+ if (last != null)
+ throw last;
+
+ resourcesToCleanup.clear();
+ // cleanProjectFromServer() ;
+ shutdown();
+ currentServer.removeServerListener(stateListener);
+ currentRuntime.delete();
+ currentServer.delete();
+
+ super.tearDown();
+ }
+
+ protected void createServer(String runtimeID, String serverID,
+ String location, String configuration) throws CoreException {
+ // if file doesnt exist, abort immediately.
+ assertTrue(new Path(location).toFile().exists());
+
+ currentRuntime = createRuntime(runtimeID, location, configuration);
+ IServerType serverType = ServerCore.findServerType(serverID);
+ IServerWorkingCopy serverWC = serverType.createServer(null, null,
+ new NullProgressMonitor());
+ serverWC.setRuntime(currentRuntime);
+ serverWC.setName(serverID);
+ serverWC.setServerConfiguration(null);
+ IPath path = new Path(location).append("server").append("default")
+ .append("deploy");
+ ((ServerWorkingCopy) serverWC).setAttribute(
+ DeployableServer.DEPLOY_DIRECTORY, path.toOSString());
+ currentServer = serverWC.save(true, new NullProgressMonitor());
+
+ }
+
+ private IRuntime createRuntime(String runtimeId, String homeDir,
+ String config) throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null, null,
+ runtimeId);
+ assertEquals("expects only one runtime type", runtimeTypes.length, 1);
+ IRuntimeType runtimeType = runtimeTypes[0];
+ IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(null,
+ new NullProgressMonitor());
+ runtimeWC.setName(runtimeId);
+ runtimeWC.setLocation(new Path(homeDir));
+ ((RuntimeWorkingCopy) runtimeWC).setAttribute(
+ IJBossServerRuntime.PROPERTY_VM_ID, VM_INSTALL.getId());
+ ((RuntimeWorkingCopy) runtimeWC).setAttribute(
+ IJBossServerRuntime.PROPERTY_VM_TYPE_ID, VM_INSTALL
+ .getVMInstallType().getId());
+ ((RuntimeWorkingCopy) runtimeWC).setAttribute(
+ IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, config);
+ IRuntime savedRuntime = runtimeWC.save(true, new NullProgressMonitor());
+ return savedRuntime;
+ }
+
+ protected ServiceModel createServiceModel() {
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+ model.setWsdlURI(wsdlFile.getLocation().toOSString());
+ model.addServiceName("SOAPService");
+ model.addPortTypes("Greeter");
+ model.setCustomPackage("org.apache.hello_world_soap_http");
+
+ return model;
+
+ }
+
+ protected void publishWebProject() throws CoreException {
+ IModule[] modules = ServerUtil.getModules(currentServer.getServerType()
+ .getRuntimeType().getModuleTypes());
+ IServerWorkingCopy serverWC = currentServer.createWorkingCopy();
+ serverWC.modifyModules(modules, null, null);
+ serverWC.save(true, null).publish(0, null);
+ currentServer.publish(IServer.PUBLISH_FULL, null);
+
+ }
+
+ protected void undeployWebProject() throws CoreException {
+ IModule[] modules = ServerUtil.getModules(currentServer.getServerType()
+ .getRuntimeType().getModuleTypes());
+ IServerWorkingCopy serverWC = currentServer.createWorkingCopy();
+ serverWC.modifyModules(null, modules, null);
+ serverWC.save(true, null).publish(0, null);
+ currentServer.publish(IServer.PUBLISH_FULL, null);
+
+ }
+
+ protected void cleanProjectFromServer() throws CoreException {
+ IModule[] modules = ServerUtil.getModules(currentServer.getServerType()
+ .getRuntimeType().getModuleTypes());
+ IServerWorkingCopy serverWC = currentServer.createWorkingCopy();
+ serverWC.modifyModules(null, modules, null);
+ currentServer.publish(0, null);
+ currentServer.stop(true);
+
+ }
+
+ protected boolean isServerSupplied() {
+ return false;
+ }
+
+ protected IFacetedProject createJBossWSProject(String baseProjectName,
+ boolean isServerSupplied) throws CoreException {
+ IProject project = createProject(baseProjectName);
+ final IFacetedProject fproj = ProjectFacetsManager.create(project);
+
+ // installDependentFacets(fproj);
+ fproj.installProjectFacet(jbosswsFacetVersion,
+ createJBossWSDataModel(isServerSupplied), null);
+
+ assertNotNull(project);
+
+ this.addResourceToCleanup(project);
+
+ return fproj;
+ }
+
+ abstract IDataModel createJBossWSDataModel(boolean isServerSupplied);
+
+ protected final void addResourceToCleanup(final IResource resource) {
+ this.resourcesToCleanup.add(resource);
+ }
+
+ protected File getJBossWSHomeFolder() {
+
+ String jbosshome = System.getProperty(JBOSSWS_42_HOME,
+ JBOSSWS_HOME_DEFAULT);
+ File runtimelocation = new File(jbosshome);
+ assertTrue("Please set JBoss EAP Home in system property:"
+ + JBOSSWS_42_HOME, runtimelocation.exists());
+
+ String cmdFileLocation = jbosshome + File.separator + "bin"
+ + File.separator + "wsconsume.sh";
+ assertTrue(jbosshome + " is not a valid jboss EAP home", new File(
+ cmdFileLocation).exists());
+ return runtimelocation;
+ }
+
+ protected void startup() {
+ startup(DEFAULT_STARTUP_TIME);
+ }
+
+ protected void startup(int maxWait) {
+ long finishTime = new Date().getTime() + maxWait;
+
+ // operation listener, which is only alerted when the startup is *done*
+ final StatusWrapper opWrapper = new StatusWrapper();
+ final IOperationListener listener = new IOperationListener() {
+ public void done(IStatus result) {
+ opWrapper.setStatus(result);
+ }
+ };
+
+ // a stream listener to listen for errors
+ ErrorStreamListener streamListener = new ErrorStreamListener();
+
+ // the thread to actually start the server
+ Thread startThread = new Thread() {
+ public void run() {
+ currentServer.start(ILaunchManager.RUN_MODE, listener);
+ }
+ };
+
+ startThread.start();
+
+ boolean addedStream = false;
+ while (finishTime > new Date().getTime()
+ && opWrapper.getStatus() == null) {
+ // we're waiting for startup to finish
+ if (!addedStream) {
+ IStreamMonitor mon = getStreamMonitor();
+ if (mon != null) {
+ mon.addListener(streamListener);
+ addedStream = true;
+ }
+ }
+ try {
+ Display.getDefault().readAndDispatch();
+ } catch (SWTException swte) {
+ }
+ }
+
+ try {
+ assertTrue(
+ "Startup has taken longer than what is expected for a default startup",
+ finishTime >= new Date().getTime());
+ assertFalse("Startup had System.error output", streamListener
+ .hasError());
+ } catch (AssertionFailedError afe) {
+ // cleanup
+ currentServer.stop(true);
+ // rethrow
+ throw afe;
+ }
+ getStreamMonitor().removeListener(streamListener);
+ }
+
+ protected void shutdown() {
+ shutdown(DEFAULT_SHUTDOWN_TIME);
+ }
+
+ protected void shutdown(int maxWait) {
+ long finishTime = new Date().getTime() + maxWait;
+
+ // operation listener, which is only alerted when the startup is *done*
+ final StatusWrapper opWrapper = new StatusWrapper();
+ final IOperationListener listener = new IOperationListener() {
+ public void done(IStatus result) {
+ opWrapper.setStatus(result);
+ }
+ };
+
+ // a stream listener to listen for errors
+ ErrorStreamListener streamListener = new ErrorStreamListener();
+ if (getStreamMonitor() != null)
+ getStreamMonitor().addListener(streamListener);
+
+ // the thread to actually start the server
+ Thread stopThread = new Thread() {
+ public void run() {
+ currentServer.stop(false, listener);
+ }
+ };
+
+ stopThread.start();
+
+ while (finishTime > new Date().getTime()
+ && opWrapper.getStatus() == null) {
+ // we're waiting for startup to finish
+ try {
+ Display.getDefault().readAndDispatch();
+ } catch (SWTException swte) {
+ }
+ }
+
+ try {
+ assertTrue(
+ "Startup has taken longer than what is expected for a default startup",
+ finishTime >= new Date().getTime());
+ assertFalse("Startup had System.error output", streamListener
+ .hasError());
+ } catch (AssertionFailedError afe) {
+ // cleanup
+ currentServer.stop(true);
+ // rethrow
+ throw afe;
+ }
+ }
+
+ protected IStreamMonitor getStreamMonitor() {
+ JBossServerBehavior behavior = (JBossServerBehavior) currentServer
+ .loadAdapter(JBossServerBehavior.class, null);
+ if (behavior != null) {
+ if (behavior.getProcess() != null) {
+ return behavior.getProcess().getStreamsProxy()
+ .getOutputStreamMonitor();
+ }
+ }
+ return null;
+ }
+
+ protected class ServerStateListener implements IServerListener {
+ private ArrayList<Integer> stateChanges;
+
+ public ServerStateListener() {
+ this.stateChanges = new ArrayList<Integer>();
+ }
+
+ public ArrayList<Integer> getStateChanges() {
+ return stateChanges;
+ }
+
+ public void serverChanged(ServerEvent event) {
+ if ((event.getKind() & ServerEvent.SERVER_CHANGE) != 0) {
+ if ((event.getKind() & ServerEvent.STATE_CHANGE) != 0) {
+ if (event.getState() != IServer.STATE_STOPPED)
+ stateChanges.add(new Integer(event.getState()));
+ }
+ }
+ }
+ }
+
+ protected class ErrorStreamListener implements IStreamListener {
+ protected boolean errorFound = false;
+ String entireLog = "";
+
+ public void streamAppended(String text, IStreamMonitor monitor) {
+ entireLog += text;
+ }
+
+ // will need to be fixed or decided how to figure out errors
+ public boolean hasError() {
+ return errorFound;
+ }
+ }
+
+ public class StatusWrapper {
+ protected IStatus status;
+
+ public IStatus getStatus() {
+ return this.status;
+ }
+
+ public void setStatus(IStatus s) {
+ this.status = s;
+ }
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSClientCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSClientCommandTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSClientCommandTest.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.creation.core.test.command;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaModel;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.ws.internal.wsrt.IWebServiceClient;
+import org.eclipse.wst.ws.internal.wsrt.WebServiceClientInfo;
+import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
+import org.jboss.tools.ws.core.classpath.JBossWSRuntime;
+import org.jboss.tools.ws.core.classpath.JBossWSRuntimeManager;
+import org.jboss.tools.ws.core.classpath.JBossWSRuntimeClassPathInitializer.JBossWSRuntimeClasspathContainer;
+import org.jboss.tools.ws.core.facet.delegate.IJBossWSFacetDataModelProperties;
+import org.jboss.tools.ws.core.facet.delegate.JBossWSFacetInstallDataModelProvider;
+import org.jboss.tools.ws.creation.core.JBossWSCreationCorePlugin;
+import org.jboss.tools.ws.creation.core.commands.ClientSampleCreationCommand;
+import org.jboss.tools.ws.creation.core.commands.InitialClientCommand;
+import org.jboss.tools.ws.creation.core.commands.RemoveClientJarsCommand;
+import org.jboss.tools.ws.creation.core.commands.WSDL2JavaCommand;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.ui.wsrt.JBossWebServiceClient;
+
+/**
+ * @author Grid Qian
+ */
+@SuppressWarnings("restriction")
+public class JBossWSClientCommandTest extends AbstractJBossWSCommandTest {
+
+ private static final String RuntimeName;
+ private static final boolean isDeployed;
+
+ static {
+ RuntimeName = "testjbosswsruntime";
+ isDeployed = false;
+ }
+
+ public JBossWSClientCommandTest() {
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ JBossWSRuntimeManager.getInstance().addRuntime(RuntimeName,
+ getJBossWSHomeFolder().toString(), "", true);
+
+ // create jbossws web project
+ fproject = createJBossWSProject("JBossWSTestProject",
+ isServerSupplied());
+ IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+
+ assertTrue(wsdlFile.exists());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ resourcesToCleanup.clear();
+ JBossWSRuntime runtime = JBossWSRuntimeManager.getInstance()
+ .findRuntimeByName(RuntimeName);
+ JBossWSRuntimeManager.getInstance().removeRuntime(runtime);
+ }
+
+ public void testInitialClientCommand() throws CoreException,
+ ExecutionException {
+
+ IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ // model.setWsdlURI(wsdlFile.getLocation().toOSString());
+
+ WebServiceClientInfo info = new WebServiceClientInfo();
+ info.setWsdlURL(wsdlFile.getLocation().toOSString());
+ IWebServiceClient ws = new JBossWebServiceClient(info);
+
+ // test initial command
+ InitialClientCommand cmdInitial = new InitialClientCommand(model, ws,
+ WebServiceScenario.CLIENT);
+ IStatus status = cmdInitial.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ assertTrue(model.getServiceNames().contains("SOAPService"));
+ assertEquals(wsdlFile.getLocation().toOSString(), model.getWsdlURI());
+ assertTrue(model.getPortTypes().contains("Greeter"));
+ assertEquals("org.apache.hello_world_soap_http", model
+ .getCustomPackage());
+
+ }
+
+ public void testClientCodeGenerationCommand() throws ExecutionException {
+
+ ServiceModel model = createServiceModel();
+ IProject project = fproject.getProject();
+ // test wsdl2Javacommand
+ WSDL2JavaCommand cmdW2j = new WSDL2JavaCommand(model);
+ IStatus status = cmdW2j.execute(null, null);
+ assertFalse(status.getMessage(), Status.ERROR == status.getSeverity());
+ assertTrue(project.getFile(
+ "src/org/apache/hello_world_soap_http/Greeter.java").exists());
+
+ // test ClientSampleCreationCommand
+ ClientSampleCreationCommand cmdImpl = new ClientSampleCreationCommand(
+ model);
+ status = cmdImpl.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+ assertTrue(
+ "failed to generate sample class",
+ project
+ .getFile(
+ "src/org/apache/hello_world_soap_http/clientsample/ClientSample.java")
+ .exists());
+
+ }
+
+ public void testRemoveClientJarsCommand() throws ExecutionException {
+
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+
+ RemoveClientJarsCommand command = new RemoveClientJarsCommand(model);
+ IStatus status = command.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+ try {
+ IClasspathEntry[] entries = getJavaProjectByName(
+ fproject.getProject().getName()).getRawClasspath();
+
+ for (IClasspathEntry entry : entries) {
+ IClasspathContainer container = JavaCore.getClasspathContainer(
+ entry.getPath(), getJavaProjectByName(fproject
+ .getProject().getName()));
+ if (container instanceof JBossWSRuntimeClasspathContainer) {
+ boolean nojar = true;
+ for (IClasspathEntry jar : ((JBossWSRuntimeClasspathContainer) container)
+ .getClasspathEntries()) {
+ if (jar.getPath().toString().contains("jaxws-rt.jar")) {
+ nojar = false;
+ }
+ }
+ assertTrue(nojar);
+ }
+ }
+ } catch (JavaModelException e) {
+ JBossWSCreationCorePlugin.getDefault().logError(e);
+ }
+
+ }
+
+ public static IJavaProject getJavaProjectByName(String projectName)
+ throws JavaModelException {
+
+ IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace()
+ .getRoot());
+ model.open(null);
+
+ IJavaProject[] projects = model.getJavaProjects();
+
+ for (IJavaProject proj : projects) {
+ if (proj.getProject().getName().equals(projectName)) {
+ return proj;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ IDataModel createJBossWSDataModel(boolean isServerSupplied) {
+ IDataModel config = (IDataModel) new JBossWSFacetInstallDataModelProvider()
+ .create();
+ if (isServerSupplied) {
+ config
+ .setBooleanProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_IS_SERVER_SUPPLIED,
+ true);
+ } else {
+ config.setBooleanProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_DEPLOY,
+ isDeployed);
+ config.setStringProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID,
+ RuntimeName);
+ config.setStringProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_HOME,
+ getJBossWSHomeFolder().toString());
+ }
+ return config;
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSJavaFirstCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSJavaFirstCommandTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSJavaFirstCommandTest.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,319 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.creation.core.test.command;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.AbstractConsole;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleListener;
+import org.eclipse.ui.console.IConsoleManager;
+import org.eclipse.ui.console.TextConsole;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.ws.internal.wsrt.IWebService;
+import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo;
+import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
+import org.jboss.tools.ws.core.classpath.JBossWSRuntime;
+import org.jboss.tools.ws.core.classpath.JBossWSRuntimeManager;
+import org.jboss.tools.ws.core.facet.delegate.IJBossWSFacetDataModelProperties;
+import org.jboss.tools.ws.core.facet.delegate.JBossWSFacetInstallDataModelProvider;
+import org.jboss.tools.ws.creation.core.commands.InitialCommand;
+import org.jboss.tools.ws.creation.core.commands.MergeWebXMLCommand;
+import org.jboss.tools.ws.creation.core.commands.RemoveClientJarsCommand;
+import org.jboss.tools.ws.creation.core.commands.ValidateWSImplCommand;
+import org.jboss.tools.ws.creation.core.commands.Java2WSCommand;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
+import org.jboss.tools.ws.creation.ui.wsrt.JBossWebService;
+
+/**
+ * @author Grid Qian
+ */
+@SuppressWarnings("restriction")
+public class JBossWSJavaFirstCommandTest extends AbstractJBossWSCommandTest {
+ protected static final IWorkspace ws = ResourcesPlugin.getWorkspace();
+ protected static final IWorkbench wb = PlatformUI.getWorkbench();
+
+ private static final String RuntimeName;
+ private static final boolean isDeployed;
+ private IProject clientProject;
+
+ static {
+ RuntimeName = "testjbosswsruntime";
+ isDeployed = false;
+ }
+
+ public JBossWSJavaFirstCommandTest() {
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ JBossWSRuntimeManager.getInstance().addRuntime(RuntimeName,
+ getJBossWSHomeFolder().toString(), "", true);
+ // create jbossws web project
+ fproject = createJBossWSProject("JavaFirstTestProject",
+ isServerSupplied());
+
+ if (!ResourcesPlugin.getWorkspace().getRoot().getProject("ClientTest")
+ .exists()) {
+ createProject("ClientTest");
+ // this.addResourceToCleanup(clientProject);
+ }
+
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+
+ resourcesToCleanup.clear();
+ JBossWSRuntime runtime = JBossWSRuntimeManager.getInstance()
+ .findRuntimeByName(RuntimeName);
+ JBossWSRuntimeManager.getInstance().removeRuntime(runtime);
+ }
+
+ public void testInitialCommand() throws CoreException, ExecutionException {
+
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ WebServiceInfo info = new WebServiceInfo();
+ info.setImplURL("org.example.www.helloworld.HelloWorld");
+ IWebService ws = new JBossWebService(info);
+
+ // test initial command
+ InitialCommand cmdInitial = new InitialCommand(model, ws,
+ WebServiceScenario.BOTTOMUP);
+ IStatus status = cmdInitial.execute(null, null);
+
+ assertTrue(status.getMessage(), status.isOK());
+ assertTrue(model.getServiceClasses().get(0).equals(
+ "org.example.www.helloworld.HelloWorld"));
+ }
+
+ public void testValidateWSImplCommand() throws ExecutionException {
+
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ model.addServiceClasses("org.example.www.helloworld.HelloWorld");
+
+ ValidateWSImplCommand command = new ValidateWSImplCommand(model);
+ IStatus status = command.execute(null, null);
+
+ assertTrue(status.getMessage(), status.isOK());
+
+ }
+
+ public void testJava2WSCommand() throws ExecutionException, CoreException {
+
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ model.addServiceClasses("org.example.www.helloworld.HelloWorld");
+ model.setGenWSDL(true);
+ IProject project = fproject.getProject();
+
+ fproject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
+ fproject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+
+ Java2WSCommand command = new Java2WSCommand(model);
+ IStatus status = command.execute(null, null);
+
+ assertFalse(status.getMessage(), Status.ERROR == status.getSeverity());
+ assertTrue(project.getFile(
+ "src/org/example/www/helloworld/jaxws/SayHello.java").exists());
+ assertTrue(project.getFile("wsdl/HelloWorldService.wsdl").exists());
+ }
+
+ public void testDeployResult() throws ExecutionException, CoreException,
+ IOException {
+
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+
+ WebServiceInfo info = new WebServiceInfo();
+ info.setImplURL("org.example.www.helloworld.HelloWorld");
+ IWebService ws = new JBossWebService(info);
+
+ // test initial command
+ AbstractDataModelOperation cmd = new InitialCommand(model, ws,
+ WebServiceScenario.BOTTOMUP);
+ IStatus status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ fproject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
+ fproject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+
+ cmd = new Java2WSCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ cmd = new MergeWebXMLCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ fproject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
+ fproject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ publishWebProject();
+
+ assertTrue(currentServer.getModules().length > 0);
+ String webServiceUrl = "http://localhost:8080/JavaFirstTestProject/HelloWorld?wsdl";
+ URL url = new URL(webServiceUrl);
+ URLConnection conn = url.openConnection();
+
+ startup();
+
+ assertEquals("unable to start JBoss server", IServer.STATE_STARTED,
+ currentServer.getServerState());
+
+ conn.connect();
+ assertFalse("The url connection's status is "
+ + ((HttpURLConnection) conn).getResponseMessage(), "Ok"
+ .equals(((HttpURLConnection) conn).getResponseMessage()));
+
+ model = new ServiceModel();
+ model.setWebProjectName("ClientTest");
+
+ cmd = new RemoveClientJarsCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ clientProject = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ "ClientTest");
+ clientProject.open(null);
+ clientProject.refreshLocal(IResource.DEPTH_INFINITE, null);
+
+ ILaunchManager launchManager = DebugPlugin.getDefault()
+ .getLaunchManager();
+ ILaunchConfigurationType launchConfigurationType = launchManager
+ .getLaunchConfigurationType("org.eclipse.jdt.launching.localJavaApplication");
+ ILaunchConfigurationWorkingCopy wc = launchConfigurationType
+ .newInstance(null, "ClientSample");
+ wc.setAttribute("org.eclipse.debug.core.MAPPED_RESOURCE_TYPES", "1");
+ wc.setAttribute("org.eclipse.jdt.launching.MAIN_TYPE",
+ "org.example.www.helloworld.clientsample.ClientSample");
+ wc.setAttribute("org.eclipse.jdt.launching.PROGRAM_ARGUMENTS", "Test");
+ wc.setAttribute("org.eclipse.jdt.launching.PROJECT_ATTR", "ClientTest");
+ wc.doSave();
+ wc.launch(ILaunchManager.RUN_MODE, null);
+ IConsoleManager consolemanager = getConsoleManager();
+ checkText(consolemanager.getConsoles());
+ }
+
+ private void checkText(IConsole[] consoles) {
+ // test run result
+ for (IConsole console : consoles) {
+ if (console.getName().contains("ClientSample")) {
+ int i = 0;
+ while (i < 30
+ && !isContainString(
+ console,
+ JBossWSCreationCoreMessages.Client_Sample_Run_Over)) {
+ delay(1000);
+ i++;
+ }
+ assertTrue(
+ ((TextConsole) console).getDocument().get(),
+ isContainString(
+ console,
+ JBossWSCreationCoreMessages.Client_Sample_Run_Over));
+ }
+ }
+ }
+
+ public static boolean isContainString(IConsole console, String str) {
+ return ((TextConsole) console).getDocument().get().contains(str);
+ }
+
+ public static void delay(long durationInMilliseconds) {
+ Display display = Display.getCurrent();
+ if (display != null) {
+ long t2 = System.currentTimeMillis() + durationInMilliseconds;
+ while (System.currentTimeMillis() < t2) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ display.update();
+ } else {
+ try {
+ Thread.sleep(durationInMilliseconds);
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+
+ public static IConsoleManager getConsoleManager() {
+ IConsoleManager consolemanager = ConsolePlugin.getDefault()
+ .getConsoleManager();
+
+ consolemanager.addConsoleListener(new IConsoleListener() {
+ public void consolesAdded(IConsole[] consoles) {
+ for (int i = 0; i < consoles.length; i++) {
+ ((AbstractConsole) consoles[i]).activate();
+ }
+
+ }
+
+ public void consolesRemoved(IConsole[] consoles) {
+ for (int i = 0; i < consoles.length; i++) {
+ ((AbstractConsole) consoles[i]).destroy();
+ }
+
+ }
+ });
+ return consolemanager;
+ }
+
+ @Override
+ IDataModel createJBossWSDataModel(boolean isServerSupplied) {
+ IDataModel config = (IDataModel) new JBossWSFacetInstallDataModelProvider()
+ .create();
+ if (isServerSupplied) {
+ config
+ .setBooleanProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_IS_SERVER_SUPPLIED,
+ true);
+ } else {
+ config.setBooleanProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_DEPLOY,
+ isDeployed);
+ config.setStringProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID,
+ RuntimeName);
+ config.setStringProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_HOME,
+ getJBossWSHomeFolder().toString());
+ }
+ return config;
+ }
+
+}
Added: trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSTopDownCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSTopDownCommandTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.creation.core.test/src/org/jboss/tools/ws/creation/core/test/command/JBossWSTopDownCommandTest.java 2010-04-07 06:38:22 UTC (rev 21296)
@@ -0,0 +1,277 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.creation.core.test.command;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.j2ee.model.IModelProvider;
+import org.eclipse.jst.j2ee.model.ModelProviderManager;
+import org.eclipse.jst.j2ee.webapplication.ServletType;
+import org.eclipse.jst.javaee.web.Servlet;
+import org.eclipse.jst.javaee.web.ServletMapping;
+import org.eclipse.jst.javaee.web.WebApp;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.ws.internal.wsrt.IWebService;
+import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo;
+import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
+import org.jboss.tools.ws.core.classpath.JBossWSRuntime;
+import org.jboss.tools.ws.core.classpath.JBossWSRuntimeManager;
+import org.jboss.tools.ws.core.facet.delegate.IJBossWSFacetDataModelProperties;
+import org.jboss.tools.ws.core.facet.delegate.JBossWSFacetInstallDataModelProvider;
+import org.jboss.tools.ws.creation.core.commands.ImplementationClassCreationCommand;
+import org.jboss.tools.ws.creation.core.commands.InitialCommand;
+import org.jboss.tools.ws.creation.core.commands.MergeWebXMLCommand;
+import org.jboss.tools.ws.creation.core.commands.WSDL2JavaCommand;
+import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.ui.wsrt.JBossWebService;
+
+@SuppressWarnings("restriction")
+public class JBossWSTopDownCommandTest extends AbstractJBossWSCommandTest {
+ protected static final IWorkspace ws = ResourcesPlugin.getWorkspace();
+ protected static final IWorkbench wb = PlatformUI.getWorkbench();
+
+
+
+ private static final String RuntimeName;
+ private static final boolean isDeployed;
+
+ static String wsdlFileName = "hello_world.wsdl";
+
+ static {
+ RuntimeName = "testjbosswsruntime";
+ isDeployed = false;
+ }
+
+ public JBossWSTopDownCommandTest() {
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ JBossWSRuntimeManager.getInstance().addRuntime(RuntimeName, getJBossWSHomeFolder().toString(), "", true);
+
+ //create jbossws web project
+ fproject = createJBossWSProject("JBossWSTestProject", isServerSupplied());
+ IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+
+ assertTrue(wsdlFile.exists());
+ }
+
+
+
+ protected void tearDown() throws Exception {
+ // Wait until all jobs is finished to avoid delete project problems
+ super.tearDown();
+ resourcesToCleanup.clear();
+ JBossWSRuntime runtime = JBossWSRuntimeManager.getInstance().findRuntimeByName(RuntimeName);
+ JBossWSRuntimeManager.getInstance().removeRuntime(runtime);
+ }
+
+
+ public void testInitialCommand() throws CoreException, ExecutionException{
+
+ IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ //model.setWsdlURI(wsdlFile.getLocation().toOSString());
+
+
+ WebServiceInfo info = new WebServiceInfo();
+ info.setWsdlURL(wsdlFile.getLocation().toOSString());
+ IWebService ws = new JBossWebService(info);
+
+ //test initial command
+ InitialCommand cmdInitial = new InitialCommand(model, ws, WebServiceScenario.TOPDOWN);
+ IStatus status = cmdInitial.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ assertTrue(model.getServiceNames().contains("SOAPService"));
+ assertEquals(wsdlFile.getLocation().toOSString(), model.getWsdlURI());
+ assertTrue(model.getPortTypes().contains("Greeter"));
+ assertEquals("org.apache.hello_world_soap_http", model.getCustomPackage());
+
+ }
+
+
+ public void testCodeGenerationCommand() throws ExecutionException{
+
+ ServiceModel model = createServiceModel();
+ IProject project = fproject.getProject();
+ //test wsdl2Javacommand
+ WSDL2JavaCommand cmdW2j = new WSDL2JavaCommand(model);
+ IStatus status = cmdW2j.execute(null, null);
+ assertTrue(status.getMessage(), status.getSeverity() != Status.ERROR);
+
+ assertTrue(project.getFile("src/org/apache/hello_world_soap_http/Greeter.java").exists());
+
+ // test ImplementationClassCreationCommand
+ model.setGenerateImplementatoin(false);
+ ImplementationClassCreationCommand cmdImpl = new ImplementationClassCreationCommand(model);
+ status = cmdImpl.execute(null, null);
+ assertTrue(status.getMessage(), status.getSeverity() != Status.ERROR);
+ assertFalse(project.getFile("src/org/apache/hello_world_soap_http/GreeterImpl.java").exists());
+
+ model.setGenerateImplementatoin(true);
+ cmdImpl = new ImplementationClassCreationCommand(model);
+ status = cmdImpl.execute(null, null);
+ assertTrue(status.getMessage(), status.getSeverity() != Status.ERROR);
+ assertTrue("failed to generate implemenatation class", project.getFile("src/org/apache/hello_world_soap_http/GreeterImpl.java").exists());
+
+
+ }
+
+ public void testMergeWebXMLCommand() throws ExecutionException{
+ ServiceModel model = createServiceModel();
+ model.setGenerateImplementatoin(true);
+ model.setUpdateWebxml(true);
+ model.setWebProjectName(fproject.getProject().getName());
+ model.addServiceClasses("org.apache.hello_world_soap_http.GreeterImpl");
+ MergeWebXMLCommand cmdweb = new MergeWebXMLCommand(model);
+ IStatus status = cmdweb.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ IProject project = fproject.getProject();
+ IFile webxml = project.getFile("WebContent/WEB-INF/web.xml");
+ assertTrue(webxml.exists());
+ IModelProvider provider = ModelProviderManager
+ .getModelProvider(project);
+ Object object = provider.getModelObject();
+ if (object instanceof WebApp) {
+ WebApp webApp = (WebApp) object;
+ assertTrue("failed to update web.xml ", webApp.getServlets().size() > 0);
+ Servlet servlet = (Servlet)webApp.getServlets().get(0);
+ assertEquals("the servlet with the name 'Greeger' was not created", servlet.getServletName(), "Greeter");
+ assertTrue("the servlet display names should contain 'Greeter'", servlet.getDisplayNames().contains("Greeter"));
+ assertEquals("org.apache.hello_world_soap_http.GreeterImpl", servlet.getServletClass());
+
+ ServletMapping mapping = (ServletMapping)webApp.getServletMappings().get(0);
+ assertTrue("url patterns should contain '/Greeter'", mapping.getUrlPatterns().contains("/Greeter"));
+ assertEquals("Greeter", mapping.getServletName());
+ }else if(object instanceof org.eclipse.jst.j2ee.webapplication.WebApp){
+ org.eclipse.jst.j2ee.webapplication.WebApp webApp = (org.eclipse.jst.j2ee.webapplication.WebApp) object;
+ assertTrue("failed to update web.xml ", webApp.getServlets().size() > 0);
+ org.eclipse.jst.j2ee.webapplication.Servlet servlet = (org.eclipse.jst.j2ee.webapplication.Servlet)webApp.getServlets().get(0);
+ assertEquals("a servlet with the name 'Greeger' should be created", servlet.getServletName(), "Greeter");
+ assertEquals("servlet display name:","Greeter", servlet.getDisplayName());
+ if(servlet.getWebType() instanceof ServletType){
+ ServletType webtype = (ServletType)servlet.getWebType();
+ assertEquals("org.apache.hello_world_soap_http.GreeterImpl", webtype.getClassName());
+ }
+
+ org.eclipse.jst.j2ee.webapplication.ServletMapping mapping = (org.eclipse.jst.j2ee.webapplication.ServletMapping)webApp.getServletMappings().get(0);
+ assertEquals("url pattern: ","/Greeter", mapping.getUrlPattern());
+ assertEquals("Greeter", mapping.getServlet().getServletName());
+ }
+ //ServerType d; d.createServer(id, file, monitor)
+
+ }
+
+ public void testDeployResult() throws ExecutionException, CoreException, IOException{
+
+ //currentServer.start(ILaunchManager.RUN_MODE, new NullProgressMonitor());
+ IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ //model.setWsdlURI(wsdlFile.getLocation().toOSString());
+
+
+ WebServiceInfo info = new WebServiceInfo();
+ info.setWsdlURL(wsdlFile.getLocation().toOSString());
+ IWebService ws = new JBossWebService(info);
+
+ //test initial command
+ AbstractDataModelOperation cmd = new InitialCommand(model, ws, WebServiceScenario.TOPDOWN);
+ IStatus status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.getSeverity() != Status.ERROR);
+
+ cmd = new WSDL2JavaCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.getSeverity() != Status.ERROR);
+
+ cmd = new ImplementationClassCreationCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.getSeverity() != Status.ERROR);
+
+ cmd = new MergeWebXMLCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ fproject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
+ fproject.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ publishWebProject();
+
+ assertTrue(currentServer.getModules().length > 0);
+ String webServiceUrl = "http://localhost:8080/JBossWSTestProject/Greeter?wsdl";
+ URL url = new URL(webServiceUrl);
+ URLConnection conn = url.openConnection();
+
+ startup();
+
+ assertEquals("unable to start JBoss server",IServer.STATE_STARTED, currentServer.getServerState());
+
+ conn.connect();
+ conn.getContent();
+
+
+
+ }
+
+ protected ServiceModel createServiceModel(){
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+ model.setWsdlURI(wsdlFile.getLocation().toOSString());
+ model.addServiceName("SOAPService");
+ model.addPortTypes("Greeter");
+ model.setCustomPackage("org.apache.hello_world_soap_http");
+
+ return model;
+
+ }
+
+
+ protected boolean isServerSupplied(){
+ return false;
+ }
+
+
+
+ protected IDataModel createJBossWSDataModel( boolean isServerSupplied) {
+ IDataModel config = (IDataModel) new JBossWSFacetInstallDataModelProvider().create();
+ if(isServerSupplied){
+ config.setBooleanProperty(IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_IS_SERVER_SUPPLIED, true);
+ }else{
+ config.setBooleanProperty(IJBossWSFacetDataModelProperties.JBOSS_WS_DEPLOY, isDeployed);
+ config.setStringProperty(IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID, RuntimeName);
+ config.setStringProperty(IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_HOME, getJBossWSHomeFolder().toString());
+ }
+ return config;
+ }
+
+
+
+
+}
14 years, 9 months