JBoss Tools SVN: r21573 - in trunk/jsf/plugins/org.jboss.tools.jsf: META-INF and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-04-21 04:46:06 -0400 (Wed, 21 Apr 2010)
New Revision: 21573
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/resources/templates/
trunk/jsf/plugins/org.jboss.tools.jsf/resources/templates/composite.xhtml
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ValidationInfo.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2Validator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2MarkerResolution.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentParams.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentsUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ResourceUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2TemplateManager.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.properties
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5930 - first version of quick fix for composite components
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2010-04-21 08:38:08 UTC (rev 21572)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2010-04-21 08:46:06 UTC (rev 21573)
@@ -44,7 +44,8 @@
org.eclipse.wst.common.modulecore,
org.eclipse.wst.validation,
org.eclipse.jdt.core.manipulation,
- org.eclipse.jst.j2ee
+ org.eclipse.jst.j2ee,
+ org.eclipse.ui.ide
Bundle-Version: 2.0.0
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.properties 2010-04-21 08:38:08 UTC (rev 21572)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.properties 2010-04-21 08:46:06 UTC (rev 21573)
@@ -2,3 +2,7 @@
pluginName=JBoss Tools JSF
XHTML_Validator.name = XHTML Syntax Validator
+
+JSF2_ComponentsValidator.name = JSF2 Components Validator
+
+JSF2ProblemName = JSF 2 Problem
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2010-04-21 08:38:08 UTC (rev 21572)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2010-04-21 08:46:06 UTC (rev 21573)
@@ -499,4 +499,56 @@
<adapter type="org.eclipse.core.resources.IProject"/>
</factory>
</extension>
-</plugin>
\ No newline at end of file
+ <extension
+ id="jsf2"
+ name="%JSF2_ComponentsValidator.name"
+ point="org.eclipse.wst.validation.validatorV2">
+ <validator
+ build="true"
+ class="org.jboss.tools.jsf.web.validation.jsf2.JSF2ComponentsValidator"
+ manual="true"
+ markerId="org.jboss.tools.jsf.jsf2problemmarker"
+ sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
+ version="4">
+ <include>
+ <rules>
+ <contentType
+ id="org.eclipse.wst.html.core.htmlsource">
+ </contentType>
+ <contentType
+ id="org.eclipse.jst.jsp.core.jspfragmentsource">
+ </contentType>
+ <contentType
+ id="org.eclipse.jst.jsp.core.tagsource">
+ </contentType>
+ <fileext
+ caseSensitive="false"
+ ext="xhtml">
+ </fileext>
+ <fileext
+ caseSensitive="false"
+ ext="jsp">
+ </fileext>
+ </rules>
+ </include>
+ </validator>
+ </extension>
+ <extension
+ point="org.eclipse.ui.ide.markerResolution">
+ <markerResolutionGenerator
+ class="org.jboss.tools.jsf.web.validation.jsf2.action.JSF2ComponentResolutionGenerator"
+ markerType="org.jboss.tools.jsf.jsf2problemmarker">
+ </markerResolutionGenerator>
+ </extension>
+ <extension
+ id="jsf2problemmarker"
+ name="%JSF2ProblemName"
+ point="org.eclipse.core.resources.markers">
+ <super
+ type="org.eclipse.core.resources.problemmarker">
+ </super>
+ <persistent
+ value="true">
+ </persistent>
+ </extension>
+</plugin>
Added: trunk/jsf/plugins/org.jboss.tools.jsf/resources/templates/composite.xhtml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/resources/templates/composite.xhtml (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/resources/templates/composite.xhtml 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+
+ <!-- INTERFACE -->
+ <composite:interface>
+ <composite:attribute name=""/>
+ </composite:interface>
+
+ <!-- IMPLEMENTATION -->
+ <composite:implementation>
+ </composite:implementation>
+
+</html>
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java 2010-04-21 08:38:08 UTC (rev 21572)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -123,6 +123,7 @@
public static String DeleteManagedBeanHandler_Failure;
public static String DeleteManagedPropertyHandler_Delete;
public static String DeleteManagedPropertyHandler_DeleteJavaProperty;
+ public static String Create_JSF_2_Composition_Component;
static {
// load message values from bundle file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties 2010-04-21 08:38:08 UTC (rev 21572)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties 2010-04-21 08:46:06 UTC (rev 21573)
@@ -99,3 +99,4 @@
DeleteManagedBeanHandler_Failure=Failure
DeleteManagedPropertyHandler_Delete=Delete {0}
DeleteManagedPropertyHandler_DeleteJavaProperty=Delete java property
+Create_JSF_2_Composition_Component=Create JSF 2 composition component in a project resources folder
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,111 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2;
+
+import java.io.InputStream;
+import java.util.Scanner;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.validation.ValidationResult;
+import org.eclipse.wst.validation.ValidationState;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
+import org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ComponentParams;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ResourceUtil;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class JSF2ComponentsValidator extends Validator {
+
+ private IKbProject kbProject;
+ private IFile file;
+
+ @Override
+ public ValidationResult validate(IResource resource, int kind,
+ ValidationState state, IProgressMonitor monitor) {
+ ValidationResult result = new ValidationResult();
+ if (resource instanceof IFile) {
+ IFile file = (IFile) resource;
+ if (!isValidate(file)) {
+ return result;
+ }
+ IProject project = file.getProject();
+ kbProject = KbProjectFactory.getKbProject(project, false);
+ if (kbProject != null) {
+ this.file = file;
+ return super.validate(resource, kind, state, monitor);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public ValidationReport validate(String uri, InputStream inputstream,
+ NestedValidatorContext context, ValidationResult result) {
+ JSF2Validator validator = JSF2Validator.getInstance();
+ return validator.validate(file, uri);
+ }
+
+ protected boolean isValidate(IFile file) {
+ boolean isValidate = false;
+ try {
+ InputStream is = file.getContents();
+ Scanner scanner = new Scanner(is);
+ while (scanner.hasNextLine()) {
+ if (scanner.nextLine().indexOf(
+ JSF2ResourceUtil.JSF2_URI_PREFIX) != -1) {
+ isValidate = true;
+ scanner.close();
+ break;
+ }
+ }
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
+ return isValidate;
+ }
+
+ @Override
+ protected void addInfoToMessage(ValidationMessage validationMessage,
+ IMessage message) {
+ Object[] args = validationMessage.getMessageArguments();
+ if (args == null) {
+ return;
+ }
+ for (int i = 0; i < args.length; i++) {
+ if (args[i] instanceof JSF2ComponentParams) {
+ message
+ .setAttribute(
+ JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
+ ((JSF2ComponentParams) args[i])
+ .getRelativateLocation());
+ break;
+ }
+ }
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ValidationInfo.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ValidationInfo.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ValidationInfo.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,29 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2;
+
+import org.eclipse.wst.xml.core.internal.validation.XMLValidationInfo;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class JSF2ValidationInfo extends XMLValidationInfo{
+
+ public JSF2ValidationInfo(String uri) {
+ super(uri);
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2Validator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2Validator.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2Validator.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,155 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ComponentParams;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ComponentsUtil;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ResourceUtil;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.PageContextFactory;
+import org.jboss.tools.jst.web.kb.internal.XmlContextImpl;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class JSF2Validator {
+
+ public static String JSF2_PROBLEM_ID = JSFModelPlugin.PLUGIN_ID
+ + ".jsf2problemmarker"; //$NON-NLS-1$
+
+ private JSF2ValidationInfo validationInfo;
+ private IFile file;
+
+ private static JSF2Validator instance = new JSF2Validator();
+
+ public ValidationReport validate(IFile file, String uri) {
+ validationInfo = new JSF2ValidationInfo(uri);
+ this.file = file;
+ validate(file);
+ return validationInfo;
+ }
+
+ private JSF2Validator() {
+
+ }
+
+ public static JSF2Validator getInstance() {
+ return instance;
+ }
+
+ private void validate(IFile file) {
+ ELContext elContext = PageContextFactory.createPageContext(file);
+ if (elContext instanceof IPageContext) {
+ validateAsDOM(file);
+ } else if (elContext instanceof XmlContextImpl) {
+ if ("xhtml".equals(file.getFileExtension())) { //$NON-NLS-1$
+ validateAsDOM(file);
+ }
+ }
+ }
+
+ private void validateAsDOM(IFile file) {
+ IDOMDocument document = getDocumentForFile(file);
+ if (document != null) {
+ Map<String, List<Element>> jsf2Components = JSF2ComponentsUtil
+ .findJSF2CompositeComponents(document);
+ createMarkers(jsf2Components);
+ }
+ }
+
+ private void createMarkers(Map<String, List<Element>> jsf2Components) {
+ Set<String> elementsNameSet = new HashSet<String>(0);
+ Collection<List<Element>> elementsCollection = jsf2Components.values();
+ for (List<Element> list : elementsCollection) {
+ if (list != null) {
+ for (Element element : list) {
+ if (!elementsNameSet.contains(element.getNodeName())) {
+ IDOMElement domElement = (IDOMElement) element;
+ createMarkerForElement(domElement);
+ elementsNameSet.add(element.getNodeName());
+ }
+ }
+ }
+ }
+ }
+
+ private void createMarkerForElement(IDOMElement domElement) {
+ if (!JSF2ResourceUtil.isJSF2CompositeComponentExists(file.getProject(),
+ domElement)) {
+ int line = ((IDOMDocument) domElement.getOwnerDocument())
+ .getStructuredDocument().getLineOfOffset(
+ domElement.getStartOffset());
+ validationInfo.addWarning(createWarningMessage(domElement),
+ line + 1, 0, validationInfo.getFileURI(), null,
+ new Object[] { JSF2ComponentParams.create(domElement) });
+ }
+ }
+
+ private String createWarningMessage(IDOMElement element) {
+ StringBuilder builder = new StringBuilder("Composite component "); //$NON-NLS-1$
+ String nodeName = element.getNodeName();
+ if (nodeName.lastIndexOf(':') != -1) {
+ nodeName = nodeName.substring(nodeName.lastIndexOf(':') + 1);
+ }
+ builder.append("\"" + nodeName + "\" "); //$NON-NLS-1$ //$NON-NLS-2$
+ builder.append("was not found in a project resources folder"); //$NON-NLS-1$
+ return builder.toString();
+ }
+
+ private IDOMDocument getDocumentForFile(IFile file) {
+ IDOMDocument document = null;
+ IModelManager manager = StructuredModelManager.getModelManager();
+ if (manager == null) {
+ return document;
+ }
+ IStructuredModel model = null;
+ try {
+ model = manager.getModelForRead(file);
+ if (model instanceof IDOMModel) {
+ IDOMModel domModel = (IDOMModel) model;
+ document = domModel.getDocument();
+ }
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ } catch (IOException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ } finally {
+ if (model != null) {
+ model.releaseFromRead();
+ }
+ }
+ return document;
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,47 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2.action;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.IMarkerResolutionGenerator;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.web.validation.jsf2.JSF2Validator;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ResourceUtil;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class JSF2ComponentResolutionGenerator implements
+ IMarkerResolutionGenerator {
+
+ public IMarkerResolution[] getResolutions(IMarker marker) {
+ try {
+ String markerType = marker.getType();
+ if (markerType == null
+ || !JSF2Validator.JSF2_PROBLEM_ID.equals(markerType)) {
+ return new IMarkerResolution[0];
+ }
+ if (marker.getAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY) == null) {
+ return new IMarkerResolution[0];
+ }
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
+ return new JSF2MarkerResolution[] { new JSF2MarkerResolution() };
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2MarkerResolution.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2MarkerResolution.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2MarkerResolution.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,82 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2.action;
+
+import java.util.Map;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.messages.JSFUIMessages;
+import org.jboss.tools.jsf.web.validation.jsf2.JSF2Validator;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ResourceUtil;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class JSF2MarkerResolution implements IMarkerResolution {
+
+ public String getLabel() {
+ return JSFUIMessages.Create_JSF_2_Composition_Component;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void run(final IMarker marker) {
+ try {
+ Map attrsMap = marker.getAttributes();
+ Object object = attrsMap
+ .get(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY);
+ final IFile createdFile = JSF2ResourceUtil
+ .createJSF2CompositeComponent(marker.getResource()
+ .getProject(), new Path((String) object));
+ marker.getResource().deleteMarkers(JSF2Validator.JSF2_PROBLEM_ID,
+ false, 1);
+ if (createdFile != null) {
+ IDE.openEditor(PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage(),
+ createdFile);
+ }
+ new Thread("JSF2 Validator") { //$NON-NLS-1$
+ public void run() {
+ SafeRunner.run(new SafeRunnable() {
+
+ public void run() throws Exception {
+ try {
+ ValidationFramework.getDefault().validate(
+ new IProject[] { marker.getResource()
+ .getProject() }, false, false,
+ new NullProgressMonitor());
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
+ }
+ });
+ };
+ }.start();
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentParams.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentParams.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentParams.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,62 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2.util;
+
+import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class JSF2ComponentParams {
+
+ private String relativeLocation;
+
+ private JSF2ComponentParams() {
+
+ }
+
+ public static JSF2ComponentParams create(IDOMElement element) {
+ JSF2ComponentParams componentParams = new JSF2ComponentParams();
+ if (element != null) {
+ ElementImpl elementImpl = (ElementImpl) element;
+ String nameSpaceURI = elementImpl.getNamespaceURI();
+ if (nameSpaceURI == null
+ || nameSpaceURI.indexOf(JSF2ResourceUtil.JSF2_URI_PREFIX) == -1) {
+ return null;
+ }
+ String nodeName = element.getNodeName();
+ if (nodeName.lastIndexOf(':') != -1) {
+ nodeName = nodeName.substring(nodeName.lastIndexOf(':') + 1);
+ }
+ String relativeLocation = nameSpaceURI.replaceFirst(
+ JSF2ResourceUtil.JSF2_URI_PREFIX, ""); //$NON-NLS-1$
+ componentParams.setRelativateLocation(relativeLocation
+ + "/" + nodeName + ".xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ }
+ return componentParams;
+ }
+
+ public void setRelativateLocation(String relativateLocation) {
+ this.relativeLocation = relativateLocation;
+ }
+
+ public String getRelativateLocation() {
+ return relativeLocation;
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentsUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentsUtil.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentsUtil.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,69 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class JSF2ComponentsUtil {
+
+ public static Map<String, List<Element>> findJSF2CompositeComponents(
+ IDOMDocument document) {
+ Map<String, List<Element>> elementsMap = new HashMap<String, List<Element>>(
+ 0);
+ findJSF2ChildCompositeComponents(document, elementsMap);
+ return elementsMap;
+ }
+
+ private static void findJSF2ChildCompositeComponents(Node node,
+ Map<String, List<Element>> elementsMap) {
+ if (node instanceof IDOMDocument) {
+ node = ((IDOMDocument) node).getDocumentElement();
+ findJSF2ChildCompositeComponents(node, elementsMap);
+ } else if (node instanceof ElementImpl) {
+ ElementImpl elementImpl = (ElementImpl) node;
+ String namespaceURI = elementImpl.getNamespaceURI();
+ if (namespaceURI != null
+ && namespaceURI
+ .startsWith(JSF2ResourceUtil.JSF2_URI_PREFIX)
+ && !namespaceURI.equals(JSF2ResourceUtil.JSF2_URI_PREFIX)) {
+ List<Element> elements = elementsMap.get(namespaceURI);
+ if (elements == null) {
+ elements = new ArrayList<Element>(0);
+ }
+ elements.add(elementImpl);
+ elementsMap.put(namespaceURI, elements);
+ }
+ NodeList children = node.getChildNodes();
+ if (children != null) {
+ for (int i = 0; i < children.getLength(); i++) {
+ findJSF2ChildCompositeComponents(children.item(i), elementsMap);
+ }
+ }
+ }
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ResourceUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ResourceUtil.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ResourceUtil.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,147 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2.util;
+
+import java.util.zip.ZipEntry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.jboss.tools.jsf.JSFModelPlugin;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class JSF2ResourceUtil {
+
+ public static final String JSF2_URI_PREFIX = "http://java.sun.com/jsf/composite"; //$NON-NLS-1$
+
+ public static final String COMPONENT_RESOURCE_PATH_KEY = "component_resource_path_key"; //$NON-NLS-1$
+
+ public static boolean isJSF2CompositeComponentExists(IProject project,
+ IDOMElement jsf2Element) {
+ ElementImpl elementImpl = (ElementImpl) jsf2Element;
+ String nameSpaceURI = elementImpl.getNamespaceURI();
+ if (nameSpaceURI == null || nameSpaceURI.indexOf(JSF2_URI_PREFIX) == -1) {
+ return false;
+ }
+ String nodeName = jsf2Element.getNodeName();
+ if (nodeName.lastIndexOf(':') != -1) {
+ nodeName = nodeName.substring(nodeName.lastIndexOf(':') + 1);
+ }
+ String relativeLocation = "/resources" + nameSpaceURI.replaceFirst( //$NON-NLS-1$
+ JSF2ResourceUtil.JSF2_URI_PREFIX, ""); //$NON-NLS-1$
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if (component != null) {
+ IVirtualFolder webRootFolder = component.getRootFolder().getFolder(
+ new Path("/")); //$NON-NLS-1$
+ IContainer folder = webRootFolder.getUnderlyingFolder();
+ IPath path = folder.getFullPath().append(relativeLocation).append(
+ "/" + nodeName + ".xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file.exists()) {
+ return true;
+ }
+ }
+ return searchInClassPath(project, "META-INF" + relativeLocation //$NON-NLS-1$
+ + "/" + nodeName + ".xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public static IFile createJSF2CompositeComponent(IProject project,
+ IPath resourceRelativePath) throws CoreException {
+ if (!project.exists()) {
+ return null;
+ }
+ if (!project.isAccessible()) {
+ try {
+ project.open(new NullProgressMonitor());
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
+ }
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if (component != null) {
+ IVirtualFolder webRootFolder = component.getRootFolder().getFolder(
+ new Path("/")); //$NON-NLS-1$
+ IContainer folder = webRootFolder.getUnderlyingFolder();
+ IFolder webFolder = ResourcesPlugin.getWorkspace().getRoot()
+ .getFolder(folder.getFullPath());
+ IFolder resourcesFolder = webFolder.getFolder("resources"); //$NON-NLS-1$
+ NullProgressMonitor monitor = new NullProgressMonitor();
+ if (!resourcesFolder.exists()) {
+ resourcesFolder.create(true, true, monitor);
+ }
+ String[] segments = resourceRelativePath.segments();
+ IFolder componentPathFolder = resourcesFolder;
+ for (int i = 0; i < segments.length - 1; i++) {
+ componentPathFolder = componentPathFolder
+ .getFolder(segments[i]);
+ if (!componentPathFolder.exists()) {
+ componentPathFolder.create(true, true, monitor);
+ }
+ }
+ IFile file = componentPathFolder
+ .getFile(segments[segments.length - 1]);
+ if (!file.exists()) {
+ file.create(JSF2TemplateManager.getManager()
+ .createStreamFromTemplate("composite.xhtml"), true, //$NON-NLS-1$
+ monitor);
+ }
+ return file;
+ }
+ return null;
+ }
+
+ private static boolean searchInClassPath(IProject project,
+ String classPathResource) {
+ IJavaProject javaProject = JavaCore.create(project);
+ try {
+ for (IPackageFragmentRoot fragmentRoot : javaProject
+ .getAllPackageFragmentRoots()) {
+ if (fragmentRoot instanceof JarPackageFragmentRoot) {
+ JarPackageFragmentRoot jarPackageFragmentRoot = (JarPackageFragmentRoot) fragmentRoot;
+ ZipEntry zipEntry = jarPackageFragmentRoot.getJar()
+ .getEntry(classPathResource);
+ if (zipEntry != null) {
+ return true;
+ }
+ }
+ }
+ } catch (JavaModelException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
+ return false;
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2TemplateManager.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2TemplateManager.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2TemplateManager.java 2010-04-21 08:46:06 UTC (rev 21573)
@@ -0,0 +1,41 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.web.validation.jsf2.util;
+
+import java.io.InputStream;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class JSF2TemplateManager {
+
+ private static JSF2TemplateManager instance = new JSF2TemplateManager();
+
+ private JSF2TemplateManager() {
+
+ }
+
+ public static JSF2TemplateManager getManager() {
+ return instance;
+ }
+
+ public InputStream createStreamFromTemplate(String templateName) {
+ InputStream stream = null;
+ stream = JSF2TemplateManager.class
+ .getResourceAsStream("/resources/templates/" + templateName); //$NON-NLS-1$
+ return stream;
+ }
+
+}
14 years, 8 months
JBoss Tools SVN: r21572 - in trunk/jst/tests/org.jboss.tools.ui.bot.ext: META-INF and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2010-04-21 04:38:08 -0400 (Wed, 21 Apr 2010)
New Revision: 21572
Added:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/resources/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/SeamBean.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJRE.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementNotFulfilledException.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/.classpath
trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Timing.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
Log:
SWTbot extensions : added custom annotation definitions testing purposes, now we can declaratively define runtime dependencies of SWTBot test classes
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/.classpath 2010-04-21 07:41:04 UTC (rev 21571)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/.classpath 2010-04-21 08:38:08 UTC (rev 21572)
@@ -3,5 +3,6 @@
<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="src" path="resources"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2010-04-21 07:41:04 UTC (rev 21571)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/META-INF/MANIFEST.MF 2010-04-21 08:38:08 UTC (rev 21572)
@@ -12,7 +12,6 @@
org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
org.hamcrest;bundle-version="1.1.0",
- org.junit4;bundle-version="4.5.0",
org.apache.log4j;bundle-version="1.2.13",
org.eclipse.datatools.connectivity;bundle-version="1.1.2",
org.eclipse.datatools.connectivity.db.generic;bundle-version="1.0.1",
@@ -20,11 +19,13 @@
org.eclipse.ui.ide;bundle-version="3.5.1",
org.jboss.tools.common.model,
org.jboss.tools.common.model.ui;bundle-version="3.1.0",
- org.eclipse.ui.forms;bundle-version="3.4.1"
+ org.eclipse.ui.forms;bundle-version="3.4.1",
+ org.junit4;bundle-version="4.5.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.apache.log4j
Export-Package: org.jboss.tools.ui.bot.ext,
+ org.jboss.tools.ui.bot.ext.config,
org.jboss.tools.ui.bot.ext.entity,
org.jboss.tools.ui.bot.ext.gen,
org.jboss.tools.ui.bot.ext.helper,
@@ -32,3 +33,4 @@
org.jboss.tools.ui.bot.ext.types,
org.jboss.tools.ui.bot.ext.view
Bundle-Vendor: JBoss by Red Hat
+Bundle-ClassPath: .
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,7 @@
+# SWTBotTest properties
+JAVA_HOME_15=/usr/java/jdk-1.5.0_12/jre
+JAVA_HOME_16=/opt/sun-jdk-1.6.0.19/jre
+# EAP|JBOSS_AS,<server version>,<jre version to run with>|default,<server home>
+SERVER=EAP,5.0,1.6,/data/jboss/jboss-eap-5.0/jboss-as
+#<seam version>,<seam runtime home>
+SEAM=2.2,/data/jboss/jboss-eap-5.0/seam
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/resources/SWTBotTest-default.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,58 @@
+ package org.jboss.tools.ui.bot.ext;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.junit.runner.Runner;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.Suite;
+import org.junit.runners.model.RunnerBuilder;
+
+/**
+ * JUnit4 requirement aware testsuite runner. If suite class is annotated by @ RunWith({@link RequirementAwareSuite}) class, test classes can have {@link SWTBotTestRequires} annotations
+ *
+ * @author lzoubek(a)redhat.com
+ */
+public class RequirementAwareSuite extends Suite {
+ private static final Logger log = Logger.getLogger(RequirementAwareSuite.class);
+ private class RequirementAwareRunnerBuilder extends RunnerBuilder {
+ @Override
+ public Runner runnerForClass(Class<?> klass) throws Throwable {
+ if (TestConfigurator.canRunClass(klass)) {
+ log.info("Returning runner for test class "+klass.getCanonicalName());
+ return new BlockJUnit4ClassRunner(klass);
+ }
+ log.info("Skipping test class "+klass.getCanonicalName());
+ return null;
+ }
+
+
+ }
+ private final ArrayList<Runner> runners = new ArrayList<Runner>();
+
+ /**
+ * Only called reflectively. Do not use programmatically.
+ */
+
+ /**
+ * Called reflectively on classes annotated with
+ * <code>@RunWith(RequirementAwareSuite.class)</code>
+ *
+ * @param klass
+ * the root class
+ */
+ public RequirementAwareSuite(Class<?> klass)
+ throws Throwable {
+ super(klass, Collections.<Runner> emptyList());
+ runners.add(new Suite(klass, new RequirementAwareRunnerBuilder()));
+
+ }
+ @Override
+ protected List<Runner> getChildren() {
+ return runners;
+ }
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/RequirementAwareSuite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-04-21 07:41:04 UTC (rev 21571)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -432,6 +432,48 @@
wiz.textWithLabel(ServerServer.TEXT_SERVER_NAME).setText(serverName);
open.finish(wiz);
}
+ /**
+ * adds seam runtime
+ * @param name of newly added runtime
+ * @param version seam version
+ * @param seamHome path to seam home directory
+ */
+ public void addSeamRuntime(String name, String version, String seamHome) {
+ SWTBot wiz = open.preferenceOpen(ActionItem.Preference.JBossToolsWebSeam.LABEL);
+ SWTBotTable tbRuntimeEnvironments = bot.table();
+ boolean createRuntime = true;
+ // first check if Environment doesn't exist
+ int numRows = tbRuntimeEnvironments.rowCount();
+ if (numRows > 0) {
+ int currentRow = 0;
+ while (createRuntime && currentRow < numRows) {
+ if (tbRuntimeEnvironments.cell(currentRow, 1).equalsIgnoreCase(
+ name)) {
+ createRuntime = false;
+ } else {
+ currentRow++;
+ }
+ }
+ }
+ if (createRuntime) {
+ wiz.button("Add").click();
+ bot.shell(IDELabel.Shell.NEW_SEAM_RUNTIME).activate();
+ bot.text(0).setText(seamHome);
+ bot.text(1).setText(name);
+ // find and select version
+ String[] versions = bot.comboBox().items();
+ int myIndex =0;
+ for (int index=0;index<versions.length;index++) {
+ if (version.equals(versions[index])) {
+ myIndex=index;
+ break;
+ }
+ }
+ bot.comboBox().setSelection(myIndex);
+ open.finish(bot.activeShell().bot());
+ open.finish(wiz, IDELabel.Button.OK);
+ }
+ }
/**
* adds jboss server runtime only if it's not specified yet
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2010-04-21 07:41:04 UTC (rev 21571)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTTestExt.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -10,15 +10,27 @@
******************************************************************************/
package org.jboss.tools.ui.bot.ext;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
import java.util.Properties;
+import java.util.Vector;
import org.apache.log4j.Logger;
import org.eclipse.swtbot.swt.finder.SWTBotTestCase;
+import org.jboss.tools.ui.bot.ext.config.ConfiguredState;
+import org.jboss.tools.ui.bot.ext.config.requirement.AddServer;
+import org.jboss.tools.ui.bot.ext.config.requirement.RequirementBase;
+import org.jboss.tools.ui.bot.ext.config.requirement.StartServer;
+import org.jboss.tools.ui.bot.ext.gen.IView;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.view.ConsoleView;
import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
import org.jboss.tools.ui.bot.ext.view.ServersView;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
/**
* Base class for SWTBot Tests using SWTBotExt
* @author jpeterka
@@ -40,6 +52,11 @@
public static final ProblemsView problems = new ProblemsView();
public static final ConsoleView console = new ConsoleView();
+ // config & state
+ public static final ConfiguredState configuredState = new ConfiguredState();
+ public static final List<RequirementBase> beforeRequirements = new Vector<RequirementBase>();
+ public static final List<RequirementBase> afterRequirements = new Vector<RequirementBase>();
+
public static Properties properties;
/**
* Get properties for hibernate tests
@@ -57,4 +74,32 @@
public static int TIME_5S = Timing.time5S();
public static int TIME_10S = Timing.time10S();
public static int TIME_20S = Timing.time20S();
+
+ /**
+ * fullfills given requirements
+ * @param requirements
+ */
+ @BeforeClass
+ public static void beforeTest() throws Exception {
+ // try to close Welcome view
+ open.viewClose(new IView(){
+ public List<String> getGroupPath() {
+ return new Vector<String>();
+ }
+ public String getName() {
+ return IDELabel.View.WELCOME;
+ }});
+ log.info("Fullfilling requirements before test");
+ for (RequirementBase r : beforeRequirements) {
+ r.fullfill();
+ }
+ }
+ @AfterClass
+ public static void afterTest() throws Exception {
+ log.info("Fullfilling requirements before test");
+ for (RequirementBase r : afterRequirements) {
+ r.fullfill();
+ }
+ }
+
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Timing.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Timing.java 2010-04-21 07:41:04 UTC (rev 21571)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Timing.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -36,4 +36,7 @@
public static int time(int milis) {
return (int) Math.round(milis*multiplier);
}
+ public static long time100S() {
+ return (int) Math.round(100*1000*multiplier);
+ }
}
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,92 @@
+package org.jboss.tools.ui.bot.ext.config;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+
+public class Annotations {
+ /**
+ * annotation which defines requirement of whole test Class
+ * by default all sub-annotations are optional and are
+ * @author lzoubek
+ *
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target(ElementType.TYPE)
+ public @interface SWTBotTestRequires {
+ /**
+ * optionally require server
+ */
+ Server server() default @Server( required = false );
+ Seam seam() default @Seam( required = false );
+ }
+ /**
+ * Server requirement, by default matches all server types and versions
+ * @author lzoubek
+ *
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Server {
+ /**
+ * true if Server is required (default)
+ * @return
+ */
+ boolean required() default true;
+ /**
+ * server type to match (Default ALL)
+ * @return
+ */
+ ServerType type() default ServerType.ALL;
+ /**
+ * version of required server (use * for all versions) default *
+ * @return
+ */
+ String version() default "*";
+ /**
+ * defines operator to match server version, possible values (=,<,>=<=,>=,!=) default =
+ * @return
+ */
+ String operator() default "=";
+ }
+ /**
+ *
+ * @author lzoubek(a)redhat.com
+ *
+ */
+ @Retention(RetentionPolicy.RUNTIME)
+ public @interface Seam {
+ /**
+ * true if Seam is required (default)
+ * @return
+ */
+ boolean required() default true;
+ /**
+ * version of required server (use * for all)
+ * @return
+ */
+ String version() default "*";
+ /**
+ * defines operator on server, possible values (=,<,>=<=,>=,!=) default =
+ * @return
+ */
+ String operator() default "=";
+
+ }
+ public enum ServerType {
+ /**
+ * EAP
+ */
+ EAP,
+ /**
+ * Jboss community version
+ */
+ JbossAS,
+ /**
+ * all server types acceptable
+ */
+ ALL
+ }
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/Annotations.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,81 @@
+package org.jboss.tools.ui.bot.ext.config;
+
+import java.util.List;
+import java.util.Vector;
+
+import org.jboss.tools.ui.bot.ext.config.requirement.RequirementBase;
+
+/**
+ * this class represents state of running test suite. Properties of this object should be changed only by
+ * classed extending {@link RequirementBase} class.
+ * @author lzoubek
+ *
+ */
+public class ConfiguredState {
+ private List<String> jreList = new Vector<String>();
+ private Server server = new Server();
+ private Seam seam = new Seam();
+
+ /**
+ * gets list of installed jre's (without the default one)
+ * @return
+ */
+ public List<String> getJreList() {
+ return jreList;
+ }
+ /**
+ * gets configured seam runtime
+ * @return
+ */
+ public Seam getSeam() {
+ return seam;
+ }
+ /**
+ * gets configured server state
+ * @return
+ */
+ public Server getServer() {
+ return server;
+ }
+ public class Server {
+ /**
+ * is server runtime & server added?
+ */
+ public boolean isConfigured=false;
+ /**
+ * is server running?
+ */
+ public boolean isRunning = false;
+ /**
+ * version of server
+ */
+ public String version=null;
+
+ /**
+ * type (EAP | JbossAS )
+ */
+ public String type=null;
+ /**
+ * name of added server/runtime
+ */
+ public String name = null;
+ /**
+ * version of java configured to server (1.5 or 1.6)
+ */
+ public String withJavaVersion=null;
+ }
+ public class Seam {
+ /**
+ * version of seam runtime
+ */
+ public String version=null;
+ /**
+ * is configured?
+ */
+ public boolean isConfiured=false;
+ /**
+ * name of added runtime
+ */
+ public String name=null;
+ }
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ConfiguredState.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/SeamBean.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/SeamBean.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/SeamBean.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,21 @@
+package org.jboss.tools.ui.bot.ext.config;
+
+
+public class SeamBean {
+
+ public String version;
+ public String seamHome;
+
+ public static SeamBean fromString(String propValue) throws Exception{
+ try {
+ String[] seamParams = propValue.split(",");
+ SeamBean bean = new SeamBean();
+ bean.seamHome=seamParams[1];
+ bean.version=seamParams[0];
+ return bean;
+ }
+ catch (Exception ex) {
+ throw new Exception("Cannot parse SEAM property line",ex);
+ }
+ }
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/SeamBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,40 @@
+package org.jboss.tools.ui.bot.ext.config;
+
+/**
+ *
+ * @author lzoubek
+ *
+ */
+public class ServerBean {
+
+ public String version;
+ public String runtimeHome;
+ public String withJavaVersion;
+ public ServerType type;
+
+ public enum ServerType {
+ EAP,
+ JBOSS_AS
+ }
+ /**
+ * creates bean instance from property string
+ * @param propValue property value
+ * @return
+ * @throws Exception
+ */
+ public static ServerBean fromString(String propValue) throws Exception {
+ try {
+ String[] serverParams = propValue.split(",");
+ ServerBean bean = new ServerBean();
+ bean.withJavaVersion = serverParams[2];
+ bean.runtimeHome=serverParams[3];
+ bean.version=serverParams[1];
+ bean.type = Enum.valueOf(ServerType.class, serverParams[0]);
+ return bean;
+ }
+ catch (Exception ex) {
+ throw new Exception("Cannot parse SERVER property line",ex);
+ }
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,183 @@
+package org.jboss.tools.ui.bot.ext.config;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.jboss.tools.ui.bot.ext.Activator;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.Annotations.*;
+import org.jboss.tools.ui.bot.ext.config.requirement.AddSeam;
+import org.jboss.tools.ui.bot.ext.config.requirement.RequirementBase;
+import org.jboss.tools.ui.bot.ext.config.requirement.StartServer;
+
+public class TestConfigurator {
+
+
+ public class Keys {
+ public static final String SERVER = "SERVER";
+ public static final String SEAM = "SEAM";
+ public static final String JAVA_HOME_15 = "JAVA_HOME_15";
+ public static final String JAVA_HOME_16 = "JAVA_HOME_16";
+ }
+
+ public class Values {
+ public static final String SERVER_TYPE_EAP = "EAP";
+ public static final String SERVER_TYPE_JBOSSAS = "JBOSS_AS";
+ public static final String SERVER_WITH_DEFAULT_JAVA = "default";
+ }
+
+ public static final String SWTBOT_TEST_PROPERTIES_FILE = "swtbot.test.properties.file";
+ private static Properties swtTestProperties = new Properties();
+ public static ServerBean server;
+ public static SeamBean seam;
+ static {
+ try {
+ // try to load from file first
+ String propFile = System.getProperty(SWTBOT_TEST_PROPERTIES_FILE,
+ null);
+ if (propFile != null && new File(propFile).exists()) {
+ try {
+ swtTestProperties.load(new FileInputStream(propFile));
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } else {
+ try {
+ swtTestProperties.load(new FileInputStream(SWTTestExt.util
+ .getResourceFile(Activator.PLUGIN_ID,
+ "/SWTBotTest-default.properties")));
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+
+ //properties got loaded
+ try {
+ server = ServerBean.fromString(getProperty(Keys.SERVER));
+ seam = SeamBean.fromString(getProperty(Keys.SEAM));
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * returns null when given Server annotation does not match global test configuration
+ * (e.g. Test wants Server type EAP but we are running on JbossAS)
+ * @param s Server annotation
+ * @return StartServer requirement otherwise
+ */
+ private static RequirementBase getServerRequirement(Server s) {
+ if (!s.required()) {
+ return null;
+ }
+ if (!s.type().equals(ServerType.ALL)) {
+ if (s.type().equals(ServerType.EAP) && !server.type.equals(ServerBean.ServerType.EAP)) {
+ return null;
+ }
+ if (s.type().equals(ServerType.JbossAS) && !server.type.equals(ServerBean.ServerType.JBOSS_AS)) {
+ return null;
+ }
+ }
+
+ if (!matches(server.version, s.operator(), s.version())) {
+ return null;
+ }
+ return new StartServer();
+ }
+ /**
+ * returns null when given Seam annotation does not match global test configuration
+ * (e.g. Test wants Seam version 2.2 but we are running on 1.2)
+ * @param s
+ * @return AddSeam requirement otherwise
+ */
+ private static RequirementBase getSeamRequirement(Seam s) {
+ if (!s.required()) {
+ return null;
+ }
+ if (!matches(seam.version, s.operator(), s.version())) {
+ return null;
+ }
+ return new AddSeam();
+ }
+ /**
+ * returns true, if given class (Test) can run, this is done by exploring class'es
+ * annotations (see {@link SWTBotTestRequires}
+ */
+ public static boolean canRunClass(Class<?> klass) {
+ SWTBotTestRequires requies = klass.getAnnotation(SWTBotTestRequires.class);
+ // all not annotated classes can run
+ if (requies==null) {
+ return true;
+ }
+ if (requies.server().required()) {
+ RequirementBase req = getServerRequirement(requies.server());
+ if (req==null) {
+ return false;
+ }
+ SWTTestExt.beforeRequirements.add(req);
+ }
+ if (requies.seam().required()) {
+ RequirementBase req = getSeamRequirement(requies.seam());
+ if (req==null) {
+ return false;
+ }
+ SWTTestExt.beforeRequirements.add(req);
+ }
+ return true;
+ }
+ /**
+ * implements comparison of 2 params by given operator (in this order)
+ * params are expected version strings (in form X.X or XX)
+ * if param1 or param2 is '*' true is returned
+ * @param param1
+ * @param operator (=,<,>=<=,>=,!=)
+ * @param param2
+ *
+ * @return
+ */
+ public static boolean matches(String param1,String operator,String param2) {
+ if ("*".equals(param1)||"*".equals(param2)) {
+ return true;
+ }
+ if ("=".equals(operator)) {
+ return param1.equals(param2);
+ }
+ if ("!=".equals(operator)) {
+ return !param1.equals(param2);
+ }
+ int ver1 = versionToNumber(param1);
+ int ver2 = versionToNumber(param2);
+ if (">".equals(operator)) {
+ return ver1 > ver2;
+ }
+ if (">=".equals(operator)) {
+ return ver1 >= ver2;
+ }
+ if ("<".equals(operator)) {
+ return ver1 < ver2;
+ }
+ if ("<=".equals(operator)) {
+ return ver1 <= ver2;
+ }
+ return false;
+ }
+ private static int versionToNumber(String version) {
+ return Integer.parseInt(version.replaceAll("\\.", ""));
+ }
+ public static String getProperty(String key) {
+ return swtTestProperties.getProperty(key);
+ //return SWTTestExt.util.getValue(swtTestProperties, key);
+ }
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJRE.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJRE.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJRE.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,48 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+
+import static org.junit.Assert.fail;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
+/**
+ * adds JRE among Installed JRE's
+ * @author lzoubek
+ *
+ */
+public class AddJRE extends RequirementBase {
+
+ private final String version;
+ /**
+ * requirement for adding JRE
+ * @param version to add
+ */
+ public AddJRE(String version) {
+ this.version = version;
+ }
+ @Override
+ public boolean checkFullfilled() {
+ return SWTTestExt.configuredState.getJreList().contains(getAddedAsName());
+ }
+
+ @Override
+ public void handle(){
+ SWTTestExt.eclipse.addJavaVM(getAddedAsName(), getJavaHome());
+ SWTTestExt.configuredState.getJreList().add(getAddedAsName());
+ }
+ public String getAddedAsName() {
+ return "JRE-"+version;
+ }
+ private String getJavaHome() {
+ if ("1.5".equals(version)) {
+ return TestConfigurator.getProperty(TestConfigurator.Keys.JAVA_HOME_15);
+ }
+ if ("1.6".equals(version)) {
+ return TestConfigurator.getProperty(TestConfigurator.Keys.JAVA_HOME_16);
+ }
+ failParsing();
+ return null;
+ }
+ private void failParsing() {
+ fail("Unable to add JRE runtime, unsupported verson :"+version);
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddJRE.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,22 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
+
+public class AddSeam extends RequirementBase {
+
+ @Override
+ public boolean checkFullfilled() {
+ return SWTTestExt.configuredState.getSeam().isConfiured;
+ }
+
+ @Override
+ public void handle() {
+ String seamName = "Seam-"+TestConfigurator.seam.version;
+ SWTTestExt.eclipse.addSeamRuntime(seamName, TestConfigurator.seam.version, TestConfigurator.seam.seamHome);
+ SWTTestExt.configuredState.getSeam().isConfiured=true;
+ SWTTestExt.configuredState.getSeam().name=seamName;
+ SWTTestExt.configuredState.getSeam().version=TestConfigurator.seam.version;
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddSeam.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,95 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+
+import static org.junit.Assert.fail;
+
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
+import org.jboss.tools.ui.bot.ext.gen.IServer;
+import org.jboss.tools.ui.bot.ext.gen.IServerRuntime;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossCommunityJBossAS42;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossCommunityJBossAS50;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform43;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.Server.JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform50;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossCommunityJBoss42Runtime;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossCommunityJBoss50Runtime;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform43Runtime;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.ServerRuntime.JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform50Runtime;
+/**
+ * adds server (version and type depends on {@link TestConfigurator#server}
+ * @author lzoubek
+ *
+ */
+public class AddServer extends RequirementBase {
+
+ private String javaName=null;
+ public AddServer() {
+ String javaVer = getNeededJavaVersion(TestConfigurator.server.withJavaVersion);
+ if (javaVer!=null) {
+ AddJRE addJava = new AddJRE(javaVer);
+ getDependsOn().add(addJava);
+ javaName=addJava.getAddedAsName();
+ }
+
+ }
+
+ @Override
+ public void handle() {
+ ServerInfo serverInfo = getRuntime(TestConfigurator.server.type.toString(),TestConfigurator.server.version);
+ String runtimeHome=TestConfigurator.server.runtimeHome;
+ String runtimeName=TestConfigurator.server.type.toString()+"-"+TestConfigurator.server.version;
+ SWTTestExt.eclipse.addJbossServerRuntime(serverInfo.runtime,
+ runtimeHome, runtimeName, javaName);
+ SWTTestExt.eclipse.addServer(serverInfo.server, runtimeName);
+ SWTTestExt.configuredState.getServer().isConfigured=true;
+ SWTTestExt.configuredState.getServer().name=runtimeName;
+ SWTTestExt.configuredState.getServer().version=TestConfigurator.server.version;
+ SWTTestExt.configuredState.getServer().type=TestConfigurator.server.type.toString();
+ }
+
+
+ class ServerInfo {
+ public ServerInfo(IServerRuntime runtime,IServer server) {
+ this.runtime=runtime;
+ this.server=server;
+ }
+ public IServerRuntime runtime;
+ public IServer server;
+ }
+ private String getNeededJavaVersion(String javaVer) {
+ if (TestConfigurator.Values.SERVER_WITH_DEFAULT_JAVA.equals(javaVer)) {
+ return null;
+ }
+ else {return javaVer;}
+
+ }
+ private ServerInfo getRuntime(String serverType, String version) {
+ if (TestConfigurator.Values.SERVER_TYPE_EAP.equals(serverType)) {
+ if ("4.3".equals(version)) {
+ return new ServerInfo(JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform43Runtime.LABEL,
+ JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform43.LABEL
+ );
+ }
+ if ("5.0".equals(version)) {
+ return new ServerInfo(JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform50Runtime.LABEL,
+ JBossEnterpriseMiddlewareJBossEnterpriseApplicationPlatform50.LABEL);
+ }
+ } else if (TestConfigurator.Values.SERVER_TYPE_JBOSSAS.equals(serverType)) {
+ if ("4.2".equals(version)) {
+ return new ServerInfo(JBossCommunityJBoss42Runtime.LABEL,JBossCommunityJBossAS42.LABEL);
+ }
+ if ("5.0".equals(version)) {
+ return new ServerInfo(JBossCommunityJBoss50Runtime.LABEL,JBossCommunityJBossAS50.LABEL);
+ }
+ }
+ failParsing();
+ return null;
+ }
+ private void failParsing() {
+ fail("Unable to add server runtime, unparsable or not supported property value: "+TestConfigurator.getProperty(TestConfigurator.Keys.SERVER));
+ }
+ @Override
+ public boolean checkFullfilled() {
+ return SWTTestExt.configuredState.getServer().isConfigured;
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/AddServer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,60 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.log4j.Logger;
+/**
+ * An abstract class for all requirements
+ * @author lzoubek
+ *
+ */
+public abstract class RequirementBase {
+ protected final Logger log = Logger.getLogger(this.getClass());
+ public RequirementBase() {
+ }
+
+ private List<RequirementBase> dependsOn;
+ /**
+ * gets the list of reqs on which this one depends
+ * @return
+ */
+ public List<RequirementBase> getDependsOn() {
+ if (dependsOn==null) {
+ dependsOn = new Vector<RequirementBase>();
+ }
+ return dependsOn;
+ }
+ /**
+ * fulfills this requirement. First fulfills the dependent ones, then this.
+ * @throws RequirementNotFulfilledException
+ */
+ public void fullfill() throws RequirementNotFulfilledException {
+ log.info("Fulfilling requirement '"+this.getClass().getName()+"'");
+ try {
+ for (RequirementBase dep : getDependsOn()) {
+ dep.fullfill();
+ }
+ if (!checkFullfilled()) {
+ handle();
+ if (!checkFullfilled()) {
+ throw new Exception("Requirement implementation error, checkFullfilled failed after calling handle();");
+ }
+ }
+ } catch (Exception ex) {
+ throw new RequirementNotFulfilledException("Unable to fulfill requirement "+this.getClass().getCanonicalName(),ex);
+ }
+ log.info("Requirement '"+this.getClass().getName()+"' fulfilled");
+
+ }
+ /**
+ * must return true if the Requirement is already fulfilled
+ * @return
+ */
+ public abstract boolean checkFullfilled();
+ /**
+ * handles (should do everything to fulfill requirement), {@link RequirementBase#checkFullfilled()}
+ * should return true after calling this method
+ */
+ public abstract void handle();
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementNotFulfilledException.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementNotFulfilledException.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementNotFulfilledException.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,20 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+/**
+ * an excetion thrown when error occurs by fulfilling test requirements
+ * @author lzoubek
+ *
+ */
+public class RequirementNotFulfilledException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ public RequirementNotFulfilledException(String message, Throwable t) {
+ super(message,t);
+ }
+ public RequirementNotFulfilledException(String message) {
+ super(message);
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/RequirementNotFulfilledException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -0,0 +1,27 @@
+package org.jboss.tools.ui.bot.ext.config.requirement;
+
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+/**
+ * Starts server (as dependent requirement has {@link AddServer}
+ * @author lzoubek
+ *
+ */
+public class StartServer extends RequirementBase {
+
+ public StartServer() {
+ // define dependency
+ getDependsOn().add(new AddServer());
+ }
+
+ @Override
+ public boolean checkFullfilled() {
+ return SWTTestExt.configuredState.getServer().isRunning;
+ }
+
+ @Override
+ public void handle(){
+ SWTTestExt.servers.startServer(SWTTestExt.configuredState.getServer().name);
+ SWTTestExt.configuredState.getServer().isRunning = true;
+
+ }
+}
Property changes on: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/requirement/StartServer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-04-21 07:41:04 UTC (rev 21571)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -110,6 +110,7 @@
public static final String WARNING = "Warning";
public static final String DROOLS_RUNTIME = "Drools Runtime";
public static final String NEW_DROOLS_PROJECT = "";
+ public static final String NEW_SEAM_RUNTIME = "New Seam Runtime";
}
public class EntityGroup {
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2010-04-21 07:41:04 UTC (rev 21571)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ServersView.java 2010-04-21 08:38:08 UTC (rev 21572)
@@ -81,13 +81,14 @@
* @param serverName
*/
public void startServer(String serverName) {
+ show();
SWTBot bot = open.viewSelect(ServerServers.LABEL).bot();
SWTBotTree tree = bot.tree();
SWTBotTreeItem server = findServerByName(tree,serverName);
if (server!=null) {
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.START, false)).click();
- new SWTUtilExt(this).waitForNonIgnoredJobs();
+ new SWTUtilExt(this).waitForNonIgnoredJobs(Timing.time100S());
new SWTUtilExt(this).waitForAll(Timing.time3S());
}
14 years, 8 months
JBoss Tools SVN: r21571 - in trunk/as: tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-21 03:41:04 -0400 (Wed, 21 Apr 2010)
New Revision: 21571
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/DefectTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/wtp/CreateProjectOperationsUtility.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
Log:
JBIDE-6184 - fix plus test case
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2010-04-21 07:33:06 UTC (rev 21570)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2010-04-21 07:41:04 UTC (rev 21571)
@@ -82,6 +82,8 @@
}
public int getPublishType(int kind, int deltaKind, int modulePublishState) {
+ if( ServerBehaviourDelegate.ADDED == deltaKind )
+ return IJBossServerPublisher.FULL_PUBLISH;
if (ServerBehaviourDelegate.REMOVED == deltaKind) {
return IJBossServerPublisher.REMOVE_PUBLISH;
} else if (kind == IServer.PUBLISH_FULL || modulePublishState == IServer.PUBLISH_STATE_FULL || kind == IServer.PUBLISH_CLEAN ) {
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/DefectTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/DefectTest.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/defects/DefectTest.java 2010-04-21 07:41:04 UTC (rev 21571)
@@ -0,0 +1,121 @@
+package org.jboss.ide.eclipse.as.test.defects;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+import org.jboss.ide.eclipse.as.test.util.wtp.CreateProjectOperationsUtility;
+import org.jboss.ide.eclipse.as.test.util.wtp.JavaEEFacetConstants;
+import org.jboss.ide.eclipse.as.test.util.wtp.OperationTestCase;
+
+public class DefectTest extends TestCase {
+ public void testJBIDE6184_Odd_Republish_Error() throws Exception {
+ IDataModel dm = CreateProjectOperationsUtility.getEARDataModel("ear", "thatContent", null, null, JavaEEFacetConstants.EAR_5, true);
+ OperationTestCase.runAndVerify(dm);
+ IDataModel dyn1Model = CreateProjectOperationsUtility.getWebDataModel("d1", "ear", null, null, null, JavaEEFacetConstants.WEB_23, true);
+ OperationTestCase.runAndVerify(dyn1Model);
+ IDataModel dyn2Model = CreateProjectOperationsUtility.getWebDataModel("d2", "ear", null, null, null, JavaEEFacetConstants.WEB_23, true);
+ OperationTestCase.runAndVerify(dyn2Model);
+
+ // Create a temp server
+ IServer server = ServerRuntimeUtils.createMockServerWithRuntime(IJBossToolingConstants.SERVER_AS_50, "server1", "default");
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ wc.modifyModules(getModule(findProject("ear")), new IModule[]{}, new NullProgressMonitor());
+ server = wc.save(true, new NullProgressMonitor());
+ server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+
+ // verify
+ DeployableServer ds = (DeployableServer)server.loadAdapter(DeployableServer.class, new NullProgressMonitor());
+ String folder = ds.getDeployFolder();
+ IPath earPath = new Path(folder).append("ear.ear");
+ JBIDE6184EarHasDynProjs(earPath, true);
+
+ // undeploy
+ wc = server.createWorkingCopy();
+ wc.modifyModules(new IModule[]{}, getModule(findProject("ear")), new NullProgressMonitor());
+ server = wc.save(true, new NullProgressMonitor());
+ server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ assertFalse(earPath.toFile().exists());
+
+ final IProject projectA = findProject("d1");
+ Job deleteJob = new Job("delete d1") {
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ projectA.delete(true, new NullProgressMonitor());
+ } catch(CoreException ce) {
+ return ce.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ deleteJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
+ deleteJob.schedule();
+ while(deleteJob.getResult() == null ) {
+ // spin
+ Thread.sleep(1000);
+ }
+
+ // republish the ear
+ wc = server.createWorkingCopy();
+ wc.modifyModules(getModule(findProject("ear")), new IModule[]{}, new NullProgressMonitor());
+ server = wc.save(true, new NullProgressMonitor());
+ server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ JBIDE6184EarHasDynProjs(earPath, false);
+
+
+ // recreate the war
+ dyn1Model = CreateProjectOperationsUtility.getWebDataModel("d1", "ear", null, null, null, JavaEEFacetConstants.WEB_23, true);
+ OperationTestCase.runAndVerify(dyn1Model);
+ server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ JBIDE6184EarHasDynProjs(earPath, true);
+ }
+
+ protected void JBIDE6184EarHasDynProjs(IPath earPath, boolean d1Present ) {
+ assertTrue(earPath.toFile().exists());
+ assertTrue(earPath.append("META-INF").toFile().exists());
+ assertTrue(earPath.append("META-INF").append("application.xml").toFile().exists());
+ assertTrue(earPath.toFile().isDirectory());
+
+ if( d1Present ) {
+ assertTrue(earPath.append("d1.war").toFile().exists());
+ assertTrue(earPath.append("d1.war").append("WEB-INF").toFile().exists());
+ assertTrue(earPath.append("d1.war").append("META-INF").toFile().exists());
+ assertTrue(earPath.append("d1.war").append("META-INF").append("MANIFEST.MF").toFile().exists());
+ assertTrue(earPath.append("d1.war").append("WEB-INF").append("web.xml").toFile().exists());
+ } else {
+ assertFalse(earPath.append("d1.war").toFile().exists());
+ }
+
+ assertTrue(earPath.append("d2.war").toFile().exists());
+ assertTrue(earPath.append("d2.war").append("WEB-INF").toFile().exists());
+ assertTrue(earPath.append("d2.war").append("META-INF").toFile().exists());
+ assertTrue(earPath.append("d2.war").append("META-INF").append("MANIFEST.MF").toFile().exists());
+ assertTrue(earPath.append("d2.war").append("WEB-INF").append("web.xml").toFile().exists());
+
+
+ }
+
+ protected IModule[] getModule(IProject p) {
+ return new IModule[]{ServerUtil.getModule(p)};
+ }
+ protected IProject findProject(String name) {
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+ }
+}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/wtp/CreateProjectOperationsUtility.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/wtp/CreateProjectOperationsUtility.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/wtp/CreateProjectOperationsUtility.java 2010-04-21 07:41:04 UTC (rev 21571)
@@ -0,0 +1,620 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/*
+ * Created on Oct 27, 2003
+ *
+ * To change the template for this generated file go to Window>Preferences>Java>Code Generation>Code and
+ * Comments
+ */
+package org.jboss.ide.eclipse.as.test.util.wtp;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jst.j2ee.applicationclient.internal.creation.AppClientFacetProjectCreationDataModelProvider;
+import org.eclipse.jst.j2ee.earcreation.IEarFacetInstallDataModelProperties;
+import org.eclipse.jst.j2ee.ejb.project.operations.IEjbFacetInstallDataModelProperties;
+import org.eclipse.jst.j2ee.internal.ejb.project.operations.EjbFacetProjectCreationDataModelProvider;
+import org.eclipse.jst.j2ee.internal.project.facet.EARFacetProjectCreationDataModelProvider;
+import org.eclipse.jst.j2ee.internal.web.archive.operations.WebFacetProjectCreationDataModelProvider;
+import org.eclipse.jst.j2ee.jca.project.facet.ConnectorFacetProjectCreationDataModelProvider;
+import org.eclipse.jst.j2ee.jca.project.facet.IConnectorFacetInstallDataModelProperties;
+import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
+import org.eclipse.jst.j2ee.project.facet.IAppClientFacetInstallDataModelProperties;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetInstallDataModelProperties;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetProjectCreationDataModelProperties;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
+import org.eclipse.jst.j2ee.web.project.facet.IWebFacetInstallDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetInstallDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties.FacetDataModelMap;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+
+/**
+ * @author jsholl
+ * @author Ian Tewksbury (ictewksb(a)us.ibm.com)
+ *
+ * To change the template for this generated type comment go to Window>Preferences>Java>Code
+ * Generation>Code and Comments
+ */
+public class CreateProjectOperationsUtility {
+ private static final String APP_CLIENT_PROJ_12 = "myAppClient_12";
+ private static final String APP_CLIENT_PROJ_13 = "myAppClient_13";
+ private static final String APP_CLIENT_PROJ_14 = "myAppClient_14";
+ private static final String APP_CLIENT_PROJ_5 = "myAppClient_5";
+ private static final String APP_CLIENT_PROJ_6 = "myAppClient_6";
+
+ private static final String EJB_PROJ_11 = "myEJB_11";
+ private static final String EJB_PROJ_2 = "myEJB_2";
+ private static final String EJB_PROJ_21 = "myEJB_21";
+ private static final String EJB_PROJ_3 = "myEJB_3";
+ private static final String EJB_PROJ_31 = "myEJB_31";
+
+ private static final String WEB_PROJ_22 = "myWeb_22";
+ private static final String WEB_PROJ_23 = "myWeb_23";
+ private static final String WEB_PROJ_24 = "myWeb_24";
+ private static final String WEB_PROJ_25 = "myWeb_25";
+ private static final String WEB_PROJ_30 = "myWeb_30";
+
+ private static final String CONNECTOR_PROJ_1 = "myConnector_1";
+ private static final String CONNECTOR_PROJ_15 = "myConnector_15";
+
+ public void testEAR12_Defaults() throws Exception{
+ IDataModel dm = getEARDataModel("aEAR", null, null, null, JavaEEFacetConstants.EAR_12, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR13_Defaults() throws Exception{
+ IDataModel dm = getEARDataModel("bEAR", null, null, null, JavaEEFacetConstants.EAR_13, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR14_Defaults() throws Exception{
+ IDataModel dm = getEARDataModel("cEAR", null, null, null, JavaEEFacetConstants.EAR_14, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR50_Defaults() throws Exception{
+ IDataModel dm = getEARDataModel("dEAR", null, null, null, JavaEEFacetConstants.EAR_5, false);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+// public void testEAR60_Defaults() throws Exception{
+// IDataModel dm = getEARDataModel("eeEAR", null, null, null, JavaEEFacetConstants.EAR_6, false);
+// OperationTestCase.runAndVerify(dm);
+// }
+
+
+ public void testEAR12_ChangedContentDir() throws Exception{
+ IDataModel dm = getEARDataModel("eEAR", "whosContent", null, null, JavaEEFacetConstants.EAR_12, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR13_ChangedContentDir() throws Exception{
+ IDataModel dm = getEARDataModel("fEAR", "myContent", null, null, JavaEEFacetConstants.EAR_13, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR14_ChangedContentDir() throws Exception{
+ IDataModel dm = getEARDataModel("gEAR", "yourContent", null, null, JavaEEFacetConstants.EAR_14, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR50_ChangedContentDir() throws Exception{
+ IDataModel dm = getEARDataModel("hEAR", "ourContent", null, null, JavaEEFacetConstants.EAR_5, false);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+// public void testEAR60_ChangedContentDir() throws Exception{
+// IDataModel dm = getEARDataModel("iEAR", "herContent", null, null, JavaEEFacetConstants.EAR_6, false);
+// OperationTestCase.runAndVerify(dm);
+// }
+
+
+ public void testEAR12_WithDependencies() throws Exception{
+ IDataModel dm = getEARDataModel("zEAR", null, getJ2EEDependencyList_12(), getJavaDependencyList_12(), JavaEEFacetConstants.EAR_12, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR13_WithDependencies() throws Exception{
+ IDataModel dm = getEARDataModel("yEAR", null, getJ2EEDependencyList_13(), getJavaDependencyList_13(), JavaEEFacetConstants.EAR_13, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR14_WithDependencies() throws Exception{
+ IDataModel dm = getEARDataModel("xEAR", null, getJ2EEDependencyList_14(), getJavaDependencyList_14(), JavaEEFacetConstants.EAR_14, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR50_WithDependencies() throws Exception{
+ IDataModel dm = getEARDataModel("wEAR", null, getJ2EEDependencyList_5(), getJavaDependencyList_5(), JavaEEFacetConstants.EAR_5, false);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+// public void testEAR60_WithDependencies() throws Exception{
+// IDataModel dm = getEARDataModel("whyEAR", null, getJ2EEDependencyList_6(), getJavaDependencyList_6(), JavaEEFacetConstants.EAR_6, false);
+// OperationTestCase.runAndVerify(dm);
+// }
+
+
+ public void testEAR12_ChangedContentDir_WithDependencies() throws Exception{
+ IDataModel dm = getEARDataModel("zEAR", "myContent", getJ2EEDependencyList_12(), getJavaDependencyList_12(), JavaEEFacetConstants.EAR_12, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR13_ChangedContentDir_WithDependencies() throws Exception{
+ IDataModel dm = getEARDataModel("yEAR", "ourContent", getJ2EEDependencyList_13(), getJavaDependencyList_13(), JavaEEFacetConstants.EAR_13, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR14_ChangedContentDir_WithDependencies() throws Exception{
+ IDataModel dm = getEARDataModel("xEAR", "theirContent", getJ2EEDependencyList_14(), getJavaDependencyList_14(), JavaEEFacetConstants.EAR_14, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR50_ChangedContentDir_WithDependencies() throws Exception{
+ IDataModel dm = getEARDataModel("wEAR", "yourContent", getJ2EEDependencyList_5(), getJavaDependencyList_5(), JavaEEFacetConstants.EAR_5, false);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+// public void testEAR60_ChangedContentDir_WithDependencies() throws Exception{
+// IDataModel dm = getEARDataModel("xyzEAR", "hisContent", getJ2EEDependencyList_6(), getJavaDependencyList_6(), JavaEEFacetConstants.EAR_6, false);
+// OperationTestCase.runAndVerify(dm);
+// }
+
+
+ public void testEAR50_Defaults_WithDD() throws Exception{
+ IDataModel dm = getEARDataModel("myEAR", null, null, null, JavaEEFacetConstants.EAR_5, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+// public void testEAR60_Defaults_WithDD() throws Exception{
+// IDataModel dm = getEARDataModel("mineEAR", null, null, null, JavaEEFacetConstants.EAR_6, true);
+// OperationTestCase.runAndVerify(dm);
+// }
+
+
+ public void testEAR50_ChangedContentDir_WithDD() throws Exception{
+ IDataModel dm = getEARDataModel("yourEAR", "ourContent", null, null, JavaEEFacetConstants.EAR_5, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+// public void testEAR60_ChangedContentDir_WithDD() throws Exception{
+// IDataModel dm = getEARDataModel("thatEAR", "thatContent", null, null, JavaEEFacetConstants.EAR_6, true);
+// OperationTestCase.runAndVerify(dm);
+// }
+
+/*
+ public void testEAR50_WithDependencies_WithDD() throws Exception{
+ IDataModel dm = getEARDataModel("anEAR", null, getJ2EEDependencyList_5(), getJavaDependencyList_5(), JavaEEFacetConstants.EAR_5, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+
+ public void testEAR50_ChangedContentDir_WithDependencies_WithDD() throws Exception{
+ IDataModel dm = getEARDataModel("theirEAR", "gotContent", getJ2EEDependencyList_5(), getJavaDependencyList_5(), JavaEEFacetConstants.EAR_5, true);
+ OperationTestCase.runAndVerify(dm);
+ }
+*/
+
+
+
+
+ public static List getJ2EEDependencyList_12() throws Exception {
+ List dependencies = new ArrayList();
+ List<IDataModel> models = new ArrayList<IDataModel>();
+
+ models.add(getAppClientCreationDataModel(APP_CLIENT_PROJ_12, null, JavaEEFacetConstants.APP_CLIENT_12, true, true));
+
+ models.add(getEJBDataModel(EJB_PROJ_11, null, null, null, JavaEEFacetConstants.EJB_11, true));
+
+ models.add(getWebDataModel(WEB_PROJ_22, null, null, null, null, JavaEEFacetConstants.WEB_22, true));
+
+ for(int i = 0; i < models.size(); i++) {
+ OperationTestCase.runDataModel(models.get(i));
+ }
+
+ dependencies.addAll(Arrays.asList(JavaEEProjectUtilities.getAllProjects()));
+
+ return dependencies;
+ }
+
+ public static List getJavaDependencyList_12() {
+ return Collections.emptyList();
+ }
+
+
+ public static List getJ2EEDependencyList_13() throws Exception {
+ getJ2EEDependencyList_12();
+ List dependencies = new ArrayList();
+ List<IDataModel> models = new ArrayList<IDataModel>();
+
+ models.add(getAppClientCreationDataModel(APP_CLIENT_PROJ_13, null, JavaEEFacetConstants.APP_CLIENT_13, true, true));
+
+ models.add(getEJBDataModel(EJB_PROJ_2, null, null, null, JavaEEFacetConstants.EJB_2, true));
+
+ models.add(getWebDataModel(WEB_PROJ_23, null, null, null, null, JavaEEFacetConstants.WEB_23, true));
+
+ models.add(getConnectorDataModel(CONNECTOR_PROJ_1, null, null, JavaEEFacetConstants.CONNECTOR_1));
+
+ for(int i = 0; i < models.size(); i++) {
+ OperationTestCase.runDataModel(models.get(i));
+ }
+
+ dependencies.addAll(Arrays.asList(JavaEEProjectUtilities.getAllProjects()));
+
+ return dependencies;
+ }
+
+ public static List getJavaDependencyList_13() {
+ return Collections.emptyList();
+ }
+
+
+ public static List getJ2EEDependencyList_14() throws Exception {
+ getJ2EEDependencyList_13();
+ List dependencies = new ArrayList();
+
+ List<IDataModel> models = new ArrayList<IDataModel>();
+
+ models.add(getAppClientCreationDataModel(APP_CLIENT_PROJ_14, null, JavaEEFacetConstants.APP_CLIENT_14, true, true));
+
+ models.add(getEJBDataModel(EJB_PROJ_21, null, null, null, JavaEEFacetConstants.EJB_21, true));
+
+ models.add(getWebDataModel(WEB_PROJ_24, null, null, null, null, JavaEEFacetConstants.WEB_24, true));
+
+ for(int i = 0; i < models.size(); i++) {
+ OperationTestCase.runDataModel(models.get(i));
+ }
+
+ dependencies.addAll(Arrays.asList(JavaEEProjectUtilities.getAllProjects()));
+
+ return dependencies;
+ }
+
+ public static List getJavaDependencyList_14() {
+ return Collections.emptyList();
+ }
+
+ public static List getJ2EEDependencyList_5() throws Exception {
+ getJ2EEDependencyList_14();
+ List dependencies = new ArrayList();
+
+ List<IDataModel> models = new ArrayList<IDataModel>();
+
+ models.add(getAppClientCreationDataModel(APP_CLIENT_PROJ_5, null, JavaEEFacetConstants.APP_CLIENT_5, true, false));
+ models.add(getAppClientCreationDataModel(APP_CLIENT_PROJ_5 + "_WithDD", null, JavaEEFacetConstants.APP_CLIENT_5, true, true));
+
+ models.add(getEJBDataModel(EJB_PROJ_3, null, null, null, JavaEEFacetConstants.EJB_3, false));
+ models.add(getEJBDataModel(EJB_PROJ_3 + "_WithDD", null, null, null, JavaEEFacetConstants.EJB_3, true));
+
+ models.add(getWebDataModel(WEB_PROJ_25, null, null, null, null, JavaEEFacetConstants.WEB_25, false));
+ models.add(getWebDataModel(WEB_PROJ_25 + "_WithDD", null, null, null, null, JavaEEFacetConstants.WEB_25, true));
+
+ for(int i = 0; i < models.size(); i++) {
+ OperationTestCase.runDataModel(models.get(i));
+ }
+
+ dependencies.addAll(Arrays.asList(JavaEEProjectUtilities.getAllProjects()));
+
+ return dependencies;
+ }
+
+ /**
+ * Creates and returns an EJB Data Model with the given name and of the given version.
+ * Can also set the clientName to be different then the default.
+ * If earName is not null then AppClient will be added to the EAR with earName, and if appropriate
+ * with or without a deployment descriptor.
+ *
+ * @param projName name of the project to create
+ * @param clientName name of client jar to create, if NULL or earName is NULL then don't create one
+ * @param clientSourceFolder source folder for client, use default if value is NULL, ignored if clientName is NULL
+ * @param earName name of the EAR to add the project too, if NULL then don't add to an EAR
+ * @param version version of EJB to use
+ * @param createDD only used if version is JEE5, if true then create DD else don't
+ * @return an EJB Model with the appropriate properties set
+ */
+ public static IDataModel getEJBDataModel(String projName, String clientName, String clientSourceFolder, String earName, IProjectFacetVersion version, boolean createDD) {
+ IDataModel dm = DataModelFactory.createDataModel(new EjbFacetProjectCreationDataModelProvider());
+ dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, projName);
+
+ FacetDataModelMap facetMap = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
+ IDataModel facetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.EJB);
+ facetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, version);
+
+ if(earName != null) {
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR, true);
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, earName);
+
+ //only create client if given a client name, and is added to EAR
+ if(clientName != null) {
+ facetModel.setBooleanProperty(IEjbFacetInstallDataModelProperties.CREATE_CLIENT, true);
+ facetModel.setStringProperty(IEjbFacetInstallDataModelProperties.CLIENT_NAME, clientName);
+
+ //use default source folder unless different name is given
+ if(clientSourceFolder != null) {
+ facetModel.setStringProperty(IEjbFacetInstallDataModelProperties.CLIENT_SOURCE_FOLDER, clientSourceFolder);
+ }
+ }
+ } else {
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR, false);
+ }
+
+ facetModel.setBooleanProperty(IJ2EEFacetInstallDataModelProperties.GENERATE_DD, createDD);
+
+// if(version.equals(JavaEEFacetConstants.EJB_31))
+// {
+// IDataModel javaFacetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JAVA);
+// javaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, JavaEEFacetConstants.JAVA_6);
+// }
+// else{
+ IDataModel javaFacetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JAVA);
+ javaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, JavaEEFacetConstants.JAVA_5);
+// }
+
+
+ return dm;
+ }
+
+
+ /**
+ * Creates and returns an EJB Data Model with the given name and of the given version.
+ * Can also set the clientName to be different then the default, or choose not to have a client.
+ * If earName is not null then AppClient will be added to the EAR with earName, and if appropriate
+ * with or without a deployment descriptor.
+ *
+ * Created so EJB's could be created without clients.
+ *
+ * @param projName name of the project to create
+ * @param clientName name of client jar to create, if NULL or earName is NULL then don't create one
+ * @param clientSourceFolder source folder for client, use default if value is NULL, ignored if clientName is NULL
+ * @param earName name of the EAR to add the project too, if NULL then don't add to an EAR
+ * @param version version of EJB to use
+ * @param createClient if True and earName not NULL then create with client, else dont
+ * @param createDD only used if version is JEE5, if true then create DD else don't
+ * @return an EJB Model with the appropriate properties set
+ */
+ public static IDataModel getEJBDataModel(String projName, String clientName, String clientSourceFolder, String earName, IProjectFacetVersion version, boolean createCleint, boolean createDD) {
+ IDataModel dm = getEJBDataModel(projName, clientName, clientSourceFolder, earName, version, createDD);
+
+ FacetDataModelMap facetMap = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
+ IDataModel facetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.EJB);
+ facetModel.setBooleanProperty(IEjbFacetInstallDataModelProperties.CREATE_CLIENT, createCleint);
+
+ return dm;
+ }
+ public static List getJavaDependencyList_5() {
+ return Collections.emptyList();
+ }
+
+// public static List getJ2EEDependencyList_6() throws Exception {
+// getJ2EEDependencyList_5();
+// List dependencies = new ArrayList();
+//
+// List<IDataModel> models = new ArrayList<IDataModel>();
+//
+// models.add(AppClientProjectCreationOperationTest.getAppClientCreationDataModel(APP_CLIENT_PROJ_6, null, JavaEEFacetConstants.APP_CLIENT_6, true, false));
+// models.add(AppClientProjectCreationOperationTest.getAppClientCreationDataModel(APP_CLIENT_PROJ_6 + "_WithDD", null, JavaEEFacetConstants.APP_CLIENT_6, true, true));
+//
+// models.add(EJBProjectCreationOperationTest.getEJBDataModel(EJB_PROJ_31, null, null, null, JavaEEFacetConstants.EJB_31, false));
+// models.add(EJBProjectCreationOperationTest.getEJBDataModel(EJB_PROJ_31 + "_WithDD", null, null, null, JavaEEFacetConstants.EJB_31, true));
+//
+// models.add(WebProjectCreationOperationTest.getWebDataModel(WEB_PROJ_30, null, null, null, null, JavaEEFacetConstants.WEB_30, false));
+// models.add(WebProjectCreationOperationTest.getWebDataModel(WEB_PROJ_30 + "_WithDD", null, null, null, null, JavaEEFacetConstants.WEB_30, true));
+//
+// for(int i = 0; i < models.size(); i++) {
+// OperationTestCase.runDataModel(models.get(i));
+// }
+//
+// dependencies.addAll(Arrays.asList(JavaEEProjectUtilities.getAllProjects()));
+//
+// return dependencies;
+// }
+
+ public static List getJavaDependencyList_6() {
+ return Collections.emptyList();
+ }
+
+ /**
+ * Creates and returns an EAR Data Model with the given name and of the given version
+ *
+ * @param projName name of the project to create
+ * @param version version of EAR to use
+ * @param contentDir directory to store the content in, if NULL use default
+ * @param dependenciesJ2EE list of J2EE IProjects that this EAR depends on, ignored if NULL
+ * @param dependenciesJava list of Java IProjects that this EAR depends on, ignored if NULL
+ * @param createDD only used if version is JEE5, if true then create DD else don't
+ * @return an EAR Data Model with the appropriate properties set
+ */
+ public static IDataModel getEARDataModel(String projName, String contentDir, List dependenciesJ2EE, List dependenciesJava, IProjectFacetVersion version, boolean createDD) {
+ IDataModel dm = DataModelFactory.createDataModel(new EARFacetProjectCreationDataModelProvider());
+ dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, projName);
+
+ FacetDataModelMap factMap = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
+ IDataModel facetModel = (IDataModel) factMap.get(IEarFacetInstallDataModelProperties.ENTERPRISE_APPLICATION);
+ facetModel.setProperty(IFacetInstallDataModelProperties.FACET_VERSION, version);
+
+
+ if(contentDir != null) {
+ facetModel.setStringProperty(IEarFacetInstallDataModelProperties.CONTENT_DIR,contentDir);
+ }
+
+ if(dependenciesJ2EE != null) {
+ facetModel.setProperty(IEarFacetInstallDataModelProperties.J2EE_PROJECTS_LIST, dependenciesJ2EE);
+ }
+
+ if(dependenciesJava != null) {
+ facetModel.setProperty(IEarFacetInstallDataModelProperties.JAVA_PROJECT_LIST, dependenciesJava);
+ }
+
+
+ facetModel.setBooleanProperty(IJ2EEFacetInstallDataModelProperties.GENERATE_DD, createDD);
+
+
+ return dm;
+ }
+
+
+ /**
+ * Creates and returns an Application Client Data Model with the given name and of the given version.
+ * If earName is not null then AppClient will be added to the EAR with earName, and if appropriate
+ * with or without a deployment descriptor.
+ *
+ * @param projName name of the project to create
+ * @param earName name of the ear to add the project too, if NULL then don't add to an EAR
+ * @param version version of Application Client to use
+ * @param createDefaultMainClass if true then create default main class, else don't
+ * @param createDD only used if version is JEE5, if true then create DD else don't
+ * @return an Application Data Model with the appropriate properties set
+ */
+ public static IDataModel getAppClientCreationDataModel(String projName, String earName, IProjectFacetVersion version, boolean createDefaultMainClass, boolean createDD){
+ IDataModel dm = DataModelFactory.createDataModel(new AppClientFacetProjectCreationDataModelProvider());
+ dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, projName);
+
+ if(earName != null) {
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR, true);
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, earName);
+ } else {
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR, false);
+ }
+
+ FacetDataModelMap facetMap = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
+ IDataModel facetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.APPLICATION_CLIENT);
+ facetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, version);
+ facetModel.setProperty(IAppClientFacetInstallDataModelProperties.CREATE_DEFAULT_MAIN_CLASS, createDefaultMainClass);
+
+
+ facetModel.setBooleanProperty(IJ2EEFacetInstallDataModelProperties.GENERATE_DD, createDD);
+
+// if(version.equals(JavaEEFacetConstants.APP_CLIENT_6))
+// {
+// IDataModel javaFacetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JAVA);
+// javaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, JavaEEFacetConstants.JAVA_6);
+// }
+// else{
+ IDataModel javaFacetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JAVA);
+ javaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, JavaEEFacetConstants.JAVA_5);
+// }
+
+ return dm;
+ }
+
+ /**
+ * Creates and returns a Web Data Model with the given name and of the given version.
+ * Can also be used to specify none default context root, content directory, and/or
+ * the java source directory.
+ * If earName is not null then Web will be added to the EAR with earName, and if appropriate
+ * with or without a deployment descriptor.
+ *
+ * @param projName name of the project to create
+ * @param earName name of the ear to add the project too, if NULL then don't add to an EAR
+ * @param contextRoot the context root to use for this project, use default if NULL
+ * @param contentDir the content directory to use for this project, use default if NULL
+ * @param javaSrcDir the java source directory to use for this project, use default if NULL
+ * @param version version of Web to use
+ * @param createDD only used if version is JEE5, if true then create DD else don't
+ * @return a Web Data Model with the appropriate properties set
+ */
+ public static IDataModel getWebDataModel(String projName, String earName, String contextRoot, String contentDir, String javaSrcDir, IProjectFacetVersion version, boolean createDD){
+ IDataModel dm = DataModelFactory.createDataModel(new WebFacetProjectCreationDataModelProvider());
+ dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, projName);
+
+ if(earName != null) {
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR, true);
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, earName);
+ } else {
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR, false);
+ }
+
+ FacetDataModelMap facetMap = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
+ IDataModel facetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.DYNAMIC_WEB);
+ facetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, version);
+
+ //if no contextRoot provided use default, contextRoot only matters if adding to EAR
+ if(contextRoot != null && earName != null) {
+ facetModel.setStringProperty(IWebFacetInstallDataModelProperties.CONTEXT_ROOT, contextRoot);
+ }
+
+ //if no contentDir provided use default
+ if(contentDir != null) {
+ facetModel.setStringProperty(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER, contentDir);
+ }
+
+ //if no javaSrcDir provided use default
+ if(javaSrcDir != null) {
+ facetModel.setStringProperty(IWebFacetInstallDataModelProperties.SOURCE_FOLDER, javaSrcDir);
+ }
+
+ facetModel.setBooleanProperty(IJ2EEFacetInstallDataModelProperties.GENERATE_DD, createDD);
+
+// if(version.equals(JavaEEFacetConstants.WEB_30)) {
+// IDataModel javaFacetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JAVA);
+// javaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, JavaEEFacetConstants.JAVA_6);
+// }
+// else{
+ IDataModel javaFacetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JAVA);
+ javaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, JavaEEFacetConstants.JAVA_5);
+// }
+
+ return dm;
+ }
+
+ /**
+ * Creates and returns an Connector Data Model with the given name and of the given version.
+ * If earName is not null then Connector will be added to the EAR with earName.
+ * Can also specify none default source folder
+ *
+ * @param projName name of the project to create
+ * @param earName name of the EAR to add the project too, if NULL then don't add to an EAR
+ * @param sourceFolder name of the source folder to use, if NULL then use default
+ * @param version version of Application Client to use
+ * @return a Connector Model with the appropriate properties set
+ */
+ public static IDataModel getConnectorDataModel(String projName, String earName, String sourceFolder, IProjectFacetVersion version){
+ IDataModel dm = DataModelFactory.createDataModel(new ConnectorFacetProjectCreationDataModelProvider());
+ dm.setProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME, projName);
+
+ if(earName != null) {
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR, true);
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.EAR_PROJECT_NAME, earName);
+ } else {
+ dm.setProperty(IJ2EEFacetProjectCreationDataModelProperties.ADD_TO_EAR, false);
+ }
+
+ FacetDataModelMap facetMap = (FacetDataModelMap) dm.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
+ IDataModel facetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JCA);
+ facetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, version);
+
+ if(sourceFolder != null) {
+ facetModel.setProperty(IConnectorFacetInstallDataModelProperties.CONFIG_FOLDER, sourceFolder);
+ }
+
+ //be sure to use Java5 with JEE5
+ if(version == JavaEEFacetConstants.CONNECTOR_15){
+ IDataModel javaFacetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JAVA);
+ javaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, JavaEEFacetConstants.JAVA_5);
+ }
+// else if(version == JavaEEFacetConstants.CONNECTOR_16) {
+// IDataModel javaFacetModel = facetMap.getFacetDataModel(IJ2EEFacetConstants.JAVA);
+// javaFacetModel.setProperty(IFacetDataModelProperties.FACET_VERSION, JavaEEFacetConstants.JAVA_6);
+// }
+
+ return dm;
+ }
+}
\ No newline at end of file
14 years, 8 months
JBoss Tools SVN: r21570 - in workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot: src/org/guvnor/tools/test/swtbot and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2010-04-21 03:33:06 -0400 (Wed, 21 Apr 2010)
New Revision: 21570
Added:
workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot/readme.txt
Modified:
workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot/src/org/guvnor/tools/test/swtbot/GuvnorSWTBotTest.java
Log:
change the swtbot test according the new patch for JBIDE-6165,
Added: workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot/readme.txt
===================================================================
--- workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot/readme.txt (rev 0)
+++ workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot/readme.txt 2010-04-21 07:33:06 UTC (rev 21570)
@@ -0,0 +1,3 @@
+to run the test, you have to set up "jbosstools.test.jboss.home.4.2" system property
+or change the default JBOSS_AS_42_HOME system property to an exist JBoss AS 4.2 home
+in your local test environment.
\ No newline at end of file
Modified: workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot/src/org/guvnor/tools/test/swtbot/GuvnorSWTBotTest.java
===================================================================
--- workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot/src/org/guvnor/tools/test/swtbot/GuvnorSWTBotTest.java 2010-04-21 06:06:42 UTC (rev 21569)
+++ workspace/Denny/swtbot_test/org.guvnor.tools.test.swtbot/src/org/guvnor/tools/test/swtbot/GuvnorSWTBotTest.java 2010-04-21 07:33:06 UTC (rev 21570)
@@ -1,6 +1,8 @@
package org.guvnor.tools.test.swtbot;
+import static org.eclipse.swtbot.swt.finder.SWTBotAssert.assertEnabled;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -10,6 +12,8 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
@@ -116,14 +120,15 @@
bot.viewByTitle("Servers").show();
// bot.shell("Servers").activate();
- bot.tree().select(0).contextMenu("Start").click();
+ SWTBotTree serverTree = bot.tree();
+ serverTree.select(0).contextMenu("Start").click();
String treeItem = "";
int i = 0;
- while(treeItem.indexOf("Started") < 0 && i < 60){
+ while(treeItem.indexOf("Started") < 0 && i < 120){
bot.sleep(2000);
bot.viewByTitle("Servers").show();
- treeItem = bot.tree().getAllItems()[0].getText();
+ treeItem = serverTree.getAllItems()[0].getText();
// System.out.println(treeItem);
i ++;
@@ -194,25 +199,57 @@
bot.activeShell().activate();
bot.tabItem(1).activate();
- assertTrue("The 'User' text is not enabled", bot.text(0).isEnabled());
+// assertTrue("The 'User' text is not enabled", bot.text(0).isEnabled());
- String newUserName = "admin_new";
- String newPwd = "passsword_new";
- bot.text(0).setText(newUserName);
- bot.text(1).setText(newPwd);
+// String newUserName = "admin_new";
+// String newPwd = "passsword_new";
+ bot.getDisplay().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ assertEquals(bot.getDisplay().getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND), bot.text(0).backgroundColor());
+ assertEquals(bot.getDisplay().getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND), bot.text(1).backgroundColor());
+ assertEnabled(bot.text(0));
+ assertEnabled(bot.text(1));
+
+ assertFalse(bot.text(0).widget.getEditable());
+ assertFalse(bot.text(1).widget.getEditable());
+ }
+ });
+
+// assertFalse("The User name text box should be enabled", bot.text(0).isEnabled());
+// assertFalse("The Password text box should be enabled", bot.text(1).isEnabled());
+// bot.text(0).setText(newUserName);
+
+// bot.text(1).setText(newPwd);
+
bot.button("OK").click();
- //open properties page to verify the previous changes
+// //open properties page to verify the previous changes
+//
+// tree.select(0).contextMenu("Properties").click();
+// bot.activeShell().activate();
+// bot.tabItem(1).activate();
+// assertEquals("Failed to update User Name", newUserName, bot.text(0).getText());
+// assertEquals("Failed to update Password", newPwd, bot.text(1).getText());
- tree.select(0).contextMenu("Properties").click();
- bot.activeShell().activate();
- bot.tabItem(1).activate();
- assertEquals("Failed to update User Name", newUserName, bot.text(0).getText());
- assertEquals("Failed to update Password", newPwd, bot.text(1).getText());
-
bot.sleep(10000);
}
+ private SWTBotTree findTreeByItem(String label){
+ SWTBotTree tree = bot.tree();
+ for( int i = 0; i < 100; i++){
+ tree = bot.tree(i);
+ if(tree.getAllItems().length > 0){
+ SWTBotTreeItem item = tree.getAllItems()[0];
+ if(item.getText() != null && item.getText().indexOf(label) > 0){
+ break;
+ }
+ }
+ }
+
+ return tree;
+ }
}
14 years, 8 months
JBoss Tools SVN: r21569 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-21 02:06:42 -0400 (Wed, 21 Apr 2010)
New Revision: 21569
Modified:
branches/modular_build/build.xml
Log:
disable deploy task for now
Modified: branches/modular_build/build.xml
===================================================================
--- branches/modular_build/build.xml 2010-04-21 03:40:25 UTC (rev 21568)
+++ branches/modular_build/build.xml 2010-04-21 06:06:42 UTC (rev 21569)
@@ -1,9 +1,10 @@
<!-- Build a given list of ${COMPONENTS} -->
-<project default="run" basedir=".">
+<project default="run" basedir="." name="jbosstools build.xml">
<!-- Configuration Start -->
<!-- must set name of component to build/test -->
- <property name="COMPONENTS" value="tests,common" />
+ <!-- <property name="COMPONENTS" value="tests,common" /> -->
+ <property name="COMPONENTS" value="tests, common, flow, jbpm, jmx, archives, as, drools, bpel, smooks, freemarker, profiler, portlet, xulrunner, jst, vpe, jsf, esb, tptp, ws, cdi, struts, seam, examples, birt, maven, hibernatetools" />
<!-- default maven version -->
<property name="maven.version" value="3.0-alpha-7" />
@@ -18,8 +19,8 @@
cd /home/nboldt/workspace36/jbosstools-modular_build; ant -DCOMPONENTS=tests,common
-->
- <target name="run" depends="init, genpoms, install, deploy" />
-
+ <target name="run" depends="init, genpoms, install" />
+
<!-- override for local build -->
<condition property="isInHudson" value="true">
<or>
@@ -82,6 +83,7 @@
<for param="COMPONENT" list="${COMPONENTS}" delimiter=",
">
<sequential>
+ <!-- TODO: check if poms exist already; if not, generate; if so, use existing -->
<ant antfile="genpom.xml" target="run">
<property name="COMPONENT" value="@{COMPONENT}" />
</ant>
@@ -119,8 +121,86 @@
</target>
+ <target name="test.deploy" depends="init">
+ <antcall target="deploy">
+ <param name="targetZipsDir" value="tools@filemgmt.jboss.org:/downloads_htdocs/tools/repository/" />
+ </antcall>
+ </target>
<target name="deploy">
- <!-- TODO enable publishing to download.jboss.org or porkchop.jboss.com
+ <!-- TODO enable publishing to download.jboss.org or porkchop.jboss.com -->
+ <property name="DESTINATION.jbosstools" value="filemgmt.jboss.org/downloads_htdocs/tools/repository/" />
+ <property name="DESTINATION.jbds" value="/qa/services/http/binaries/RHDS/repository/" />
+
+ <echo level="debug">Promote build in ${sourceZipsDirActual} ...</echo>
+ <for param="aDir" list="${sourceZipsDirActual}" delimiter=",
+">
+ <sequential>
+ <!-- rsync or copy build dir @{aDir} into ${targetZipsDir}/ -->
+ <if>
+ <available file="/usr/bin/rsync" type="file" />
+ <then>
+ <var name="rsyncCmd"
+ value="/usr/bin/rsync -a${synchMethodParam} --exclude=eclipse/ @{aDir} ${targetZipsDir}/"
+ />
+ <echo message="${rsyncCmd}" />
+ <exec executable="bash">
+ <arg line=" -c "${rsyncCmd}"" />
+ </exec>
+ <var name="rsyncCmd" unset="true" />
+ </then>
+ <else>
+ <propertyregex override="true"
+ property="aBuildDir"
+ defaultvalue="@{aDir}"
+ input="@{aDir}"
+ regexp=".+/([^/]+)"
+ replace="\1"
+ />
+ <echo>Copy ${aBuildDir} into ${targetZipsDir}/</echo>
+ <mkdir dir="${targetZipsDir}/${aBuildDir}" />
+ <copy todir="${targetZipsDir}/${aBuildDir}"
+ includeemptydirs="true"
+ preservelastmodified="true"
+ failonerror="true"
+ >
+ <fileset dir="@{aDir}" excludes="eclipse/" />
+ </copy>
+ </else>
+ </if>
+
+ <!-- unpack update zip(s) -->
+ <if>
+ <and>
+ <isset property="targetUpdateDir" />
+ <not>
+ <equals arg1="${targetUpdateDir}" arg2="" />
+ </not>
+ </and>
+ <then>
+ <for param="anUpdateZip">
+ <path>
+ <fileset dir="@{aDir}" includes="*-Update-*.zip" />
+ </path>
+ <sequential>
+ <unzip dest="${targetUpdateDir}/"
+ src="@{anUpdateZip}"
+ overwrite="${unzipMethodParam}"
+ />
+ <for param="subdir">
+ <path>
+ <dirset dir="${targetUpdateDir}/" />
+ </path>
+ <sequential>
+ <copy file="staticDropFiles/index.php" todir="@{subdir}" />
+ </sequential>
+ </for>
+ </sequential>
+ </for>
+ </then>
+ </if>
+ </sequential>
+ </for>
+ <!--
<get usetimestamp="true"
dest="${COMMON_TOOLS}/maven-ant-tasks-2.1.0.jar"
src="${MAVEN_MIRROR}/maven-ant-tasks-2.1.0.jar"
@@ -131,9 +211,10 @@
</classpath>
</taskdef>
<install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
- <deploy file="target/my-project-1.0.jar">
- <remoteRepository url="scp://localhost/www/repository">
- <authentication username="${repository.username}" privateKey="${user.home}/.ssh/id_dsa" />
+ <deploy>
+
+ <remoteRepository url="scp://${DESTINATION}">
+ <authentication username="tools" privateKey="${user.home}/.ssh/id_rsa" />
</remoteRepository>
<pom refid="mypom" />
</deploy>
14 years, 8 months
JBoss Tools SVN: r21568 - in branches/modular_build/xulrunner: features and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-20 23:40:25 -0400 (Tue, 20 Apr 2010)
New Revision: 21568
Modified:
branches/modular_build/xulrunner/features/org.mozilla.xpcom.feature/pom.xml
branches/modular_build/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml
branches/modular_build/xulrunner/features/pom.xml
branches/modular_build/xulrunner/plugins/org.mozilla.xpcom/
branches/modular_build/xulrunner/plugins/org.mozilla.xpcom/pom.xml
branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.carbon.macosx/pom.xml
branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.cocoa.macosx/pom.xml
branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.gtk.linux.x86/pom.xml
branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.gtk.linux.x86_64/pom.xml
branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.win32.win32.x86/pom.xml
branches/modular_build/xulrunner/plugins/pom.xml
branches/modular_build/xulrunner/pom.xml
branches/modular_build/xulrunner/site/pom.xml
Log:
regenerate poms to fix indents and artifactId values
Modified: branches/modular_build/xulrunner/features/org.mozilla.xpcom.feature/pom.xml
===================================================================
--- branches/modular_build/xulrunner/features/org.mozilla.xpcom.feature/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/features/org.mozilla.xpcom.feature/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -7,9 +7,8 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools</groupId>
<artifactId>org.mozilla.xpcom.feature</artifactId>
- <version>1.9.1.2a</version>
- <packaging>eclipse-feature</packaging>
+ <version>1.9.1.2a</version>
+ <packaging>eclipse-feature</packaging>
</project>
-
Modified: branches/modular_build/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml
===================================================================
--- branches/modular_build/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/features/org.mozilla.xulrunner.feature/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -7,9 +7,8 @@
<artifactId>org.jboss.tools.parent.pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
- <groupId>org.jboss.tools</groupId>
+ <groupId>org.jboss.tools</groupId>
<artifactId>org.mozilla.xulrunner.feature</artifactId>
- <version>1.9.1.2</version>
- <packaging>eclipse-feature</packaging>
+ <version>1.9.1.2</version>
+ <packaging>eclipse-feature</packaging>
</project>
-
Modified: branches/modular_build/xulrunner/features/pom.xml
===================================================================
--- branches/modular_build/xulrunner/features/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/features/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -2,18 +2,18 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <relativePath>../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>features.all</artifactId>
+ <artifactId>xulrunner.features</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
- <module>org.mozilla.xpcom.feature</module>
+ <module>org.mozilla.xpcom.feature</module>
<module>org.mozilla.xulrunner.feature</module>
</modules>
</project>
-
+
\ No newline at end of file
Property changes on: branches/modular_build/xulrunner/plugins/org.mozilla.xpcom
___________________________________________________________________
Name: svn:ignore
- target
+ target
bin
Modified: branches/modular_build/xulrunner/plugins/org.mozilla.xpcom/pom.xml
===================================================================
--- branches/modular_build/xulrunner/plugins/org.mozilla.xpcom/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/plugins/org.mozilla.xpcom/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -1,15 +1,14 @@
-<project
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <relativePath>../../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.mozilla.xpcom</artifactId>
- <version>1.9.1.2a</version>
- <packaging>eclipse-plugin</packaging>
-
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.mozilla.xpcom</artifactId>
+ <version>1.9.1.2a</version>
+ <packaging>eclipse-plugin</packaging>
</project>
Modified: branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.carbon.macosx/pom.xml
===================================================================
--- branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.carbon.macosx/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.carbon.macosx/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -1,33 +1,33 @@
-<project
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <relativePath>../../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.mozilla.xulrunner.carbon.macosx</artifactId>
- <version>1.9.1.2</version>
- <packaging>eclipse-plugin</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tychoVersion}</version>
- <configuration>
- <resolver>p2</resolver>
- <environments>
- <environment>
- <os>macosx</os>
- <ws>carbon</ws>
- <arch>x86</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.mozilla.xulrunner.carbon.macosx</artifactId>
+ <version>1.9.1.2</version>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <environments>
+ <environment>
+ <os>macosx</os>
+ <ws>carbon</ws>
+ <arch></arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.cocoa.macosx/pom.xml
===================================================================
--- branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.cocoa.macosx/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.cocoa.macosx/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -1,33 +1,33 @@
-<project
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <relativePath>../../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.mozilla.xulrunner.cocoa.macosx</artifactId>
- <version>1.9.1.2</version>
- <packaging>eclipse-plugin</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tychoVersion}</version>
- <configuration>
- <resolver>p2</resolver>
- <environments>
- <environment>
- <os>macosx</os>
- <ws>cocoa</ws>
- <arch>x86</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.mozilla.xulrunner.cocoa.macosx</artifactId>
+ <version>1.9.1.2</version>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <environments>
+ <environment>
+ <os>macosx</os>
+ <ws>cocoa</ws>
+ <arch></arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.gtk.linux.x86/pom.xml
===================================================================
--- branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.gtk.linux.x86/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.gtk.linux.x86/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -1,33 +1,33 @@
-<project
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <relativePath>../../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.mozilla.xulrunner.gtk.linux.x86</artifactId>
- <version>1.9.1.2</version>
- <packaging>eclipse-plugin</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tychoVersion}</version>
- <configuration>
- <resolver>p2</resolver>
- <environments>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.mozilla.xulrunner.gtk.linux.x86</artifactId>
+ <version>1.9.1.2</version>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <environments>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.gtk.linux.x86_64/pom.xml
===================================================================
--- branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.gtk.linux.x86_64/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.gtk.linux.x86_64/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -1,33 +1,33 @@
-<project
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <relativePath>../../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.mozilla.xulrunner.gtk.linux.x86_64</artifactId>
- <version>1.9.1.2a</version>
- <packaging>eclipse-plugin</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tychoVersion}</version>
- <configuration>
- <resolver>p2</resolver>
- <environments>
- <environment>
- <os>linux</os>
- <ws>gtk</ws>
- <arch>x86_64</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.mozilla.xulrunner.gtk.linux.x86_64</artifactId>
+ <version>1.9.1.2a</version>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <environments>
+ <environment>
+ <os>linux</os>
+ <ws>gtk</ws>
+ <arch>x86_64</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.win32.win32.x86/pom.xml
===================================================================
--- branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.win32.win32.x86/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/plugins/org.mozilla.xulrunner.win32.win32.x86/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -1,33 +1,33 @@
-<project
+<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <relativePath>../../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.mozilla.xulrunner.win32.win32.x86</artifactId>
- <version>1.9.1.2</version>
- <packaging>eclipse-plugin</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.tycho</groupId>
- <artifactId>target-platform-configuration</artifactId>
- <version>${tychoVersion}</version>
- <configuration>
- <resolver>p2</resolver>
- <environments>
- <environment>
- <os>win32</os>
- <ws>win32</ws>
- <arch>x86</arch>
- </environment>
- </environments>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.mozilla.xulrunner.win32.win32.x86</artifactId>
+ <version>1.9.1.2</version>
+ <packaging>eclipse-plugin</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <environments>
+ <environment>
+ <os>win32</os>
+ <ws>win32</ws>
+ <arch>x86</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: branches/modular_build/xulrunner/plugins/pom.xml
===================================================================
--- branches/modular_build/xulrunner/plugins/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/plugins/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -2,22 +2,22 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <relativePath>../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>plugins.all</artifactId>
+ <artifactId>xulrunner.plugins</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>org.mozilla.xpcom</module>
+ <module>org.mozilla.xulrunner.carbon.macosx</module>
<module>org.mozilla.xulrunner.cocoa.macosx</module>
+ <module>org.mozilla.xulrunner.gtk.linux.x86</module>
<module>org.mozilla.xulrunner.gtk.linux.x86_64</module>
- <module>org.mozilla.xulrunner.carbon.macosx</module>
- <module>org.mozilla.xulrunner.gtk.linux.x86</module>
<module>org.mozilla.xulrunner.win32.win32.x86</module>
</modules>
</project>
-
+
\ No newline at end of file
Modified: branches/modular_build/xulrunner/pom.xml
===================================================================
--- branches/modular_build/xulrunner/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -2,19 +2,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <relativePath>../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>xulrunner.all</artifactId>
+ <artifactId>xulrunner</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
+ <module>features</module>
<module>plugins</module>
- <module>features</module>
<module>site</module>
</modules>
</project>
-
+
\ No newline at end of file
Modified: branches/modular_build/xulrunner/site/pom.xml
===================================================================
--- branches/modular_build/xulrunner/site/pom.xml 2010-04-21 03:26:29 UTC (rev 21567)
+++ branches/modular_build/xulrunner/site/pom.xml 2010-04-21 03:40:25 UTC (rev 21568)
@@ -2,17 +2,17 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
- <relativePath>../../parent-pom.xml</relativePath>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.parent.pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>site.all</artifactId>
+ <artifactId>xulrunner.site</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>org.mozilla.xulrunner.site</module>
</modules>
</project>
-
+
\ No newline at end of file
14 years, 8 months
JBoss Tools SVN: r21567 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: publishers and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-20 23:26:29 -0400 (Tue, 20 Apr 2010)
New Revision: 21567
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
Log:
JBIDE-5857 - changes exception handling on I/O errors during publishing to fail immediately if a renameTo fails (so that it does not fail repeatedly on the next 10,000 files and make the publish look frozen)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2010-04-21 03:22:35 UTC (rev 21566)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.java 2010-04-21 03:26:29 UTC (rev 21567)
@@ -82,6 +82,7 @@
public static String JMXResumeScannerError;
public static String JMXScannerCanceled;
public static String CannotSaveServersStartArgs;
+ public static String PublishRenameFailure;
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2010-04-21 03:22:35 UTC (rev 21566)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Messages.properties 2010-04-21 03:26:29 UTC (rev 21567)
@@ -43,6 +43,7 @@
FullPublishFail=Full publish failed for module {0}
IncrementalPublishFail=Incremental publish failed for module {0}
+PublishRenameFailure=Error renaming {0} to {1}
DeleteModuleFail=Unable to delete module {0}
DeleteModuleFail2=Some files were not removed from the server
CountModifiedMembers={0} files modified in module {1}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2010-04-21 03:22:35 UTC (rev 21566)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2010-04-21 03:26:29 UTC (rev 21567)
@@ -68,12 +68,18 @@
if( deltaKind != ServerBehaviourDelegate.REMOVED)
deltas = behaviour.getPublishedResourceDelta(module);
if( publisher != null ) {
- IStatus result = publisher.publishModule(
- this,
- behaviour.getServer(), module,
- publishType, deltas, monitor);
- if( result != null )
- ServerLogger.getDefault().log(behaviour.getServer(), result);
+ try {
+ IStatus result = publisher.publishModule(
+ this,
+ behaviour.getServer(), module,
+ publishType, deltas, monitor);
+ if( result != null )
+ ServerLogger.getDefault().log(behaviour.getServer(), result);
+ } catch( CoreException ce) {
+ // Let the user know
+ ServerLogger.getDefault().log(behaviour.getServer(), ce.getStatus());
+ throw ce;
+ }
return publisher.getPublishState();
}
return IServer.PUBLISH_STATE_INCREMENTAL;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2010-04-21 03:22:35 UTC (rev 21566)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2010-04-21 03:26:29 UTC (rev 21567)
@@ -127,7 +127,7 @@
public String getDefaultRunVMArgs() {
IConstants c = new IConstants(){};
String name = getRuntime().getName();
- String ret = c.SYSPROP + c.PROGRAM_NAME_ARG + c.EQ + c.QUOTE +
+ String ret = c.QUOTE + c.SYSPROP + c.PROGRAM_NAME_ARG + c.EQ +
"JBossTools: " + name + c.QUOTE + c.SPACE; //$NON-NLS-1$
if( Platform.getOS().equals(Platform.OS_MACOSX))
ret += c.SERVER_ARG + c.SPACE;
@@ -145,7 +145,7 @@
ret += c.SYSPROP + c.JAVA_PREFER_IP4_ARG + c.EQ + true + c.SPACE;
ret += c.SYSPROP + c.SUN_CLIENT_GC_ARG + c.EQ + 3600000 + c.SPACE;
ret += c.SYSPROP + c.SUN_SERVER_GC_ARG + c.EQ + 3600000 + c.SPACE;
- ret += c.SYSPROP + c.ENDORSED_DIRS + c.EQ + c.QUOTE +
+ ret += c.QUOTE + c.SYSPROP + c.ENDORSED_DIRS + c.EQ +
(getRuntime().getLocation().append(c.LIB).append(c.ENDORSED)) + c.QUOTE + c.SPACE;
if( getRuntime().getLocation().append(c.BIN).append(c.NATIVE).toFile().exists() )
ret += c.SYSPROP + c.JAVA_LIB_PATH + c.EQ + c.QUOTE +
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2010-04-21 03:22:35 UTC (rev 21566)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java 2010-04-21 03:26:29 UTC (rev 21567)
@@ -20,7 +20,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -199,7 +198,7 @@
if (ts != IResource.NULL_STAMP && ts != 0)
file.setLastModified(ts);
} catch (CoreException e) {
- return e.getStatus();
+ throw e;
} catch (Exception e) {
IPath path = mf.getModuleRelativePath().append(mf.getName());
return new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorCopyingFile, path.toOSString(), e.getLocalizedMessage()), null);
@@ -256,7 +255,9 @@
}
}
if (!safeRename(tempFile, file, 10))
- throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0, NLS.bind(Messages.errorRename, tempFile.toString()), null));
+ throw new CoreException(new Status(IStatus.ERROR, ServerPlugin.PLUGIN_ID, 0,
+ NLS.bind(org.jboss.ide.eclipse.as.core.Messages.PublishRenameFailure,
+ tempFile.toString(), file.getAbsolutePath()), null));
}
/**
@@ -268,15 +269,16 @@
* @return <code>true</code> if it succeeds, <code>false</code> otherwise
*/
private boolean safeRename(File from, File to, int retrys) {
+ boolean renamedSafely = false;
// make sure parent dir exists
File dir = to.getParentFile();
if (dir != null && !dir.exists())
dir.mkdirs();
int count = 0;
- while (count < retrys) {
+ while (count < retrys && !renamedSafely) {
if (from.renameTo(to))
- return true;
+ renamedSafely = true;
count++;
// delay if we are going to try again
@@ -288,7 +290,7 @@
}
}
}
- return false;
+ return renamedSafely;
}
protected File getTempFolder() {
@@ -457,19 +459,15 @@
if (resource instanceof IModuleFile) {
IModuleFile file = (IModuleFile) resource;
- try {
- if (kind2 == IModuleResourceDelta.REMOVED) {
- IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName());
- handler.deleteResource(path2, monitor);
- }
- else {
- IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName());
- handler.makeDirectoryIfRequired(path2.removeLastSegments(1), monitor);
- handler.copyFile(file, path2, monitor);
- }
- } catch (CoreException ce) {
- status.add(ce.getStatus());
+ if (kind2 == IModuleResourceDelta.REMOVED) {
+ IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName());
+ handler.deleteResource(path2, monitor);
}
+ else {
+ IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName());
+ handler.makeDirectoryIfRequired(path2.removeLastSegments(1), monitor);
+ handler.copyFile(file, path2, monitor);
+ }
IStatus[] stat = new IStatus[status.size()];
status.toArray(stat);
return stat;
@@ -551,11 +549,7 @@
if( stats.length > 0 && !stats[0].isOK())
addArrayToList(status, stats);
- try {
- addArrayToList(status, handler.copyFile(mf, path, monitor));
- } catch (CoreException ce) {
- status.add(ce.getStatus());
- }
+ addArrayToList(status, handler.copyFile(mf, path, monitor));
}
IStatus[] stat = new IStatus[status.size()];
status.toArray(stat);
14 years, 8 months
JBoss Tools SVN: r21566 - in trunk/as: tests/org.jboss.ide.eclipse.as.test and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-20 23:22:35 -0400 (Tue, 20 Apr 2010)
New Revision: 21566
Added:
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/3.2.8.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/4.0.5.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/4.2.3.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.0.0.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.0.1.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.1.0.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/6.0.0.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/eap4.3.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/eap5.0.mf.twiddle.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/jboss-service.xml
trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/run.jar
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
Log:
Added some tests for making sure changing args works properly
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2010-04-21 03:21:14 UTC (rev 21565)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2010-04-21 03:22:35 UTC (rev 21566)
@@ -92,7 +92,7 @@
}}.start();
}
- public void forceStop() {
+ public synchronized void forceStop() {
// just terminate the process.
if( process != null && !process.isTerminated()) {
try {
@@ -132,7 +132,7 @@
protected transient IDebugEventSetListener processListener;
- public void setProcess(final IProcess newProcess) {
+ public synchronized void setProcess(final IProcess newProcess) {
if (process != null) {
return;
}
@@ -175,7 +175,7 @@
pollServer(IServerStatePoller.SERVER_DOWN);
}
- public IProcess getProcess() {
+ public synchronized IProcess getProcess() {
return process;
}
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/3.2.8.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/3.2.8.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/4.0.5.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/4.0.5.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/4.2.3.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/4.2.3.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.0.0.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.0.0.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.0.1.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.0.1.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.1.0.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/5.1.0.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/6.0.0.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/6.0.0.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/eap4.3.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/eap4.3.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/eap5.0.mf.twiddle.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/eap5.0.mf.twiddle.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/jboss-service.xml
===================================================================
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/run.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test/serverMock/run.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2010-04-21 03:21:14 UTC (rev 21565)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2010-04-21 03:22:35 UTC (rev 21566)
@@ -33,7 +33,7 @@
import org.osgi.framework.Bundle;
public abstract class AbstractDeploymentTest extends TestCase {
- protected String BUNDLE_NAME = "org.jboss.ide.eclipse.as.test";
+ public static String BUNDLE_NAME = "org.jboss.ide.eclipse.as.test";
private TestProjectProvider[] provider;
protected IProject[] workspaceProject;
protected String[] sourceProjectName;
Added: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java (rev 0)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/server/MockTests.java 2010-04-21 03:22:35 UTC (rev 21566)
@@ -0,0 +1,150 @@
+package org.jboss.ide.eclipse.as.test.server;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.util.ServerRuntimeUtils;
+
+public class MockTests extends TestCase {
+ public void setUp() {
+ }
+ public void tearDown() {
+ try {
+ ServerRuntimeUtils.deleteAllServers();
+ ServerRuntimeUtils.deleteAllRuntimes();
+ } catch(CoreException ce) {}
+ }
+
+
+ public void testRemoveCriticalVMArgs() {
+ IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ try {
+ ILaunchConfiguration config = server.getLaunchConfiguration(true, new NullProgressMonitor());
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "hello");
+ wc.doSave();
+
+ // re-get it and check the changes
+ ILaunchConfiguration launchConfig = server.getLaunchConfiguration(false, null);
+ String vmArgs = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, (String)null);
+ LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
+ String defaultVMArgs = rt.getDefaultRunVMArgs();
+ assertFalse(vmArgs == null);
+ assertFalse(vmArgs.equals(rt.getDefaultRunVMArgs()));
+ assertFalse(vmArgs.equals(defaultVMArgs));
+ assertTrue(vmArgs.startsWith("hello -Djava.endorsed.dirs=\""));
+ assertTrue(vmArgs.endsWith(".metadata/.plugins/org.jboss.ide.eclipse.as.test/mockedServers/server1/lib/endorsed\""));
+ } catch(CoreException ce) {
+ fail(ce.getMessage());
+ }
+ }
+
+ public void testChangeArgs() {
+ // should still match the defaults since the defaults are extremely all required
+ IServer server = serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ try {
+ ILaunchConfiguration config = server.getLaunchConfiguration(true, new NullProgressMonitor());
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
+ wc.doSave();
+ String command = runAndGetCommand(server);
+ assertFalse("No args found from process", command == null);
+ LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
+ String defaultArgs = rt.getDefaultRunArgs().replace("\"", "");
+ assertTrue(command.replace("\"", "").contains(defaultArgs));
+ } catch(CoreException ce) {
+ fail(ce.getMessage());
+ }
+ }
+
+ protected IServer serverTestImpl(String type) {
+ IServer server = ServerRuntimeUtils.createMockServerWithRuntime(type, "server1", "default");
+ IServer fixed = setMockDetails(server);
+ String command = runAndGetCommand(fixed);
+ assertFalse("No args found from process", command == null);
+
+ LocalJBossServerRuntime rt = (LocalJBossServerRuntime)server.getRuntime().loadAdapter(LocalJBossServerRuntime.class, new NullProgressMonitor());
+ String defaultArgs = rt.getDefaultRunArgs().replace("\"", "");
+ String defaultVMArgs = rt.getDefaultRunVMArgs().replace("\"", "");
+ assertTrue(command.replace("\"", "").contains(defaultArgs));
+ assertTrue(command.replace("\"", "").contains(defaultVMArgs));
+ return fixed;
+ }
+
+ protected IProcess runAndGetProcess(final IServer server) {
+ try {
+ server.start("run", new NullProgressMonitor());
+ } catch( CoreException ce) {}
+
+ int loops = 0;
+ JBossServerBehavior behavior = (JBossServerBehavior)server.loadAdapter(JBossServerBehavior.class, null);
+
+ while(loops < 50) {
+ if( behavior.getProcess() != null ) {
+ return behavior.getProcess();
+ }
+ try {
+ loops++;
+ Thread.sleep(1000);
+ } catch(Exception e){}
+ }
+ return null;
+ }
+
+ protected String runAndGetCommand(final IServer server) {
+ return runAndGetProcess(server).getAttribute(IProcess.ATTR_CMDLINE);
+ }
+
+ private IServer setMockDetails(IServer server) {
+ IServerWorkingCopy copy = server.createWorkingCopy();
+ ServerAttributeHelper helper = new ServerAttributeHelper(server, copy);
+ helper.setAttribute("start-timeout", "2");
+ helper.setAttribute("org.jboss.ide.eclipse.as.core.server.attributes.startupPollerKey",
+ "org.jboss.ide.eclipse.as.core.runtime.server.timeoutpoller");
+ try {
+ return copy.save(true, new NullProgressMonitor());
+ } catch( CoreException ce ) {
+ }
+ return null;
+ }
+
+ public void test32Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_32);
+ }
+
+ public void test40Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_40);
+ }
+
+ public void test42Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_42);
+ }
+
+ public void test50Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_50);
+ }
+ public void test51Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_51);
+ }
+ public void test60Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_AS_60);
+ }
+ public void testEap43Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_43);
+ }
+ public void testEap50Mock() {
+ serverTestImpl(IJBossToolingConstants.SERVER_EAP_50);
+ }
+}
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2010-04-21 03:21:14 UTC (rev 21565)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/util/ServerRuntimeUtils.java 2010-04-21 03:22:35 UTC (rev 21566)
@@ -1,8 +1,20 @@
package org.jboss.ide.eclipse.as.test.util;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+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.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IRuntime;
@@ -15,13 +27,60 @@
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.RuntimeWorkingCopy;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.test.ASTest;
+import org.jboss.ide.eclipse.as.test.publishing.AbstractDeploymentTest;
+import org.osgi.framework.Bundle;
-import junit.framework.TestCase;
-
public class ServerRuntimeUtils extends TestCase {
public static final IVMInstall VM_INSTALL = JavaRuntime.getDefaultVMInstall();
public static final String DEFAULT_CONFIG = "default";
+ public static final String twiddle_suffix = ".mf.twiddle.jar";
+ public static final String twiddle_3_2_8 = "3.2.8" + twiddle_suffix;
+ public static final String twiddle_4_0_5 = "4.0.5" + twiddle_suffix;
+ public static final String twiddle_4_2_3 = "4.2.3" + twiddle_suffix;
+ public static final String twiddle_5_0_0 = "5.0.0" + twiddle_suffix;
+ public static final String twiddle_5_0_1 = "5.0.1" + twiddle_suffix;
+ public static final String twiddle_5_1_0 = "5.1.0" + twiddle_suffix;
+ public static final String twiddle_6_0_0 = "6.0.0" + twiddle_suffix;
+ public static final String twiddle_eap_4_3 = "eap4.3" + twiddle_suffix;
+ public static final String twiddle_eap_5_0 = "eap5.0" + twiddle_suffix;
+ public static final String run_jar = "run.jar";
+ public static final String service_xml = "service.xml";
+ public static final IPath mockedServers = ASTest.getDefault().getStateLocation().append("mockedServers");
+ public static HashMap<String, String> twiddleMap = new HashMap<String, String>();
+ public static HashMap<String, String> serverRuntimeMap = new HashMap<String, String>();
+
+ static {
+ twiddleMap.put(IJBossToolingConstants.SERVER_AS_32, twiddle_3_2_8);
+ twiddleMap.put(IJBossToolingConstants.SERVER_AS_40, twiddle_4_0_5);
+ twiddleMap.put(IJBossToolingConstants.SERVER_AS_42, twiddle_4_2_3);
+ twiddleMap.put(IJBossToolingConstants.SERVER_AS_50, twiddle_5_0_0);
+ twiddleMap.put(IJBossToolingConstants.SERVER_AS_51, twiddle_5_1_0);
+ twiddleMap.put(IJBossToolingConstants.SERVER_AS_60, twiddle_6_0_0);
+ twiddleMap.put(IJBossToolingConstants.SERVER_EAP_43, twiddle_eap_4_3);
+ twiddleMap.put(IJBossToolingConstants.SERVER_EAP_50, twiddle_eap_5_0);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_32, IJBossToolingConstants.AS_32);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_40, IJBossToolingConstants.AS_40);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_42, IJBossToolingConstants.AS_42);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_50, IJBossToolingConstants.AS_50);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_51, IJBossToolingConstants.AS_51);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_AS_60, IJBossToolingConstants.AS_60);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_EAP_43, IJBossToolingConstants.EAP_43);
+ serverRuntimeMap.put(IJBossToolingConstants.SERVER_EAP_50, IJBossToolingConstants.EAP_50);
+}
+
+ public static IServer createMockServerWithRuntime(String serverType, String name, String config) {
+ try {
+ IPath serverDir = createMockServerDirectory(name, twiddleMap.get(serverType), config);
+ return createServer(serverRuntimeMap.get(serverType), serverType, serverDir.toOSString(), config);
+ } catch( CoreException ce ) {
+ }
+ return null;
+ }
+
public static IServer createServer(String runtimeID, String serverID,
String location, String configuration) throws CoreException {
// if file doesnt exist, abort immediately.
@@ -70,7 +129,49 @@
public static void deleteAllRuntimes() throws CoreException {
IRuntime[] runtimes = ServerCore.getRuntimes();
for( int i = 0; i < runtimes.length; i++ ) {
+ if( mockedServers.isPrefixOf(runtimes[i].getLocation())) {
+ FileUtil.completeDelete(runtimes[i].getLocation().toFile());
+ }
runtimes[i].delete();
}
}
+
+
+
+ public static IPath createMockServerDirectory(String name, String twiddleJar, String configurationName ) {
+ IPath loc = mockedServers.append(name);
+ try {
+ loc.toFile().mkdirs();
+ loc.append("bin").toFile().mkdirs();
+ loc.append("server").toFile().mkdirs();
+ loc.append("server").append(configurationName).toFile().mkdirs();
+ IPath configConf = loc.append("server").append(configurationName).append("conf");
+ configConf.toFile().mkdirs();
+ File twiddleLoc = getFileLocation("serverMock/" + twiddleJar);
+ FileUtil.fileSafeCopy(twiddleLoc, loc.append("bin").append("twiddle.jar").toFile());
+ File runJar = getFileLocation("serverMock/run.jar");
+ FileUtil.fileSafeCopy(runJar, loc.append("bin").append("run.jar").toFile());
+ File serviceXml = getFileLocation("serverMock/jboss-service.xml");
+ FileUtil.fileSafeCopy(serviceXml, configConf.append("jboss-service.xml").toFile());
+ return loc;
+ } catch( CoreException ce ) {
+ FileUtil.completeDelete(loc.toFile());
+ return null;
+ }
+ }
+
+ // Find a file in our bundle
+ protected static File getFileLocation(String path) throws CoreException {
+ Bundle bundle = Platform.getBundle(AbstractDeploymentTest.BUNDLE_NAME);
+ URL url = null;
+ try {
+ url = FileLocator.resolve(bundle.getEntry(path));
+ } catch (IOException e) {
+ String msg = "Cannot find file " + path + " in " + AbstractDeploymentTest.BUNDLE_NAME;
+ IStatus status = new Status(IStatus.ERROR, ASTest.PLUGIN_ID, msg, e);
+ throw new CoreException(status);
+ }
+ String location = url.getFile();
+ return new File(location);
+ }
}
14 years, 8 months
JBoss Tools SVN: r21565 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-20 23:21:14 -0400 (Tue, 20 Apr 2010)
New Revision: 21565
Modified:
branches/modular_build/genpom.xml
Log:
add support for getArtifactOsWsArch to add platform dep values into pom.xml; add support for overwrite.existing.pom.xml (default false) so if pom.xml already exists, don't simply regenerate it
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-04-21 03:19:19 UTC (rev 21564)
+++ branches/modular_build/genpom.xml 2010-04-21 03:21:14 UTC (rev 21565)
@@ -15,9 +15,12 @@
-->
<!-- To run this script via commandline:
cd /home/nboldt/workspace36/jbosstools-modular_build; ant -f genpom.xml -q
- or, to build a specific module only:
+ or, to build a specific module IFF no poms already exist:
cd /home/nboldt/workspace36/jbosstools-modular_build; \
- ant -f genpom.xml -q -DCOMPONENT=common
+ ant -f genpom.xml -q -DCOMPONENT=xulrunner
+ or, to build a specific module and overwrite existing pom.xml files:
+ cd /home/nboldt/workspace36/jbosstools-modular_build; \
+ ant -f genpom.xml -q -DCOMPONENT=common -Doverwrite.existing.pom.xml=true
-->
<target name="get.ant-contrib" unless="ant-contrib.jar.exists">
14 years, 8 months
JBoss Tools SVN: r21564 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-20 23:19:19 -0400 (Tue, 20 Apr 2010)
New Revision: 21564
Modified:
branches/modular_build/genpom.xml
Log:
add support for getArtifactOsWsArch to add platform dep values into pom.xml; add support for overwrite.existing.pom.xml (default false) so if pom.xml already exists, don't simply regenerate it
Modified: branches/modular_build/genpom.xml
===================================================================
--- branches/modular_build/genpom.xml 2010-04-21 02:15:52 UTC (rev 21563)
+++ branches/modular_build/genpom.xml 2010-04-21 03:19:19 UTC (rev 21564)
@@ -7,6 +7,7 @@
<property name="dirsToExclude"
value="**/*.sdk.*, **/doc*, **/download.jboss.org, **/util/**, **/test, **/builders, **/contrib, **/releng/**, ."
/>
+ <property name="overwrite.existing.pom.xml" value="false" />
<!-- Configuration Ends -->
<!-- To run this script in Eclipse:
@@ -97,7 +98,15 @@
override="true"
/>
<echo level="verbose"> Agg dir: ${activeDir}, artifactType: ${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</echo>
- <echo file="@{dir}/pom.xml"><project
+ <if>
+ <or>
+ <not>
+ <available file="@{dir}/pom.xml" type="file" />
+ </not>
+ <istrue value="${overwrite.existing.pom.xml}" />
+ </or>
+ <then>
+ <echo file="@{dir}/pom.xml"><project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -112,23 +121,25 @@
<packaging>${artifactType}</packaging>
<modules>
</echo>
- <var name="artifactId" unset="true" />
- <var name="artifactVersion" unset="true" />
- <for param="subdir" delimiter=",
+ <var name="artifactId" unset="true" />
+ <var name="artifactVersion" unset="true" />
+ <for param="subdir" delimiter=",
">
- <path>
- <dirset dir="@{dir}" excludes="${dirsToExclude}" includes="*" />
- </path>
- <sequential>
- <basename property="subdirSuffix" file="@{subdir}" />
- <echo file="@{dir}/pom.xml" append="true"> <module>${subdirSuffix}</module>
+ <path>
+ <dirset dir="@{dir}" excludes="${dirsToExclude}" includes="*" />
+ </path>
+ <sequential>
+ <basename property="subdirSuffix" file="@{subdir}" />
+ <echo file="@{dir}/pom.xml" append="true"> <module>${subdirSuffix}</module>
</echo>
- <var name="subdirSuffix" unset="true" />
- </sequential>
- </for>
- <echo file="@{dir}/pom.xml" append="true"> </modules>
+ <var name="subdirSuffix" unset="true" />
+ </sequential>
+ </for>
+ <echo file="@{dir}/pom.xml" append="true"> </modules>
</project>
</echo>
+ </then>
+ </if>
</sequential>
</macrodef>
@@ -160,6 +171,12 @@
<antcallback target="getArtifactVersion" return="artifactVersion">
<property name="dir" value="@{dir}" />
</antcallback>
+ <var name="artifactOs" unset="true" />
+ <var name="artifactWs" unset="true" />
+ <var name="artifactArch" unset="true" />
+ <antcallback target="getArtifactOsWsArch" return="artifactOs, artifactWs, artifactArch">
+ <property name="artifactId" value="${artifactId}" />
+ </antcallback>
</else>
</if>
<propertyregex property="activeDir"
@@ -171,7 +188,15 @@
override="true"
/>
<echo level="verbose"> Mod dir: ${activeDir}, artifactType: ${artifactType}, artifactId: ${artifactId}, artifactVersion: ${artifactVersion}, parentpom: @{parentpom}</echo>
- <echo file="@{dir}/pom.xml"><project
+ <if>
+ <or>
+ <not>
+ <available file="@{dir}/pom.xml" type="file" />
+ </not>
+ <istrue value="${overwrite.existing.pom.xml}" />
+ </or>
+ <then>
+ <echo file="@{dir}/pom.xml"><project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -180,16 +205,65 @@
<artifactId>${projectName}.parent.pom</artifactId>
<version>${pomVersion}</version>
</parent>
- <groupId>${projectName}</groupId>
+ <groupId>${projectName}</groupId>
<artifactId>${artifactId}</artifactId>
- <version>${artifactVersion}</version>
- <packaging>${artifactType}</packaging>
-</project>
- </echo>
- <!-- TODO: if generating module pom for a given platform, add in platform-specific stuff (see xulrunner) -->
+ <version>${artifactVersion}</version>
+ <packaging>${artifactType}</packaging>
+</echo>
+ <if>
+ <or>
+ <and>
+ <isset property="artifactOs" />
+ <not>
+ <equals arg1="" arg2="${artifactOs}" />
+ </not>
+ </and>
+ <and>
+ <isset property="artifactWs" />
+ <not>
+ <equals arg1="" arg2="${artifactWs}" />
+ </not>
+ </and>
+ <and>
+ <isset property="artifactArch" />
+ <not>
+ <equals arg1="" arg2="${artifactArch}" />
+ </not>
+ </and>
+ </or>
+ <then>
+ <echo file="@{dir}/pom.xml" append="true"> <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <resolver>p2</resolver>
+ <environments>
+ <environment>
+ <os>${artifactOs}</os>
+ <ws>${artifactWs}</ws>
+ <arch>${artifactArch}</arch>
+ </environment>
+ </environments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</echo>
+ </then>
+ </if>
+ <echo file="@{dir}/pom.xml" append="true"></project>
+</echo>
+ </then>
+ </if>
<var name="artifactId" unset="true" />
<var name="artifactVersion" unset="true" />
<var name="artifactType" unset="true" />
+ <var name="artifactOs" unset="true" />
+ <var name="artifactWs" unset="true" />
+ <var name="artifactArch" unset="true" />
<var name="modulecountstring" value="${modulecountstring}1" />
</sequential>
</macrodef>
@@ -570,6 +644,42 @@
<var name="parent.dir" unset="true" />
</target>
+ <!-- supports only the following platforms:
+ org.mozilla.xulrunner.carbon.macosx
+ org.mozilla.xulrunner.cocoa.macosx
+ org.mozilla.xulrunner.gtk.linux.x86
+ org.mozilla.xulrunner.gtk.linux.x86_64
+ org.mozilla.xulrunner.win32.win32.x86
+ -->
+ <target name="getArtifactOsWsArch">
+ <property name="artifactId" value="org.mozilla.xulrunner.cocoa.macosx" />
+ <propertyregex property="artifactOs"
+ input="${artifactId}"
+ defaultvalue=""
+ regexp="(macosx|linux|win32)"
+ select="\1"
+ casesensitive="true"
+ override="true"
+ />
+ <propertyregex property="artifactWs"
+ input="${artifactId}"
+ defaultvalue=""
+ regexp="(carbon|cocoa|win32|gtk)"
+ select="\1"
+ casesensitive="true"
+ override="true"
+ />
+ <propertyregex property="artifactArch"
+ input="${artifactId}"
+ defaultvalue=""
+ regexp="\.(x86|x86_64)$"
+ select="\1"
+ casesensitive="true"
+ override="true"
+ />
+
+ </target>
+
<target name="getArtifactId">
<property name="dir" value="." />
<!-- echo>${dir}</echo -->
@@ -672,6 +782,31 @@
<property name="artifactType.portlet/features/org.jboss.tools.portlet.test.feature" value="eclipse-feature" />
<property name="artifactType.jst/features/org.jboss.tools.jst.feature" value="eclipse-feature" />
<property name="artifactType.jst/features/org.jboss.tools.jst.web.tiles.feature" value="eclipse-feature" />
+
+ <!-- expected values for artifactOsWsArch tests -->
+ <property name="artifactOsWsArch.org.mozilla.xpcom.os" value="" />
+ <property name="artifactOsWsArch.org.mozilla.xpcom.ws" value="" />
+ <property name="artifactOsWsArch.org.mozilla.xpcom.arch" value="" />
+
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.carbon.macosx.os" value="macosx" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.carbon.macosx.ws" value="carbon" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.carbon.macosx.arch" value="" />
+
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.cocoa.macosx.os" value="macosx" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.cocoa.macosx.ws" value="cocoa" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.cocoa.macosx.arch" value="" />
+
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.gtk.linux.x86.os" value="linux" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.gtk.linux.x86.ws" value="gtk" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.gtk.linux.x86.arch" value="x86" />
+
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.gtk.linux.x86_64.os" value="linux" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.gtk.linux.x86_64.ws" value="gtk" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.gtk.linux.x86_64.arch" value="x86_64" />
+
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.win32.win32.x86.os" value="win32" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.win32.win32.x86.ws" value="win32" />
+ <property name="artifactOsWsArch.org.mozilla.xulrunner.win32.win32.x86.arch" value="x86" />
</target>
<target name="test.all">
@@ -694,6 +829,7 @@
<antcall target="test.getArtifactVersion" />
<antcall target="test.getArtifactId" />
<antcall target="test.getArtifactType" />
+ <antcall target="test.getArtifactOsWsArch" />
</target>
<target name="test.getArtifactVersion" depends="init, test.expected.values">
@@ -773,6 +909,56 @@
</for>
</target>
+ <target name="test.getArtifactOsWsArch" depends="init, test.expected.values">
+ <property name="artifactIds"
+ value="
+ org.mozilla.xpcom
+ org.mozilla.xulrunner.carbon.macosx
+ org.mozilla.xulrunner.cocoa.macosx
+ org.mozilla.xulrunner.gtk.linux.x86
+ org.mozilla.xulrunner.gtk.linux.x86_64
+ org.mozilla.xulrunner.win32.win32.x86
+ "
+ />
+ <for param="artifactId" list="${artifactIds}" delimiter=",
+ ">
+ <sequential>
+ <echo level="debug">artifactId = @{artifactId}</echo>
+ <antcallback target="getArtifactOsWsArch" return="artifactOs, artifactWs, artifactArch">
+ <property name="artifactId" value="@{artifactId}" />
+ </antcallback>
+ <propertycopy name="expected.value.os" from="artifactOsWsArch.(a){artifactId}.os" />
+ <propertycopy name="expected.value.ws" from="artifactOsWsArch.(a){artifactId}.ws" />
+ <propertycopy name="expected.value.arch" from="artifactOsWsArch.(a){artifactId}.arch" />
+ <assert failonerror="false"
+ message="For @{artifactId}, artifactOs = ${artifactOs}; expected ${expected.value.os}"
+ >
+ <bool>
+ <equals arg1="${expected.value.os}" arg2="${artifactOs}" />
+ </bool>
+ </assert>
+ <assert failonerror="false"
+ message="For @{artifactId}, artifactWs = ${artifactWs}; expected ${expected.value.ws}"
+ >
+ <bool>
+ <equals arg1="${expected.value.ws}" arg2="${artifactWs}" />
+ </bool>
+ </assert>
+ <assert failonerror="false"
+ message="For @{artifactId}, artifactArch = ${artifactArch}; expected ${expected.value.arch}"
+ >
+ <bool>
+ <equals arg1="${expected.value.arch}" arg2="${artifactArch}" />
+ </bool>
+ </assert>
+ <var name="expected.value.os" unset="true" />
+ <var name="expected.value.ws" unset="true" />
+ <var name="expected.value.arch" unset="true" />
+ </sequential>
+ </for>
+
+ </target>
+
<target name="test.getArtifactType" depends="init, test.expected.values">
<property name="dirs"
value="
14 years, 8 months