JBoss Tools SVN: r19980 - in trunk/ws/plugins: org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2010-01-28 05:56:25 -0500 (Thu, 28 Jan 2010)
New Revision: 19980
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/messages/JBossWSCreationCore.properties
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/UIUtils.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateSampleClassWizardPage.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWebXmlWizardPage.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java
Log:
JBIDE-5715: create a wizard for generating a sample web service class in a dynamic project
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-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2010-01-28 10:56:25 UTC (rev 19980)
@@ -28,8 +28,8 @@
import org.eclipse.jst.javaee.web.ServletMapping;
import org.eclipse.jst.javaee.web.WebApp;
import org.eclipse.jst.javaee.web.WebFactory;
-import org.eclipse.wst.common.environment.IEnvironment;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+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;
import org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils;
@@ -40,6 +40,7 @@
public class MergeWebXMLCommand extends AbstractDataModelOperation {
private ServiceModel model;
+ IStatus status;
public MergeWebXMLCommand(ServiceModel model) {
this.model = model;
@@ -48,12 +49,11 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
+ status = Status.OK_STATUS;
if (!model.isUpdateWebxml()) {
- return Status.OK_STATUS;
+ return status;
}
- IEnvironment environment = getEnvironment();
- IStatus status = null;
ServletDescriptor[] servletDescriptors = new ServletDescriptor[model
.getServiceClasses().size()];
List<String> serviceClasses = model.getServiceClasses();
@@ -61,16 +61,11 @@
servletDescriptors[i] = getServletDescriptor(serviceClasses.get(i));
}
- status = mergeWebXML(servletDescriptors);
- if (status.getSeverity() == Status.ERROR) {
- environment.getStatusHandler().reportError(status);
- return status;
- }
- return Status.OK_STATUS;
+ mergeWebXML(servletDescriptors);
+ return status;
}
- private IStatus mergeWebXML(final ServletDescriptor[] servletDescriptors) {
- IStatus status = Status.OK_STATUS;
+ private void mergeWebXML(final ServletDescriptor[] servletDescriptors) {
final IModelProvider provider = ModelProviderManager
.getModelProvider(JBossWSCreationUtils.getProjectByName(model
.getWebProjectName()));
@@ -96,7 +91,6 @@
}
}, null);
- return status;
}
@SuppressWarnings("unchecked")
@@ -108,9 +102,21 @@
org.eclipse.jst.j2ee.webapplication.Servlet aServlet = (org.eclipse.jst.j2ee.webapplication.Servlet) theServlets
.get(i);
if (aServlet.getServletName().equals(servletDescriptor._name)) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
return;
}
}
+ List theServletMapplings = webapp.getServletMappings();
+ for (int i = 0; i < theServletMapplings.size(); i++) {
+ org.eclipse.jst.j2ee.webapplication.ServletMapping aServletMapping = (org.eclipse.jst.j2ee.webapplication.ServletMapping) theServletMapplings
+ .get(i);
+ if (aServletMapping.getName().equals(servletDescriptor._name)
+ || aServletMapping.getUrlPattern().equals(
+ servletDescriptor._mappings)) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
+ return;
+ }
+ }
org.eclipse.jst.j2ee.webapplication.WebapplicationFactory factory = org.eclipse.jst.j2ee.webapplication.WebapplicationFactory.eINSTANCE;
org.eclipse.jst.j2ee.webapplication.Servlet servlet = factory
.createServlet();
@@ -131,7 +137,6 @@
servletMapping.setUrlPattern(servletDescriptor._mappings);
webapp.getServletMappings().add(servletMapping);
}
-
}
private ServletDescriptor getServletDescriptor(String clsName) {
@@ -155,12 +160,36 @@
public void addjeeServlet(IProject webProject,
ServletDescriptor servletDescriptor, WebApp webapp) {
List theServlets = webapp.getServlets();
+
for (int i = 0; i < theServlets.size(); i++) {
Servlet aServlet = (Servlet) theServlets.get(i);
if (aServlet.getServletName().equals(servletDescriptor._name)) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
return;
}
}
+
+ List theServletMapplings = webapp.getServletMappings();
+ for (int i = 0; i < theServletMapplings.size(); i++) {
+ ServletMapping aServletMapping = (ServletMapping) theServletMapplings
+ .get(i);
+ if (aServletMapping.getServletName()
+ .equals(servletDescriptor._name)) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
+ return;
+ }
+ List list = aServletMapping.getUrlPatterns();
+ if (list != null) {
+ for (int j = 0; j < list.size(); j++) {
+ UrlPatternType url = (UrlPatternType) list.get(j);
+ if (url.getValue().equals(servletDescriptor._mappings)) {
+ status = StatusUtils.errorStatus(JBossWSCreationCoreMessages.Error_JBossWS_GenerateWizard_WSName_Same);
+ return;
+ }
+ }
+ }
+ }
+
WebFactory factory = WebFactory.eINSTANCE;
Servlet servlet = factory.createServlet();
servlet.setServletName(servletDescriptor._name);
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2010-01-28 10:56:25 UTC (rev 19980)
@@ -53,3 +53,4 @@
Command=wsconsume.sh
Bin=bin
+Error_JBossWS_GenerateWizard_WSName_Same=The Web Service Name has been used in the web.xml of the web project.
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2010-01-28 10:56:25 UTC (rev 19980)
@@ -64,6 +64,7 @@
public static String Command;
public static String Bin;
+ public static String Error_JBossWS_GenerateWizard_WSName_Same;
private JBossWSCreationCoreMessages() {
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-01-28 10:56:25 UTC (rev 19980)
@@ -15,7 +15,8 @@
org.eclipse.jst.j2ee,
org.eclipse.jem.util,
org.jboss.tools.ws.creation.core,
- org.eclipse.wst.common.frameworks
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.common.emfworkbench.integration
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.ws.ui,
org.jboss.tools.ws.ui.messages,
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-01-28 10:56:25 UTC (rev 19980)
@@ -52,4 +52,6 @@
JBossWS_GenerateWizard_WizardPage_CheckButton_Label=Use the default value
JBossWS_GenerateWizard_GenerateSampleClassPage_Package_Label=Package
JBossWS_GenerateWizard_GenerateSampleClassPage_ClassName_Label=Class
-JBossWS_GenerateWizard_NotDynamicWebProject_Error=This wizard may only be used on Dynamic Web Projects.
+Error_JBossWS_GenerateWizard_NotDynamicWebProject=The project must be a Dynamic Web Project and contain a web.xml in a right Location
+Error_JBossWS_GenerateWizard_ClassName_Same=The class name has been used in the web project.
+JBossWS_GenerateWizard_MessageDialog_Title=Error
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-01-28 10:56:25 UTC (rev 19980)
@@ -86,7 +86,9 @@
public static String JBossWS_GenerateWizard_WizardPage_CheckButton_Label;
public static String JBossWS_GenerateWizard_GenerateSampleClassPage_Package_Label;
public static String JBossWS_GenerateWizard_GenerateSampleClassPage_ClassName_Label;
- public static String JBossWS_GenerateWizard_NotDynamicWebProject_Error;
+ public static String Error_JBossWS_GenerateWizard_NotDynamicWebProject;
+ public static String Error_JBossWS_GenerateWizard_ClassName_Same;
+ public static String JBossWS_GenerateWizard_MessageDialog_Title;
static {
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/UIUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/UIUtils.java 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/UIUtils.java 2010-01-28 10:56:25 UTC (rev 19980)
@@ -23,6 +23,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
@@ -37,6 +39,9 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
/**
* @author Grid Qian
@@ -498,5 +503,21 @@
matchingFilePath.delete();
}
}
+
+ public static IPath getWebContentRootPath(IProject project) {
+ if (project == null)
+ return null;
+
+ if (!ModuleCoreNature.isFlexibleProject(project))
+ return null;
+
+ IPath path = null;
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if (component != null && component.exists()) {
+ path = component.getRootFolder().getWorkspaceRelativePath();
+ }
+ return path;
+ }
+
}
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateSampleClassWizardPage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateSampleClassWizardPage.java 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateSampleClassWizardPage.java 2010-01-28 10:56:25 UTC (rev 19980)
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.ws.ui.wizards;
import org.eclipse.jface.wizard.WizardPage;
@@ -41,40 +41,42 @@
public void createControl(Composite parent) {
Composite composite = createDialogArea(parent);
this.wizard = (JBossWSGenerateWizard) this.getWizard();
- new Label(composite, SWT.NONE).setText(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateSampleClassPage_Package_Label);
+ new Label(composite, SWT.NONE)
+ .setText(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateSampleClassPage_Package_Label);
packageName = new Text(composite, SWT.BORDER);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
packageName.setLayoutData(gd);
packageName.setText(wizard.getPackageName());
packageName.setEnabled(!wizard.isUseDefaultClassName());
- packageName.addModifyListener(new ModifyListener(){
+ packageName.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- if (!"".equals(packageName.getText())&&!"".equals(className.getText())){ //$NON-NLS-1$ //$NON-NLS-2$
+ if (!"".equals(packageName.getText()) && !"".equals(className.getText())) { //$NON-NLS-1$ //$NON-NLS-2$
setPageComplete(true);
- }else {
+ } else {
setPageComplete(false);
}
}
-
+
});
-
- new Label(composite, SWT.NONE).setText(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateSampleClassPage_ClassName_Label);
+
+ new Label(composite, SWT.NONE)
+ .setText(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateSampleClassPage_ClassName_Label);
className = new Text(composite, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
className.setLayoutData(gd);
className.setText(wizard.getClassName());
className.setEnabled(!wizard.isUseDefaultClassName());
- className.addModifyListener(new ModifyListener(){
+ className.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- if (!"".equals(packageName.getText())&&!"".equals(className.getText())){ //$NON-NLS-1$ //$NON-NLS-2$
+ if (!"".equals(packageName.getText()) && !"".equals(className.getText())) { //$NON-NLS-1$ //$NON-NLS-2$
setPageComplete(true);
- }else {
+ } else {
setPageComplete(false);
}
}
-
+
});
checkDefault = new Button(composite, SWT.CHECK);
@@ -82,7 +84,8 @@
gd.horizontalSpan = 2;
checkDefault.setLayoutData(gd);
checkDefault.setSelection(wizard.isUseDefaultClassName());
- checkDefault.setText(JBossWSUIMessages.JBossWS_GenerateWizard_WizardPage_CheckButton_Label);
+ checkDefault
+ .setText(JBossWSUIMessages.JBossWS_GenerateWizard_WizardPage_CheckButton_Label);
checkDefault.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
@@ -107,11 +110,11 @@
}
public boolean isPageComplete() {
- if(!"".equals(packageName.getText())&&!"".equals(className.getText())){ //$NON-NLS-1$//$NON-NLS-2$
- wizard.setPackageName(packageName.getText());
- wizard.setClassName(className.getText());
- return true;
- }
+ if (!"".equals(packageName.getText()) && !"".equals(className.getText())) { //$NON-NLS-1$//$NON-NLS-2$
+ wizard.setPackageName(packageName.getText());
+ wizard.setClassName(className.getText());
+ return true;
+ }
return false;
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWebXmlWizardPage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWebXmlWizardPage.java 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWebXmlWizardPage.java 2010-01-28 10:56:25 UTC (rev 19980)
@@ -7,7 +7,7 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.ws.ui.wizards;
import org.eclipse.jface.wizard.IWizardPage;
@@ -27,51 +27,53 @@
public class JBossWSGenerateWebXmlWizardPage extends WizardPage {
private JBossWSGenerateWizard wizard;
- private Text name;
- private Button checkDefault;
-
-
+ private Text name;
+ private Button checkDefault;
+
protected JBossWSGenerateWebXmlWizardPage(String pageName) {
super(pageName);
- this.setTitle(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWebXmlPage_Title);
- this.setDescription(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWebXmlPage_Description);
+ this
+ .setTitle(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWebXmlPage_Title);
+ this
+ .setDescription(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWebXmlPage_Description);
}
public void createControl(Composite parent) {
Composite composite = createDialogArea(parent);
- this.wizard = (JBossWSGenerateWizard)this.getWizard();
- new Label (composite, SWT.NONE).setText(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWebXmlPage_ServiceName_Label);
+ this.wizard = (JBossWSGenerateWizard) this.getWizard();
+ new Label(composite, SWT.NONE)
+ .setText(JBossWSUIMessages.JBossWS_GenerateWizard_GenerateWebXmlPage_ServiceName_Label);
name = new Text(composite, SWT.BORDER);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
name.setLayoutData(gd);
name.setText(wizard.getServiceName());
name.setEnabled(!wizard.isUseDefaultServiceName());
- name.addModifyListener(new ModifyListener(){
+ name.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
- if (!"".equals(name.getText())){ //$NON-NLS-1$
+ if (!"".equals(name.getText())) { //$NON-NLS-1$
setPageComplete(true);
} else {
setPageComplete(false);
}
}
-
+
});
-
-
+
checkDefault = new Button(composite, SWT.CHECK);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
checkDefault.setLayoutData(gd);
checkDefault.setSelection(wizard.isUseDefaultServiceName());
- checkDefault.setText(JBossWSUIMessages.JBossWS_GenerateWizard_WizardPage_CheckButton_Label);
- checkDefault.addSelectionListener(new SelectionListener(){
+ checkDefault
+ .setText(JBossWSUIMessages.JBossWS_GenerateWizard_WizardPage_CheckButton_Label);
+ checkDefault.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
- if (checkDefault.getSelection()){
+ if (checkDefault.getSelection()) {
checkDefault.setSelection(true);
name.setText(wizard.NAMEDEFAULT);
} else {
@@ -80,19 +82,18 @@
name.setEnabled(!checkDefault.getSelection());
wizard.setUseDefaultServiceName(!checkDefault.getSelection());
}
-
+
});
-
+
setControl(composite);
-
}
-
- public IWizardPage getNextPage(){
+
+ public IWizardPage getNextPage() {
wizard.setServiceName(name.getText());
return super.getNextPage();
}
-
+
private Composite createDialogArea(Composite parent) {
// create a composite with standard margins and spacing
Composite composite = new Composite(parent, SWT.NONE);
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java 2010-01-28 07:44:11 UTC (rev 19979)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSGenerateWizard.java 2010-01-28 10:56:25 UTC (rev 19980)
@@ -7,15 +7,17 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.ws.ui.wizards;
import java.io.File;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.internal.core.JavaProject;
-import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
@@ -25,6 +27,7 @@
import org.jboss.tools.ws.creation.core.commands.ServiceSampleCreationCommand;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
+import org.jboss.tools.ws.ui.utils.UIUtils;
public class JBossWSGenerateWizard extends Wizard implements INewWizard {
@@ -40,11 +43,13 @@
private String className = CLASSDEFAULT;
private boolean useDefaultServiceName = true;
private boolean useDefaultClassName = true;
-
+
private IStructuredSelection selection;
private IProject project;
private static String WEB = "web.xml"; //$NON-NLS-1$
- private File webFile;
+ private static String JAVA = ".java"; //$NON-NLS-1$
+ private static String WEBINF = "WEB-INF"; //$NON-NLS-1$
+ private IFile webFile;
private boolean hasInited = false;
public JBossWSGenerateWizard() {
@@ -66,14 +71,39 @@
if (canFinish()) {
ServiceModel model = new ServiceModel();
model.setWebProjectName(project.getName());
- model.addServiceClasses(new StringBuffer().append(
- getPackageName())
+ model.addServiceClasses(new StringBuffer().append(getPackageName())
.append(".").append(getClassName()).toString()); //$NON-NLS-1$
model.setServiceName(getServiceName());
model.setUpdateWebxml(true);
model.setCustomPackage(getPackageName());
+
+ File file = findFileByPath(getClassName() + JAVA, project
+ .getLocation().toOSString());
+ if (file != null) {
+ MessageDialog
+ .openError(
+ this.getShell(),
+ JBossWSUIMessages.JBossWS_GenerateWizard_MessageDialog_Title,
+ JBossWSUIMessages.Error_JBossWS_GenerateWizard_ClassName_Same);
+ return false;
+ }
+
+ IStatus status = null;
try {
- new MergeWebXMLCommand(model).execute(null, null);
+ MergeWebXMLCommand mergeCommand = new MergeWebXMLCommand(model);
+ status = mergeCommand.execute(null, null);
+ } catch (ExecutionException e) {
+ e.printStackTrace();
+ }
+ if (status != null && status.getSeverity() == Status.ERROR) {
+ MessageDialog
+ .openError(
+ this.getShell(),
+ JBossWSUIMessages.JBossWS_GenerateWizard_MessageDialog_Title,
+ status.getMessage());
+ return false;
+ }
+ try {
new ServiceSampleCreationCommand(model).execute(null, null);
} catch (ExecutionException e) {
e.printStackTrace();
@@ -82,6 +112,51 @@
return true;
}
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ if (this.selection.getFirstElement() instanceof IProject) {
+ project = (IProject) this.selection.getFirstElement();
+ }
+ if (project != null
+ && JavaEEProjectUtilities.isDynamicWebProject(project)) {
+ webFile = project.getParent().getFolder(
+ UIUtils.getWebContentRootPath(project).append(WEBINF))
+ .getFile(WEB);
+ }
+ hasInited = true;
+ }
+
+ @Override
+ public boolean canFinish() {
+ if (hasInited && (webFile == null || !webFile.exists())) {
+ if (firstPage != null && !firstPage.getControl().isDisposed()) {
+ firstPage
+ .setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
+ }
+ return false;
+ }
+ return super.canFinish();
+ }
+
+ private 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;
+ }
+
public String getServiceName() {
return serviceName;
}
@@ -121,54 +196,4 @@
public void setUseDefaultClassName(boolean useDefaultClassName) {
this.useDefaultClassName = useDefaultClassName;
}
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
-
- if (this.selection.getFirstElement() instanceof JavaProject) {
- project = ((JavaProject)this.selection.getFirstElement()).getProject();
- }
- else if (this.selection.getFirstElement() instanceof IProject) {
- project = (IProject) this.selection.getFirstElement();
- }
- if (project != null
- && JavaEEProjectUtilities.isDynamicWebProject(project)) {
- webFile = findFileByPath(project.getLocation().toOSString());
- if (webFile != null) {
- // TODO: if this is valid, we can finish
- }
- }
- hasInited = true;
- }
-
- @Override
- public boolean canFinish() {
- if (hasInited && webFile == null ) {
- if (firstPage != null && !firstPage.getControl().isDisposed()) {
- firstPage.setErrorMessage(JBossWSUIMessages.JBossWS_GenerateWizard_NotDynamicWebProject_Error);
- }
- return false;
- }
- return super.canFinish();
- }
-
- private File findFileByPath(String path) {
- File ret = null;
- File folder = new File(path);
- if (folder.isDirectory()) {
- File[] files = folder.listFiles();
- for (File file : files) {
- ret = findFileByPath(file.getAbsolutePath());
- if (ret != null) {
- break;
- }
- }
- } else {
- if (WEB.equals(folder.getName())) {
- ret = folder;
- }
- }
- return ret;
- }
-
}
14 years, 11 months
JBoss Tools SVN: r19978 - trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2010-01-28 02:27:26 -0500 (Thu, 28 Jan 2010)
New Revision: 19978
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java
Log:
JBIDE-5750:NPE when creating a ESB project without specifing target runtime
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java 2010-01-28 07:13:35 UTC (rev 19977)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java 2010-01-28 07:27:26 UTC (rev 19978)
@@ -96,6 +96,9 @@
// Add the server runtime as well
IFacetedProject fp = ProjectFacetsManager.create(project);
IRuntime runtime = fp.getPrimaryRuntime();
+
+ if(runtime == null) return;
+
String name = runtime.getName();
org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore.findRuntime(name);
RuntimeClasspathProviderWrapper rcpw = JavaServerPlugin.findRuntimeClasspathProvider(serverRuntime.getRuntimeType());
14 years, 11 months
JBoss Tools SVN: r19977 - trunk/bpel/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-01-28 02:13:35 -0500 (Thu, 28 Jan 2010)
New Revision: 19977
Modified:
trunk/bpel/releng/build.properties
trunk/bpel/releng/build.properties.example.hudson.qa.jboss.com
trunk/bpel/releng/build.properties.example.linux
trunk/bpel/releng/build.properties.example.windows
Log:
switch tests to use testLocal instead of test
Modified: trunk/bpel/releng/build.properties
===================================================================
--- trunk/bpel/releng/build.properties 2010-01-28 07:10:21 UTC (rev 19976)
+++ trunk/bpel/releng/build.properties 2010-01-28 07:13:35 UTC (rev 19977)
@@ -12,8 +12,8 @@
mainFeatureToBuildID=org.jboss.tools.bpel.sdk.feature
testFeatureToBuildID=org.jboss.tools.bpel.tests.feature
-build.steps=buildUpdate,buildTests,generateDigests,test,publish,cleanup
-#build.steps=buildUpdate,generateDigests,publish,cleanup
+# on windows or mac, use testLocal; on linux can use test if Xvnc or Xvfb installed; use testLocal if run from Hudson job w/ Xvnc enabled
+build.steps=buildUpdate,buildTests,generateDigests,testLocal,publish,cleanup
JAVA14_HOME=${JAVA_HOME}
JAVA50_HOME=${JAVA_HOME}
@@ -30,14 +30,6 @@
#http://repository.jboss.org/eclipse/galileo/repos/emf-xsd-Update-2.5.0.zip,\
#http://repository.jboss.org/eclipse/galileo/repos/jst-buildrepo-R-3.1.1-20090917225226.zip,\
#http://repository.jboss.org/eclipse/galileo/repos/wst-buildrepo-R-3.1.1-20090917225226.zip
-# Alt location for repos: mirror_id=581 = Amazon AWS mirror
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/eclipse-Update-R-3.5.1-200909170800.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/GEF-Update-3.5.1.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/dtp-Updates-1.7-20090908.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/emf-xsd-Update-2.5.0.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/jst-buildrepo-R-3.1.1-20090917225226.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/wst-buildrepo-R-3.1.1-20090917225226.zip
-# alternative locations from which to fetch IUs
# required if building bpel.compare.ui: org.eclipse.gmf.runtime.diagram.ui+org.eclipse.emf.compare.match+org.eclipse.emf.compare.diff+org.eclipse.emf.compare.ui+\
IUsToInstall=org.eclipse.sdk.feature.group+org.eclipse.sdk.ide+org.eclipse.core.net+org.eclipse.equinox.common+org.eclipse.core.runtime+org.eclipse.debug.core+org.eclipse.rcp.feature.group+\
Modified: trunk/bpel/releng/build.properties.example.hudson.qa.jboss.com
===================================================================
--- trunk/bpel/releng/build.properties.example.hudson.qa.jboss.com 2010-01-28 07:10:21 UTC (rev 19976)
+++ trunk/bpel/releng/build.properties.example.hudson.qa.jboss.com 2010-01-28 07:13:35 UTC (rev 19977)
@@ -12,7 +12,8 @@
mainFeatureToBuildID=org.jboss.tools.bpel.sdk.feature
testFeatureToBuildID=org.jboss.tools.bpel.tests.feature
-build.steps=buildUpdate,buildTests,generateDigests,test,publish,cleanup
+# on windows or mac, use testLocal; on linux can use test if Xvnc or Xvfb installed; use testLocal if run from Hudson job w/ Xvnc enabled
+build.steps=buildUpdate,buildTests,generateDigests,testLocal,publish,cleanup
JAVA14_HOME=${JAVA_HOME}
JAVA50_HOME=${JAVA_HOME}
@@ -29,14 +30,6 @@
#http://repository.jboss.org/eclipse/galileo/repos/emf-xsd-Update-2.5.0.zip,\
#http://repository.jboss.org/eclipse/galileo/repos/jst-buildrepo-R-3.1.1-20090917225226.zip,\
#http://repository.jboss.org/eclipse/galileo/repos/wst-buildrepo-R-3.1.1-20090917225226.zip
-# Alt location for repos: mirror_id=581 = Amazon AWS mirror
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/eclipse-Update-R-3.5.1-200909170800.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/GEF-Update-3.5.1.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/dtp-Updates-1.7-20090908.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/emf-xsd-Update-2.5.0.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/jst-buildrepo-R-3.1.1-20090917225226.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/wst-buildrepo-R-3.1.1-20090917225226.zip
-# alternative locations from which to fetch IUs
# required if building bpel.compare.ui: org.eclipse.gmf.runtime.diagram.ui+org.eclipse.emf.compare.match+org.eclipse.emf.compare.diff+org.eclipse.emf.compare.ui+\
IUsToInstall=org.eclipse.sdk.feature.group+org.eclipse.sdk.ide+org.eclipse.core.net+org.eclipse.equinox.common+org.eclipse.core.runtime+org.eclipse.debug.core+org.eclipse.rcp.feature.group+\
Modified: trunk/bpel/releng/build.properties.example.linux
===================================================================
--- trunk/bpel/releng/build.properties.example.linux 2010-01-28 07:10:21 UTC (rev 19976)
+++ trunk/bpel/releng/build.properties.example.linux 2010-01-28 07:13:35 UTC (rev 19977)
@@ -12,7 +12,8 @@
mainFeatureToBuildID=org.jboss.tools.bpel.sdk.feature
testFeatureToBuildID=org.jboss.tools.bpel.tests.feature
-build.steps=buildUpdate,buildTests,generateDigests,test,publish,cleanup
+# on windows or mac, use testLocal; on linux can use test if Xvnc or Xvfb installed; use testLocal if run from Hudson job w/ Xvnc enabled
+build.steps=buildUpdate,buildTests,generateDigests,testLocal,publish,cleanup
# Re-use local sources?
# note: to run tests locally, these plugins must be pre-checked out into the local source folder:
@@ -41,14 +42,6 @@
#http://repository.jboss.org/eclipse/galileo/repos/emf-xsd-Update-2.5.0.zip,\
#http://repository.jboss.org/eclipse/galileo/repos/jst-buildrepo-R-3.1.1-20090917225226.zip,\
#http://repository.jboss.org/eclipse/galileo/repos/wst-buildrepo-R-3.1.1-20090917225226.zip
-# Alt location for repos: mirror_id=581 = Amazon AWS mirror
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/eclipse-Update-R-3.5.1-200909170800.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/GEF-Update-3.5.1.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/dtp-Updates-1.7-20090908.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/emf-xsd-Update-2.5.0.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/jst-buildrepo-R-3.1.1-20090917225226.zip,\
-#http://www.eclipse.org/downloads/download.php?mirror_id=581&r=1&file=/athena/repos/wst-buildrepo-R-3.1.1-20090917225226.zip
-# alternative locations from which to fetch IUs
# required if building bpel.compare.ui: org.eclipse.gmf.runtime.diagram.ui+org.eclipse.emf.compare.match+org.eclipse.emf.compare.diff+org.eclipse.emf.compare.ui+\
IUsToInstall=org.eclipse.sdk.feature.group+org.eclipse.sdk.ide+org.eclipse.core.net+org.eclipse.equinox.common+org.eclipse.core.runtime+org.eclipse.debug.core+org.eclipse.rcp.feature.group+\
Modified: trunk/bpel/releng/build.properties.example.windows
===================================================================
--- trunk/bpel/releng/build.properties.example.windows 2010-01-28 07:10:21 UTC (rev 19976)
+++ trunk/bpel/releng/build.properties.example.windows 2010-01-28 07:13:35 UTC (rev 19977)
@@ -12,6 +12,7 @@
mainFeatureToBuildID=org.jboss.tools.bpel.sdk.feature
testFeatureToBuildID=org.jboss.tools.bpel.tests.feature
+# on windows or mac, use testLocal; on linux can use test if Xvnc or Xvfb installed; use testLocal if run from Hudson job w/ Xvnc enabled
build.steps=buildUpdate,buildTests,generateDigests,testLocal,publish,cleanup
# to (re)generate map and psfs, use these settings
14 years, 11 months
JBoss Tools SVN: r19976 - trunk/common/releng/hudson.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-01-28 02:10:21 -0500 (Thu, 28 Jan 2010)
New Revision: 19976
Modified:
trunk/common/releng/hudson/run.sh
Log:
check for missing requirements - wget
Modified: trunk/common/releng/hudson/run.sh
===================================================================
--- trunk/common/releng/hudson/run.sh 2010-01-28 07:05:18 UTC (rev 19975)
+++ trunk/common/releng/hudson/run.sh 2010-01-28 07:10:21 UTC (rev 19976)
@@ -31,7 +31,7 @@
# check for required platform stuff
missingRequirements=""
-for f in cvs svn javac; do
+for f in cvs svn javac wget; do
check=$(whereis $f);
if [[ $check == "$f:" ]]; then
missingRequirements="$missingRequirements $f"
14 years, 11 months
JBoss Tools SVN: r19975 - trunk/common/releng/hudson.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-01-28 02:05:18 -0500 (Thu, 28 Jan 2010)
New Revision: 19975
Modified:
trunk/common/releng/hudson/run.sh
Log:
check for missing requirements - cvs, svn, javac, vncserver, Xvfb, Xvnc
Modified: trunk/common/releng/hudson/run.sh
===================================================================
--- trunk/common/releng/hudson/run.sh 2010-01-28 06:53:19 UTC (rev 19974)
+++ trunk/common/releng/hudson/run.sh 2010-01-28 07:05:18 UTC (rev 19975)
@@ -29,6 +29,35 @@
export ANT_HOME=/opt/apache-ant-1.7.1
fi
+# check for required platform stuff
+missingRequirements=""
+for f in cvs svn javac; do
+ check=$(whereis $f);
+ if [[ $check == "$f:" ]]; then
+ missingRequirements="$missingRequirements $f"
+ else
+ echo "Found $check"
+ fi
+done
+if [[ $missingRequirements ]]; then
+ echo "ERROR: You must install the following tools for this build to proceed:"
+ echo " $missingRequirements"
+ exit 1;
+fi
+missingRequirements=""
+for f in vncserver Xvfb Xvnc; do
+ check=$(whereis $f);
+ if [[ $check == "$f:" ]]; then
+ missingRequirements="$missingRequirements $f"
+ else
+ echo "Found $check"
+ fi
+done
+if [[ $missingRequirements ]]; then
+ echo "WARNING: You may require 1 or more of the following tools for this build to proceed:"
+ echo " $missingRequirements"
+fi
+
# cache of downloaded requirements and other binaries
downloadsDir="${WORKSPACE}/downloads"; if [[ ! -d $downloadsDir ]]; then mkdir -p $downloadsDir; fi
14 years, 11 months
JBoss Tools SVN: r19974 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: gef/tree/editparts and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-01-28 01:53:19 -0500 (Thu, 28 Jan 2010)
New Revision: 19974
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/DecoderTypeValidator.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeConnectionEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeConnection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
Log:
JBIDE-5716
done
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/DecoderTypeValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/DecoderTypeValidator.java 2010-01-28 05:20:18 UTC (rev 19973)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/DecoderTypeValidator.java 2010-01-28 06:53:19 UTC (rev 19974)
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * 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.smooks.configuration.validate;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
-import org.jboss.tools.smooks.model.javabean12.ValueType;
-
-/**
- * @author Dart dpeng(a)redhat.com
- *
- */
-public class DecoderTypeValidator extends AbstractValidator {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.jboss.tools.smooks.configuration.validate.ISmooksValidator#initValidator
- * (java.util.Collection, org.eclipse.emf.edit.domain.EditingDomain)
- */
- public void initValidator(Collection<?> selectedObjects, EditingDomain editingDomain) {
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.configuration.validate.AbstractValidator#validate(java.util.Collection, org.eclipse.emf.edit.domain.EditingDomain)
- */
- @Override
- public List<Diagnostic> validate(Collection<?> selectedObjects, EditingDomain editingDomain) {
- // TODO Auto-generated method stub
- return super.validate(selectedObjects, editingDomain);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.configuration.validate.AbstractValidator#validateModel(java.lang.Object, org.eclipse.emf.edit.domain.EditingDomain)
- */
- @Override
- protected Diagnostic validateModel(Object model, EditingDomain editingDomain) {
- if (model instanceof ValueType) {
- ValueType value = (ValueType) model;
- String decoder = value.getDecoder();
- String defaultDecoder = SmooksUIUtils.getDefualtDecoder(value);
- if (defaultDecoder == null) {
- return null;
- }
- if (decoder == null) {
- return newWaringDiagnostic("Decoder is required. Select at the connection to change it in Property View.", model, Javabean12Package.Literals.VALUE_TYPE__DECODER);
- } else {
- if (!decoder.equals(defaultDecoder)) {
- return newWaringDiagnostic("Decoder should be '" + defaultDecoder + "'. Select at the connection to change it in Property View.", model,
- Javabean12Package.Literals.VALUE_TYPE__DECODER);
- }
- }
- }
- return super.validateModel(model, editingDomain);
- }
-
-
-
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java 2010-01-28 05:20:18 UTC (rev 19973)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java 2010-01-28 06:53:19 UTC (rev 19974)
@@ -96,7 +96,7 @@
validatorList.add(new SelectorValidator());
validatorList.add(new PropertyValidator());
validatorList.add(new SetterMethodValidator());
- validatorList.add(new DecoderTypeValidator());
+// validatorList.add(new DecoderTypeValidator());
innerEditingDomain = newEditingDomain();
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeConnectionEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeConnectionEditPart.java 2010-01-28 05:20:18 UTC (rev 19973)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/TreeNodeConnectionEditPart.java 2010-01-28 06:53:19 UTC (rev 19974)
@@ -3,6 +3,11 @@
*/
package org.jboss.tools.smooks.gef.tree.editparts;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.draw2d.BendpointConnectionRouter;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Connection;
@@ -11,6 +16,7 @@
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.ManhattanConnectionRouter;
import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.draw2d.geometry.Point;
@@ -21,22 +27,55 @@
import org.eclipse.gef.editparts.AbstractConnectionEditPart;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorPart;
+import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
+import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeConnectionEditPolicy;
import org.jboss.tools.smooks.gef.tree.editpolicy.TreeNodeEndpointEditPolicy;
import org.jboss.tools.smooks.gef.tree.figures.LeftOrRightAnchor;
+import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
+import org.jboss.tools.smooks.graphical.editors.model.IValidatableModel;
/**
* @author DartPeng
*
*/
-public class TreeNodeConnectionEditPart extends AbstractConnectionEditPart {
+public class TreeNodeConnectionEditPart extends AbstractConnectionEditPart implements PropertyChangeListener {
protected int alpha = 255;
-
+
protected boolean canDelete = true;
-
+
private Image markerImage = null;
+ protected Label errorLabel = new Label();
+
+ protected Label warningLabel = new Label();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#activate()
+ */
@Override
+ public void activate() {
+ super.activate();
+ TreeNodeConnection connection = (TreeNodeConnection) getModel();
+ connection.addPropertyChangeListener(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#deactivate()
+ */
+ @Override
+ public void deactivate() {
+ TreeNodeConnection connection = (TreeNodeConnection) getModel();
+ connection.removePropertyChangeListener(this);
+ super.deactivate();
+ }
+
+ @Override
protected void createEditPolicies() {
this.installEditPolicy(EditPolicy.CONNECTION_ROLE, new TreeNodeConnectionEditPolicy());
this.installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new TreeNodeEndpointEditPolicy());
@@ -45,8 +84,6 @@
public void changeLineAlpha(int alpha) {
this.alpha = alpha;
}
-
-
/**
* @return the markerImage
@@ -56,7 +93,8 @@
}
/**
- * @param markerImage the markerImage to set
+ * @param markerImage
+ * the markerImage to set
*/
public void setMarkerImage(Image markerImage) {
this.markerImage = markerImage;
@@ -70,18 +108,72 @@
}
/**
- * @param canDelete the canDelete to set
+ * @param canDelete
+ * the canDelete to set
*/
public void setCanDelete(boolean canDelete) {
this.canDelete = canDelete;
}
-
- protected IEditorPart getEditorPart(){
+
+ protected IEditorPart getEditorPart() {
GraphicalViewer viewer = (GraphicalViewer) this.getViewer();
- DefaultEditDomain domain = (DefaultEditDomain)viewer.getEditDomain();
+ DefaultEditDomain domain = (DefaultEditDomain) viewer.getEditDomain();
return domain.getEditorPart();
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
+ */
+ @Override
+ protected void refreshVisuals() {
+
+ Label tooltip = null;
+ this.setMarkerImage(null);
+ Object connection = getModel();
+
+ if (connection instanceof IValidatableModel) {
+ int serverity = ((IValidatableModel) connection).getSeverity();
+ String message = getSeverityMessage((IValidatableModel) connection);
+ Image image = null;
+ if (serverity == IValidatableModel.NONE) {
+ image = null;
+ }
+ if (serverity == IValidatableModel.ERROR) {
+ image = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_ERROR);
+ tooltip = errorLabel;
+ tooltip.setText(message);
+ }
+ if (serverity == IValidatableModel.WARNING) {
+ image = SmooksConfigurationActivator.getDefault().getImageRegistry().get(
+ GraphicsConstants.IMAGE_WARNING);
+ tooltip = warningLabel;
+ tooltip.setText(message);
+ }
+ if (image != null) {
+ this.setMarkerImage(image);
+ getFigure().repaint();
+ // ((TreeNodeFigure) getFigure()).setLabelImage(image);
+ }
+ getFigure().setToolTip(tooltip);
+ }
+ }
+
+ protected String getSeverityMessage(IValidatableModel model) {
+ List<String> messages = model.getMessage();
+ String message = null;
+ for (Iterator<?> iterator = messages.iterator(); iterator.hasNext();) {
+ String string = (String) iterator.next();
+ if (message == null) {
+ message = " - " + string; //$NON-NLS-1$
+ } else {
+ message = message + "\n" + " - " + string; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ return message;
+ }
+
protected IFigure createSourceFlagFigure() {
Figure sourceFlagFigure = new Figure() {
@@ -187,13 +279,13 @@
};
return targetFlagFigure;
}
-
- protected void drawLineMarkerImage(Graphics graphics){
- if(getMarkerImage() != null){
- graphics.drawImage(getMarkerImage(), this.getFigure().getBounds().getCenter().getTranslated(-8, -8));
- }
+
+ protected void drawLineMarkerImage(Graphics graphics) {
+ if (getMarkerImage() != null) {
+ graphics.drawImage(getMarkerImage(), this.getFigure().getBounds().getCenter().getTranslated(
+ -getMarkerImage().getBounds().width / 2, -getMarkerImage().getBounds().height / 2));
+ }
}
-
protected Connection createConnectionFigure() {
PolylineConnection connection = new PolylineConnection() {
@@ -202,6 +294,10 @@
public void paintFigure(Graphics graphics) {
graphics.setAlpha(alpha);
graphics.setLineWidth(3);
+// if (getMarkerImage() == null) {
+// Point p = getBounds().getCenter().getTranslated(-8, -8);
+// graphics.fillRectangle(p.x, p.y, 16, 16);
+// }
super.paintFigure(graphics);
drawLineMarkerImage(graphics);
}
@@ -262,4 +358,11 @@
connection.setConnectionRouter(new BendpointConnectionRouter());
return connection;
}
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ String event = evt.getPropertyName();
+ if (AbstractSmooksGraphicalModel.PRO_SEVERITY_CHANGED.equals(event)) {
+ refreshVisuals();
+ }
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeConnection.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeConnection.java 2010-01-28 05:20:18 UTC (rev 19973)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeConnection.java 2010-01-28 06:53:19 UTC (rev 19974)
@@ -3,20 +3,33 @@
*/
package org.jboss.tools.smooks.gef.tree.model;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.runtime.Assert;
+import org.jboss.tools.smooks.configuration.editors.IFieldMarker;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
+import org.jboss.tools.smooks.graphical.editors.model.IValidatableModel;
/**
* @author DartPeng
*
*/
-public class TreeNodeConnection {
+public class TreeNodeConnection implements IValidatableModel{
+ protected int severity = IFieldMarker.TYPE_NONE;
+
private Object data;
private AbstractSmooksGraphicalModel sourceNode;
private AbstractSmooksGraphicalModel targetNode;
+
+ protected List<String> markerMessages = null;
+
+ protected PropertyChangeSupport support = new PropertyChangeSupport(this);
public TreeNodeConnection() {
@@ -86,4 +99,44 @@
public void setTargetNode(AbstractSmooksGraphicalModel targetNode) {
this.targetNode = targetNode;
}
+
+ public void addMessage(String message) {
+ this.getMessage().add(message);
+ }
+
+ public List<String> getMessage() {
+ if(markerMessages == null){
+ markerMessages = new ArrayList<String>();
+ }
+ return markerMessages;
+ }
+
+ /**
+ * @return the severity
+ */
+ public int getSeverity() {
+ return severity;
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener listener){
+ support.addPropertyChangeListener(listener);
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener){
+ support.removePropertyChangeListener(listener);
+ }
+
+ /**
+ * @param severity the severity to set
+ */
+ public void setSeverity(int severity) {
+ int old = this.severity;
+ if (severity == this.severity){
+ old = -1;
+ }
+ this.severity = severity;
+ support.firePropertyChange(AbstractSmooksGraphicalModel.PRO_SEVERITY_CHANGED, old, this.severity);
+ }
+
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2010-01-28 05:20:18 UTC (rev 19973)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksJavaMappingGraphicalEditor.java 2010-01-28 06:53:19 UTC (rev 19974)
@@ -10,23 +10,31 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.jboss.tools.smooks.configuration.editors.IFieldMarker;
import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
import org.jboss.tools.smooks.configuration.editors.actions.JavaBean11ActionGrouper;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
+import org.jboss.tools.smooks.gef.common.RootModel;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
+import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
import org.jboss.tools.smooks.graphical.editors.autolayout.IAutoLayout;
import org.jboss.tools.smooks.graphical.editors.autolayout.JavaMappingAutoLayout;
import org.jboss.tools.smooks.graphical.editors.model.javamapping.JavaBeanGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.javamapping.JavaMappingActionCreator;
import org.jboss.tools.smooks.model.javabean12.BeanType;
+import org.jboss.tools.smooks.model.javabean12.ValueType;
/**
* @author Dart
@@ -41,36 +49,105 @@
// TODO Auto-generated constructor stub
}
-
-
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#needToLayoutWhenAddModel(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
+ * needToLayoutWhenAddModel(java.lang.Object)
*/
@Override
protected boolean needToLayoutWhenAddModel(Object model) {
model = AdapterFactoryEditingDomain.unwrap(model);
- if(model instanceof BeanType){
+ if (model instanceof BeanType) {
return true;
}
return super.needToLayoutWhenAddModel(model);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
+ * validateEnd(java.util.List)
+ */
+ @Override
+ public void validateEnd(List<Diagnostic> diagnosticResult) {
+ super.validateEnd(diagnosticResult);
+ // validate decoder type (target connections of java property node)
+ GraphicalViewer viewer = this.getGraphicalViewer();
+ if (viewer != null) {
+ EditPart rootEditPart = viewer.getContents();
+ Object rootModel = rootEditPart.getModel();
+ if (rootModel instanceof AbstractSmooksGraphicalModel) {
+ validateConnection((AbstractSmooksGraphicalModel) rootModel);
+ }
+ }
+ }
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#needToLayoutWhenRemoveModel(java.lang.Object)
+ /**
+ *
+ * @param model
*/
+ protected void validateConnection(AbstractSmooksGraphicalModel model) {
+ List<TreeNodeConnection> targetConnections = model.getTargetConnections();
+ if (targetConnections != null) {
+ for (Iterator<?> iterator = targetConnections.iterator(); iterator.hasNext();) {
+ TreeNodeConnection connection = (TreeNodeConnection) iterator.next();
+ Object target = connection.getTargetNode().getData();
+ target = AdapterFactoryEditingDomain.unwrap(target);
+ if (target instanceof ValueType) {
+ ValueType value = (ValueType) target;
+ String decoder = value.getDecoder();
+ connection.getMessage().clear();
+ boolean changed = false;
+ String defaultDecoder = SmooksUIUtils.getDefualtDecoder(value);
+ if (defaultDecoder == null) {
+ connection.setSeverity(IFieldMarker.TYPE_NONE);
+ continue;
+ }
+ if (decoder == null) {
+ connection.addMessage("Decoder is required.");
+ connection.setSeverity(IFieldMarker.TYPE_WARINING);
+ changed = true;
+ } else {
+ if (!decoder.equals(defaultDecoder)) {
+ connection.addMessage("Decoder should be '" + defaultDecoder + "'.");
+ connection.setSeverity(IFieldMarker.TYPE_WARINING);
+ changed = true;
+ }
+ }
+ if(!changed){
+ connection.setSeverity(IFieldMarker.TYPE_NONE);
+ }
+ }
+ }
+ }
+ List<AbstractSmooksGraphicalModel> children = model.getChildrenWithoutDynamic();
+ if(model instanceof RootModel){
+ children = model.getChildren();
+ }
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
+ validateConnection(abstractSmooksGraphicalModel);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart#
+ * needToLayoutWhenRemoveModel(java.lang.Object)
+ */
@Override
protected boolean needToLayoutWhenRemoveModel(Object model) {
model = AdapterFactoryEditingDomain.unwrap(model);
- if(model instanceof BeanType){
+ if (model instanceof BeanType) {
return true;
}
return super.needToLayoutWhenRemoveModel(model);
}
-
-
/*
* (non-Javadoc)
*
@@ -186,35 +263,35 @@
}
return p;
}
-// if (obj instanceof BindingsType) {
-// String p = ((BindingsType) obj).getBeanId();
-// if (p == null) {
-// p = Messages.SmooksJavaMappingGraphicalEditor_NullLabel;
-// }
-// return p;
-// }
-//
-// if (obj instanceof ValueType) {
-// String p = ((ValueType) obj).getProperty();
-// if (p == null) {
-// p = Messages.SmooksJavaMappingGraphicalEditor_NullLabel;
-// }
-// return p;
-// }
-// if (obj instanceof WiringType) {
-// String p = ((WiringType) obj).getProperty();
-// if (p == null) {
-// p = Messages.SmooksJavaMappingGraphicalEditor_NullLabel;
-// }
-// return p;
-// }
-// if (obj instanceof ExpressionType) {
-// String p = ((ExpressionType) obj).getProperty();
-// if (p == null) {
-// p = Messages.SmooksJavaMappingGraphicalEditor_NullLabel;
-// }
-// return p;
-// }
+ // if (obj instanceof BindingsType) {
+ // String p = ((BindingsType) obj).getBeanId();
+ // if (p == null) {
+ // p = Messages.SmooksJavaMappingGraphicalEditor_NullLabel;
+ // }
+ // return p;
+ // }
+ //
+ // if (obj instanceof ValueType) {
+ // String p = ((ValueType) obj).getProperty();
+ // if (p == null) {
+ // p = Messages.SmooksJavaMappingGraphicalEditor_NullLabel;
+ // }
+ // return p;
+ // }
+ // if (obj instanceof WiringType) {
+ // String p = ((WiringType) obj).getProperty();
+ // if (p == null) {
+ // p = Messages.SmooksJavaMappingGraphicalEditor_NullLabel;
+ // }
+ // return p;
+ // }
+ // if (obj instanceof ExpressionType) {
+ // String p = ((ExpressionType) obj).getProperty();
+ // if (p == null) {
+ // p = Messages.SmooksJavaMappingGraphicalEditor_NullLabel;
+ // }
+ // return p;
+ // }
if (obj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
String p = ((org.jboss.tools.smooks.model.javabean12.ValueType) obj).getProperty();
14 years, 11 months
JBoss Tools SVN: r19973 - workspace/Denny/esb-example-soa-p5.0.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2010-01-28 00:20:18 -0500 (Thu, 28 Jan 2010)
New Revision: 19973
Modified:
workspace/Denny/esb-example-soa-p5.0/webservice_consumer1_client.zip
Log:
Modified: workspace/Denny/esb-example-soa-p5.0/webservice_consumer1_client.zip
===================================================================
(Binary files differ)
14 years, 11 months
JBoss Tools SVN: r19972 - trunk/bpel/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-01-28 00:16:09 -0500 (Thu, 28 Jan 2010)
New Revision: 19972
Added:
trunk/bpel/releng/custom-library.xml
Modified:
trunk/bpel/releng/testing.properties
Log:
commit custom library file and new properties for running tests
Added: trunk/bpel/releng/custom-library.xml
===================================================================
--- trunk/bpel/releng/custom-library.xml (rev 0)
+++ trunk/bpel/releng/custom-library.xml 2010-01-28 05:16:09 UTC (rev 19972)
@@ -0,0 +1,168 @@
+<?xml version="1.0"?>
+<project name="Library" default="usage" basedir=".">
+
+ <target name="usage">
+ <echo message="Please refer to the testframework.html in org.eclipse.test for instructions on usage." />
+ </target>
+
+ <target name="init">
+ <!--
+ Parameters:
+ (Mandatory)
+ data-dir - the directory for Eclipse to write its data
+ plugin-name - the name of the plugin to test
+ classname - the name of the test class
+
+ (Optional - overrides defaults set in script)
+ vmargs - a string containing arguments to pass to the VM.
+ extraVMargs - allows separate setting of VM args from separate caller.
+ timeout - overrides default test timeout value (in milliseconds).
+ test-output - overrides default output file produced from test run.
+ plugin-path - path to root of plug-in
+ useEclipseExe - property setting forces test to launch via eclipse executable.
+ junit-report-output - output directory for junit reports produced for specified classname.
+ -->
+
+ <tstamp>
+ <format property="TIMENOW" pattern="HHmmssSSSS"/>
+ </tstamp>
+ <!--property setting useEclipseExe launches tests using the eclipse executable-->
+ <condition property="launchTarget" value="eclipse-test">
+ <isset property="useEclipseExe" />
+ </condition>
+ <!--default launch target for launching tests-->
+ <property name="launchTarget" value="java-test" />
+ <property name="formatter" value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter"/>
+
+ <!--default heap sizes when running performance tests-->
+ <condition property="vmargs" value=" -Xms256M -Xmx512M">
+ <equals arg1="${test.target}" arg2="performance" />
+ </condition>
+ <property name="extraVMargs" value=""/>
+ <property name="plugin-path" value="" />
+ <property name="timeout" value="7200000" />
+ <property name="test-output" value="${eclipse-home}/${classname}.xml" />
+ <property name="junit-report-output" value="${eclipse-home}/results" />
+ <mkdir dir="${junit-report-output}"/>
+ </target>
+
+ <target name="core-test" description="Eclipse application used to launch HEADLESS plugin tests." depends="init">
+ <antcall target="${launchTarget}">
+ <param name="application" value="org.eclipse.test.coretestapplication"/>
+ </antcall>
+ </target>
+
+ <target name="ui-test" description="Eclipse application used to launch UI plugin tests." depends="init">
+ <antcall target="${launchTarget}">
+ <param name="application" value="org.eclipse.test.uitestapplication"/>
+ </antcall>
+ </target>
+
+ <target name="java-test">
+ <!--default vm args-->
+ <property name="vmargs" value=" -Xms40m -Xmx348m"/>
+
+ <!--set default jvm to use for testing-->
+ <property name="jvm" value="${java.home}/bin/java" />
+
+ <echo message="Running ${classname}. Result file: ${junit-report-output}/${classname}.xml."/>
+ <echo>vmargs=${vmargs}, extraVMargs=${extraVMargs}, Xflags=${Xflags}, Dflags=${Dflags}</echo>
+ <java fork="true" dir="." timeout="${timeout}" jvm="${jvm}" logError="true"
+ classname="org.eclipse.core.launcher.Main" output="${junit-report-output}/${classname}.txt">
+ <classpath>
+ <fileset dir="${eclipse-home}/plugins">
+ <include name="org.eclipse.equinox.launcher_*.jar"/>
+ </fileset>
+ </classpath>
+ <arg line="-application ${application}"/>
+ <arg line="-data ${data-dir}"/>
+ <arg line="formatter=${formatter},${test-output}"/>
+ <arg line="-testPluginName ${plugin-name}"/>
+ <arg line="-className ${classname}"/>
+ <arg line="-os ${os}"/>
+ <arg line="-ws ${ws}"/>
+ <arg line="-arch ${arch}"/>
+ <arg line="-consolelog"/>
+ <arg line="-vmargs ${vmargs} ${extraVMargs} ${Xflags} ${Dflags} -DPLUGIN_PATH=${plugin-path}"/>
+ </java>
+ <antcall target="collect-results" />
+ </target>
+
+ <target name="eclipse-test" description="Runs the specified classname as a plug-in test.">
+ <property name="vmargs" value="-Xms256m -Xmx512m"/>
+
+ <!--use -consolelog if launching a headless test-->
+ <condition property="consolelog" value="-consolelog">
+ <equals arg1="${application}" arg2="org.eclipse.test.coretestapplication"/>
+ </condition>
+ <property name="consolelog" value="" />
+
+ <!--
+ vm selection priority:
+ 1. user-specified java executable via outer Ant property setting of "jvm".
+ 2. java executable on path.
+ -->
+ <condition property="test-vm" value="-vm ${jvm}">
+ <isset property="jvm" />
+ </condition>
+ <property name="test-vm" value="" />
+
+ <!--ensure executable has execute permission-->
+ <chmod file="${eclipse-home}/eclipse" perm="ugo+rx"/>
+
+
+ <echo message="Running ${classname}. Result file: ${junit-report-output}/${classname}.xml."/>
+ <echo>vmargs=${vmargs}, extraVMargs=${extraVMargs}, Xflags=${Xflags}, Dflags=${Dflags}</echo>
+ <exec executable="${eclipse-home}/eclipse" dir="${eclipse-home}" timeout="${timeout}" logError="true" failonerror="false" output="${junit-report-output}/${classname}.txt">
+ <arg line="-data ${data-dir}"/>
+ <arg line="${test-vm}"/>
+ <arg line="-application ${application}"/>
+ <arg line="formatter=${formatter},${test-output}"/>
+ <arg line="-testPluginName ${plugin-name}"/>
+ <arg line="-className ${classname}"/>
+ <arg line="-nosplash"/>
+ <arg line="--launcher.suppressErrors"/>
+ <arg line="${consolelog}"/>
+ <arg line="-vmargs ${vmargs} ${extraVMargs} ${Xflags} ${Dflags} -DPLUGIN_PATH=${plugin-path}"/>
+ </exec>
+ <antcall target="collect-results" />
+ </target>
+
+ <target name="collect-results">
+ <dirname property="output-dir" file="${test-output}"/>
+ <basename property="output-file-name" file="${test-output}"/>
+ <junitreport todir="${junit-report-output}" tofile="${classname}.xml">
+ <fileset dir="${output-dir}">
+ <include name="${output-file-name}"/>
+ </fileset>
+ </junitreport>
+
+ <xslt style="${eclipse-home}/dropins/eclipse/plugins/org.eclipse.test/JUNIT.XSL"
+ basedir="${junit-report-output}"
+ includes="${classname}.result.xml"
+ destdir="${junit-report-output}" />
+
+ <!--save .log content and *.log content from configuration directory-->
+ <concat destfile="${junit-report-output}/${classname}.log">
+ <fileset dir="${eclipse-home}" includes="${data-dir}/.metadata/*.log"/>
+ <fileset dir="${eclipse-home}" includes="configuration/*.log"/>
+ </concat>
+ </target>
+
+ <target name="collect">
+ <!--
+ This target can be used to aggragate test runs from multiple test suites into a single report.
+
+ Parameters to this target:
+ includes - the names of the files to include
+ output-file - the name of the output file to produce
+ -->
+ <junitreport todir="." tofile="${output-file}">
+ <fileset dir=".">
+ <include name="${includes}"/>
+ </fileset>
+ </junitreport>
+ </target>
+
+</project>
+
Property changes on: trunk/bpel/releng/custom-library.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/bpel/releng/testing.properties
===================================================================
--- trunk/bpel/releng/testing.properties 2010-01-28 05:15:01 UTC (rev 19971)
+++ trunk/bpel/releng/testing.properties 2010-01-28 05:16:09 UTC (rev 19972)
@@ -6,6 +6,68 @@
# the test plugin to deviate from default one-suite-per-plugin operation
org.jboss.tools.bpel.ui.test.suite=org.jboss.tools.bpel.ui.test.BpelUIAllTests
-# set different defaults when running these tests
-vmargs=" -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m "
-extraVMargs=" -Xbootclasspath/a:./emma.jar "
+# to use a different library-file than the default from org.eclipse.test/library.xml
+library-file=${relengBuilderDir}/custom-library.xml
+
+# to dump test properties into console log and separate file (for debugging purposes), set echotestproperties=true
+echotestproperties=true
+
+################################################################################################
+
+#which (sub)project?
+project=${subprojectName}
+
+#target to call in test.xml: runtests-local | runtests-remote
+testTarget=runtests-local
+
+#directory on test machine where automated testing framework will be installed
+# testBase=/tmp/build/N200911122249/testing
+# testDir=/tmp/build/N200911122249/testing/N200911122249
+testDir=${testBase}/${buildLabel}
+
+#name of zip file containing automated testing framework and JUnit test plug-ins
+testFramework=${zipPrefix}-Automated-Tests${incubation}-${buildAlias}.zip
+
+#directory where test scripts are launched
+# executionDir=/tmp/build/N200911122249/testing/N200911122249/testing
+executionDir=${testDir}/testing
+
+#name of Update & Master Zip or runtime/SDK/all-in-one to install and test
+updateZip=${zipPrefix}-Update${incubation}-${buildAlias}.zip
+MasterZip=${zipPrefix}-Master${incubation}-${buildAlias}.zip
+# backup if update zip does not exist
+SDKZip=${zipPrefix}-SDK${incubation}-${buildAlias}.zip
+
+#used by org.eclipse.build.tools/scripts/test.xml; must be set (but no longer used)
+runtime=${zipPrefix}-Update${incubation}-${buildAlias}.zip
+
+# path to java
+vmExecutable=${JAVA_HOME}/bin/java
+
+#hack to override unneeded function in releng.basebuilder/plugins/org.eclipse.build.tools/scripts/test.xml
+vmUrl=
+vmDest=/dev/null
+vmInstallExecutable=${vmExecutable}
+vmInstallCommand=-version
+
+#eclipse platforms: win32 | linux.motif | linux.gtk | aix.motif | hpux.motif |solaris.motif
+platform=${baseos}.${basews}
+
+#name of file that captures console output from running JUnit plug-in tests
+consolelog=${baseos}.${basews}_consolelog.txt
+
+#Works with IBM and Sun JDKs, 1.4+
+#name of script to execute
+testExecutable=bash
+
+Xflags= -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
+#see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=106396 for rationale for "-Dosgi.bundlefile.limit=100"
+Dflags=-Dosgi.bundlefile.limit=100
+
+#arguments to ${testExecutable} - .sh script + args
+args=${executionDir}/${shell} -vmExecutable ${vmExecutable} -consolelog ${consolelog} ${Xflags} ${Dflags}
+
+# vmargs and extraVMargs are used by library.xml (or your own custom version)
+#vmargs= -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
+#extraVMargs= -Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m
+# could also add things like: -Xbootclasspath/a:/path/to/emma.jar ?
14 years, 11 months
JBoss Tools SVN: r19971 - workspace/Denny/esb-example-soa-p5.0.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2010-01-28 00:15:01 -0500 (Thu, 28 Jan 2010)
New Revision: 19971
Modified:
workspace/Denny/esb-example-soa-p5.0/helloworld_file_action.zip
Log:
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_file_action.zip
===================================================================
(Binary files differ)
14 years, 11 months