JBoss Tools SVN: r38284 - in trunk/build: aggregate/bottests-site/site and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-01-30 13:31:31 -0500 (Mon, 30 Jan 2012)
New Revision: 38284
Modified:
trunk/build/aggregate/bottests-site/site/associate.properties
trunk/build/aggregate/site/associate.properties
trunk/build/aggregate/site/sources/associate.properties
trunk/build/parent/pom.xml
trunk/build/pom-core.xml
trunk/build/pom.xml
Log:
add http://dl.google.com/eclipse/plugin/3.7/ back as required <repository> site
Modified: trunk/build/aggregate/bottests-site/site/associate.properties
===================================================================
--- trunk/build/aggregate/bottests-site/site/associate.properties 2012-01-30 18:18:08 UTC (rev 38283)
+++ trunk/build/aggregate/bottests-site/site/associate.properties 2012-01-30 18:31:31 UTC (rev 38284)
@@ -4,4 +4,4 @@
#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
# associate sites to add to the resulting repo
-associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/
+associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/,http://dl.google.com/eclipse/plugin/3.7/
Modified: trunk/build/aggregate/site/associate.properties
===================================================================
--- trunk/build/aggregate/site/associate.properties 2012-01-30 18:18:08 UTC (rev 38283)
+++ trunk/build/aggregate/site/associate.properties 2012-01-30 18:31:31 UTC (rev 38284)
@@ -4,4 +4,4 @@
#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
# associate sites to add to the resulting repo
-associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/
+associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://dl.google.com/eclipse/plugin/3.7/
Modified: trunk/build/aggregate/site/sources/associate.properties
===================================================================
--- trunk/build/aggregate/site/sources/associate.properties 2012-01-30 18:18:08 UTC (rev 38283)
+++ trunk/build/aggregate/site/sources/associate.properties 2012-01-30 18:31:31 UTC (rev 38284)
@@ -4,4 +4,4 @@
#update.site.version=3.2.0.M2.2010-07-16_13-26-18-H21
# associate sites to add to the resulting repo
-associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/
+associate.sites=http://download.jboss.org/jbosstools/updates/indigo/SR1/,http://download.jboss.org/jbosstools/updates/development/indigo/,http://dl.google.com/eclipse/plugin/3.7/
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2012-01-30 18:18:08 UTC (rev 38283)
+++ trunk/build/parent/pom.xml 2012-01-30 18:31:31 UTC (rev 38284)
@@ -481,7 +481,8 @@
</profile>
<!-- GWT dependencies which we can't mirror and must reference directly. -->
- <!-- no longer needed (https://issues.jboss.org/browse/JBIDE-10595) <profile>
+ <!-- still needed? JBIDE-10595 vs. JBIDE-10742 -->
+ <profile>
<id>gwt</id>
<activation>
<activeByDefault>false</activeByDefault>
@@ -499,7 +500,7 @@
</releases>
</repository>
</repositories>
- </profile> -->
+ </profile>
<profile>
<id>osx</id>
Modified: trunk/build/pom-core.xml
===================================================================
--- trunk/build/pom-core.xml 2012-01-30 18:18:08 UTC (rev 38283)
+++ trunk/build/pom-core.xml 2012-01-30 18:31:31 UTC (rev 38284)
@@ -608,7 +608,8 @@
</profiles>
<repositories>
- <!-- no longer needed (https://issues.jboss.org/browse/JBIDE-10595) <repository>
+ <!-- still needed? JBIDE-10595 vs. JBIDE-10742 -->
+ <repository>
<id>gwt-e37</id>
<url>http://dl.google.com/eclipse/plugin/3.7/</url>
<layout>p2</layout>
@@ -618,7 +619,7 @@
<releases>
<enabled>true</enabled>
</releases>
- </repository> -->
+ </repository>
<!-- no longer needed (https://issues.jboss.org/browse/JBIDE-9585) <repository>
<id>egit11</id>
<url>http://download.jboss.org/jbosstools/updates/requirements/egit/1.1.0.2011...</url>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2012-01-30 18:18:08 UTC (rev 38283)
+++ trunk/build/pom.xml 2012-01-30 18:31:31 UTC (rev 38284)
@@ -728,7 +728,8 @@
</profiles>
<repositories>
- <!-- no longer needed (https://issues.jboss.org/browse/JBIDE-10595) <repository>
+ <!-- still needed? JBIDE-10595 vs. JBIDE-10742 -->
+ <repository>
<id>gwt-e37</id>
<url>http://dl.google.com/eclipse/plugin/3.7/</url>
<layout>p2</layout>
@@ -738,7 +739,7 @@
<releases>
<enabled>true</enabled>
</releases>
- </repository> -->
+ </repository>
<!-- no longer needed (https://issues.jboss.org/browse/JBIDE-9585) <repository>
<id>egit11</id>
<url>http://download.jboss.org/jbosstools/updates/requirements/egit/1.1.0.2011...</url>
12 years, 11 months
JBoss Tools SVN: r38283 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-01-30 13:18:08 -0500 (Mon, 30 Jan 2012)
New Revision: 38283
Modified:
trunk/build/parent/pom.xml
Log:
add jbosstools-nightly-staging-composite-soa-tooling profile to parent pom for use with SOA Tooling jobs
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2012-01-30 18:10:00 UTC (rev 38282)
+++ trunk/build/parent/pom.xml 2012-01-30 18:18:08 UTC (rev 38283)
@@ -290,6 +290,28 @@
</repository>
</repositories>
</profile>
+ <profile>
+ <id>jbosstools-nightly-staging-composite-soa-tooling</id>
+ <activation>
+ <property>
+ <name>swtbot.test.skip</name>
+ <value>false</value>
+ </property>
+ </activation>
+ <repositories>
+ <repository>
+ <id>jbosstools-nightly-staging-composite-soa-tooling</id>
+ <url>${jbosstools-nightly-staging-composite-soa-tooling}</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ </profile>
<!-- same contents as jboss-requirements-composite-mirror, but locally
available (to improve network lag) -->
12 years, 11 months
JBoss Tools SVN: r38282 - in trunk/maven: tests/org.jboss.tools.maven.configurators.tests/projects/jsf and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-01-30 13:10:00 -0500 (Mon, 30 Jan 2012)
New Revision: 38282
Added:
trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFUtils.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/src/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/src/main/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/src/main/extras/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/src/main/extras/web.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/jsf/utils/JSFUtilsTest.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JSFConfiguratorTest.java
Log:
JBDS-1999 : Don't modify web.xml while looking for the faces servlet.
Modified: trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java 2012-01-30 17:26:30 UTC (rev 38281)
+++ trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFProjectConfigurator.java 2012-01-30 18:10:00 UTC (rev 38282)
@@ -10,57 +10,45 @@
******************************************************************************/
package org.jboss.tools.maven.jsf.configurators;
-import java.io.File;
-import java.io.InputStream;
+import static org.jboss.tools.maven.jsf.configurators.JSFUtils.JSF_VERSION_1_1;
+import static org.jboss.tools.maven.jsf.configurators.JSFUtils.JSF_VERSION_1_2;
+import static org.jboss.tools.maven.jsf.configurators.JSFUtils.JSF_VERSION_2_0;
+
import java.util.List;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Plugin;
import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
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.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
-import org.eclipse.jst.j2ee.webapplication.Servlet;
-import org.eclipse.jst.j2ee.webapplication.ServletType;
-import org.eclipse.jst.j2ee.webapplication.WebApp;
-import org.eclipse.jst.j2ee.webapplication.WebType;
import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
-import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.jboss.tools.common.util.EclipseJavaUtil;
import org.jboss.tools.maven.core.IJBossMavenConstants;
+import org.jboss.tools.maven.core.ProjectUtil;
import org.jboss.tools.maven.core.internal.project.facet.MavenFacetInstallDataModelProvider;
import org.jboss.tools.maven.jsf.MavenJSFActivator;
import org.jboss.tools.maven.jsf.MavenJSFConstants;
import org.jboss.tools.maven.jsf.Messages;
-import org.jboss.tools.maven.jsf.utils.FacesConfigQuickPeek;
import org.jboss.tools.maven.ui.Activator;
/**
@@ -82,10 +70,7 @@
public static final IProjectFacetVersion JSF_FACET_VERSION_1_1;
protected static final IProjectFacet m2Facet;
protected static final IProjectFacetVersion m2Version;
- public static final String JSF_VERSION_2_0 = "2.0";
- public static final String JSF_VERSION_1_2 = "1.2";
- public static final String JSF_VERSION_1_1 = "1.1";
- private static final String FACES_SERVLET = "javax.faces.webapp.FacesServlet";
+
static {
JSF_FACET = ProjectFacetsManager.getProjectFacet("jst.jsf"); //$NON-NLS-1$
JSF_FACET_VERSION_2_0 = JSF_FACET.getVersion(JSF_VERSION_2_0);
@@ -187,9 +172,9 @@
markerManager.deleteMarkers(fproj.getProject(), MavenJSFConstants.JSF_CONFIGURATION_ERROR_MARKER_ID);
if (!fproj.hasProjectFacet(JSF_FACET)) {
String warSourceDir = getWarSourceDirectory(mavenProject,fproj.getProject());
- IPath facesConfigPath = new Path("WEB-INF/faces-config.xml");
+ String facesConfigPath = "WEB-INF/faces-config.xml";
IFile facesConfig = fproj.getProject().getFolder(warSourceDir).getFile(facesConfigPath);
- IFile generatedFacesConfig = getFileFromUnderlyingresources(fproj.getProject(), facesConfigPath);
+ IFile generatedFacesConfig = ProjectUtil.getGeneratedWebResourceFile(fproj.getProject(), facesConfigPath);
//faces-config.xml will not be created in the source folder and it doesn't exist yet
// => We'll have to fix it after setting the JSF facet
@@ -250,15 +235,6 @@
}
- private IFile getFileFromUnderlyingresources(final IProject project, final IPath filePath) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component == null) {
- return null;
- }
- IContainer underlyingFolder = component.getRootFolder().getUnderlyingFolder();
- return project.getFile(underlyingFolder.getProjectRelativePath().append(filePath));
- }
-
private String getWarSourceDirectory(MavenProject mavenProject,
IProject project) {
Plugin plugin = mavenProject
@@ -295,39 +271,6 @@
.makeRelative().setDevice(null);
}
-
- public String getCustomWebXml(MavenProject mavenProject, IProject project) {
- Plugin plugin = mavenProject
- .getPlugin("org.apache.maven.plugins:maven-war-plugin");
- if (plugin == null) {
- return null;
- }
- Xpp3Dom config = (Xpp3Dom) plugin.getConfiguration();
- if (config != null) {
- Xpp3Dom webXmlDom = config.getChild("webXml");
- if (webXmlDom != null && webXmlDom.getValue() != null) {
- String webXmlFile = webXmlDom.getValue().trim();
- webXmlFile = getRelativePath(project, webXmlFile);
- return webXmlFile;
- }
- }
- return null;
- }
-
- private static String getRelativePath(IProject project, String absolutePath) {
- File basedir = project.getLocation().toFile();
- String relative;
- if (absolutePath.equals(basedir.getAbsolutePath())) {
- relative = ".";
- } else if (absolutePath.startsWith(basedir.getAbsolutePath())) {
- relative = absolutePath.substring(basedir.getAbsolutePath()
- .length() + 1);
- } else {
- relative = absolutePath;
- }
- return relative.replace('\\', '/'); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
/*
private boolean configureWebxml() {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
@@ -338,7 +281,7 @@
private String getJSFVersion(MavenProject mavenProject, IFacetedProject fproj) {
String version = null;
IProject project = fproj.getProject();
- version = getVersionFromFacesconfig(project);
+ version = JSFUtils.getVersionFromFacesconfig(project);
if (version == null) {
version = Activator.getDefault().getDependencyVersion(mavenProject, JSF_API_GROUP_ID, JSF_API_ARTIFACT_ID);
@@ -349,13 +292,13 @@
}
if (version == null) {
//JBIDE-9242 determine JSF version from classpath
- version = getJSFVersionFromClasspath(project);
+ version = JSFUtils.getJSFVersionFromClasspath(project);
}
if (version == null) {
version = inferJsfVersionFromDependencies(mavenProject, JSF_API2_GROUP_ID, JSF_API_ARTIFACT_ID, JSF_VERSION_2_0);
}
- if (version == null && hasFacesServletInWebXml(project)) {
+ if (version == null && hasFacesServletInWebXml(mavenProject, project)) {
//No dependency on JSF, no faces-config, but uses faces-servlet
//so we try to best guess the version depending on the installed web facet
IProjectFacetVersion webVersion = fproj.getInstalledVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET);
@@ -369,112 +312,19 @@
return version;
}
- private boolean hasFacesServletInWebXml(IProject project) {
+ private boolean hasFacesServletInWebXml(MavenProject mavenProject, IProject project) {
//We look for javax.faces.webapp.FacesServlet in web.xml
- WebArtifactEdit edit = null;
- try {
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component != null) {
- edit = WebArtifactEdit.getWebArtifactEditForRead(component);
- if (edit !=null) {
- IPath webXmlPath = edit.getDeploymentDescriptorPath();
- if (!ResourcesPlugin.getWorkspace().getRoot().getFile(webXmlPath).exists()) {
- //JBDS-1999 : If web.xml doesn't exist and we call edit.getWebApp()
- //it will be created, so we bail.
- return false;
- }
- WebApp webapp = edit.getWebApp();
- if (webapp != null && webapp.getServlets() != null) {
- for (Object o : webapp.getServlets()) {
- if (o instanceof Servlet) {
- WebType webType = ((Servlet) o).getWebType();
- if (webType != null
- && webType.isServletType()
- && FACES_SERVLET.equals(((ServletType)webType).getClassName())){
- return true;
- }
- }
- }
- }
- }
- }
- } finally {
- if (edit != null)
- edit.dispose();
- }
- return false;
+ //We should look for a custom web.xml at this point, but WTP would then crash on the JSF Facet installation
+ //if it's not in a standard location, so we stick with the regular file.
+ IFile webXml = getWebXml(project);
+ return webXml != null && webXml.exists() && JSFUtils.hasFacesServlet(webXml);
}
- private String getVersionFromFacesconfig(IProject project) {
-
- IVirtualComponent component = ComponentCore.createComponent(project);
- if (component == null) {
- return null;
- }
- IFile facesConfig = null;
- //TODO get custom faces-config.xml path from web.xml
- IPath facesConfigPath = new Path("WEB-INF/faces-config.xml");
- IContainer[] underlyingFolders = component.getRootFolder().getUnderlyingFolders();
- for (IContainer underlyingFolder : underlyingFolders) {
- IPath p = underlyingFolder.getProjectRelativePath().append(facesConfigPath);
- IFile f = project.getFile(p);
- if (f.exists()) {
- facesConfig = f;
- break;
- }
- }
-
- String version = null;
- if (facesConfig != null) {
- InputStream in = null;
- try {
- in = facesConfig.getContents();
- FacesConfigQuickPeek peek = new FacesConfigQuickPeek(in);
- version = peek.getVersion();
- } catch (CoreException e) {
- // ignore
- Activator.log(e);
- } finally {
- IOUtil.close(in);
- }
- }
- return version;
+ private IFile getWebXml(IProject project) {
+ return ProjectUtil.getWebResourceFile(project, "WEB-INF/web.xml");
}
- /**
- * Determines the JSF version by searching for the methods of javax.faces.application.Application
- * in the project's classpath.
- * @param project : the java project to analyze
- * @return the JSF version (1.1, 1.2, 2.0) found in the classpath,
- * or null if the project doesn't depend on JSF
- */
- private String getJSFVersionFromClasspath(IProject project) {
- String version = null;
- IJavaProject javaProject = JavaCore.create(project);
- if (javaProject != null) {
- IType type = null;
- try {
- type = EclipseJavaUtil.findType(javaProject,
- "javax.faces.application.Application");//$NON-NLS-1$
- } catch (JavaModelException e) {
- e.printStackTrace();
- }
- if (type != null) {
- String[] emptyParams = new String[0];
- if (type.getMethod("getResourceHandler", emptyParams).exists() &&
- type.getMethod("getProjectStage", emptyParams).exists()) {
- return JSF_VERSION_2_0;
- }
- if (type.getMethod("getELResolver", emptyParams).exists() &&
- type.getMethod("getExpressionFactory", emptyParams).exists()) {
- return JSF_VERSION_1_2;
- }
- version = JSF_VERSION_1_1;
- }
- }
- return version;
- }
-
+
private String inferJsfVersionFromDependencies(MavenProject mavenProject, String groupId, String artifactId, String defaultVersion) {
boolean hasCandidates = false;
String jsfVersion = null;
Added: trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFUtils.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFUtils.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.jsf/src/org/jboss/tools/maven/jsf/configurators/JSFUtils.java 2012-01-30 18:10:00 UTC (rev 38282)
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.maven.jsf.configurators;
+
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathFactory;
+
+import org.codehaus.plexus.util.IOUtil;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.util.EclipseJavaUtil;
+import org.jboss.tools.maven.core.ProjectUtil;
+import org.jboss.tools.maven.jsf.utils.FacesConfigQuickPeek;
+import org.jboss.tools.maven.ui.Activator;
+import org.w3c.dom.Document;
+
+public class JSFUtils {
+
+ public static final String FACES_SERVLET = "javax.faces.webapp.FacesServlet";
+
+ public static final String JSF_VERSION_2_0 = "2.0";
+
+ public static final String JSF_VERSION_1_2 = "1.2";
+
+ public static final String JSF_VERSION_1_1 = "1.1";
+
+ private JSFUtils() {
+ // no public constructor
+ }
+
+ /**
+ * Return the faces-config.xml of the given project, or null if faces-config.xml doesn't exist
+ */
+ public static IFile getFacesconfig(IProject project) {
+ IFile facesConfig = ProjectUtil.getWebResourceFile(project, "WEB-INF/faces-config.xml");
+ return facesConfig;
+ }
+
+ /**
+ * Return the faces config version of the given project, or null if faces-config.xml doesn't exist
+ */
+ public static String getVersionFromFacesconfig(IProject project) {
+ IFile facesConfig = getFacesconfig(project);
+ String version = null;
+ if (facesConfig != null) {
+ InputStream in = null;
+ try {
+ in = facesConfig.getContents();
+ FacesConfigQuickPeek peek = new FacesConfigQuickPeek(in);
+ version = peek.getVersion();
+ } catch (CoreException e) {
+ // ignore
+ Activator.log(e);
+ } finally {
+ IOUtil.close(in);
+ }
+ }
+ return version;
+ }
+
+ public static boolean hasFacesServlet(IFile webXml) {
+ //We look for javax.faces.webapp.FacesServlet in web.xml
+ if (webXml == null || !webXml.isAccessible()) {
+ return false;
+ }
+
+ InputStream is = null;
+ try {
+ is = webXml.getContents();
+ return hasFacesServlet(is);
+ } catch (Exception e) {
+ Activator.log("An error occured trying to find to "+FACES_SERVLET+" in "+ webXml.getLocation().toOSString()+":"+e.getMessage());
+ } finally {
+ IOUtil.close(is);
+ }
+ return false;
+ }
+
+ public static boolean hasFacesServlet(InputStream input) {
+ if (input == null) {
+ return false;
+ }
+ boolean hasFacesServlet = false;
+ try {
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ domFactory.setNamespaceAware(false); // never forget this!
+ domFactory.setValidating(false);
+ DocumentBuilder builder = domFactory.newDocumentBuilder();
+ Document doc = builder.parse(input);
+
+ XPath xpath = XPathFactory.newInstance().newXPath();
+ String expression = "//servlet[servlet-class=\"" + FACES_SERVLET + "\"]";
+ XPathExpression expr = xpath.compile(expression);
+ hasFacesServlet = null != expr.evaluate(doc, XPathConstants.NODE);
+ } catch (Exception e) {
+ Activator.log("An error occured trying to find to "+FACES_SERVLET+" :"+e.getMessage());
+ }
+ return hasFacesServlet;
+ }
+
+ /**
+ * Determines the JSF version by searching for the methods of javax.faces.application.Application
+ * in the project's classpath.
+ * @param project : the java project to analyze
+ * @return the JSF version (1.1, 1.2, 2.0) found in the classpath,
+ * or null if the project doesn't depend on JSF
+ */
+ public static String getJSFVersionFromClasspath(IProject project) {
+ String version = null;
+ IJavaProject javaProject = JavaCore.create(project);
+ if (javaProject != null) {
+ IType type = null;
+ try {
+ type = EclipseJavaUtil.findType(javaProject,
+ "javax.faces.application.Application");//$NON-NLS-1$
+ } catch (JavaModelException e) {
+ e.printStackTrace();
+ }
+ if (type != null) {
+ String[] emptyParams = new String[0];
+ if (type.getMethod("getResourceHandler", emptyParams).exists() &&
+ type.getMethod("getProjectStage", emptyParams).exists()) {
+ return JSF_VERSION_2_0;
+ }
+ if (type.getMethod("getELResolver", emptyParams).exists() &&
+ type.getMethod("getExpressionFactory", emptyParams).exists()) {
+ return JSF_VERSION_1_2;
+ }
+ version = JSF_VERSION_1_1;
+ }
+ }
+ return version;
+ }
+
+}
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/pom.xml 2012-01-30 18:10:00 UTC (rev 38282)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.tools.maven.tests</groupId>
+ <artifactId>jsf-customwebxml</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <webXml>${basedir}/src/main/extras/web.xml</webXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/src/main/extras/web.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/src/main/extras/web.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/jsf/jsf-customwebxml/src/main/extras/web.xml 2012-01-30 18:10:00 UTC (rev 38282)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
+ <display-name>foo</display-name>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>faces</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ </servlet>
+
+ <!-- Faces Servlet Mappings -->
+ <servlet-mapping>
+ <servlet-name>faces</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
\ No newline at end of file
Modified: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JSFConfiguratorTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JSFConfiguratorTest.java 2012-01-30 17:26:30 UTC (rev 38281)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/JSFConfiguratorTest.java 2012-01-30 18:10:00 UTC (rev 38282)
@@ -120,6 +120,18 @@
assertFalse("web.xml was added to the project!", webXml.exists());
}
+ @Test
+ public void testFacesServletInCustomWebXml() throws Exception {
+ //JSFFacet installation can't find custom web.xml and crashes so this case is not supported
+ String projectLocation = "projects/jsf/jsf-customwebxml/";
+ IProject jsfProject = importProject(projectLocation+"/pom.xml");
+ waitForJobsToComplete(new NullProgressMonitor());
+ IFacetedProject facetedProject = ProjectFacetsManager.create(jsfProject);
+ assertNotNull(jsfProject.getName() + " is not a faceted project", facetedProject);
+ assertFalse(jsfProject.getName() + " should not have the JSF facet", facetedProject.hasProjectFacet(JSFProjectConfigurator.JSF_FACET));
+ assertTrue(jsfProject.getName() + " doesn't have the expected Web facet", facetedProject.hasProjectFacet(IJ2EEFacetConstants.DYNAMIC_WEB_25));
+ }
+
private void assertHasJSFConfigurationError(IProject project, String message) throws Exception {
WorkspaceHelpers.assertErrorMarker(MavenJSFConstants.JSF_CONFIGURATION_ERROR_MARKER_ID, message, 1, "", project);
}
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/jsf/utils/JSFUtilsTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/jsf/utils/JSFUtilsTest.java (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/jsf/utils/JSFUtilsTest.java 2012-01-30 18:10:00 UTC (rev 38282)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.maven.jsf.utils;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.jboss.tools.maven.jsf.configurators.JSFUtils;
+
+public class JSFUtilsTest extends TestCase {
+
+ private static final String webXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
+ "<web-app xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:web=\"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\" version=\"2.5\">\r\n" +
+ " <display-name>a</display-name>\r\n" +
+ " <welcome-file-list>\r\n" +
+ " <welcome-file>index.html</welcome-file>\r\n" +
+ " </welcome-file-list>\r\n" +
+ " <servlet>\r\n" +
+ " <servlet-name>FacesServlet</servlet-name>\r\n" +
+ " <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>\r\n" +
+ " </servlet>\r\n" +
+ "</web-app>";
+
+ private static final String webXmlNoFaces = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
+ "<web-app xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:web=\"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\" version=\"2.5\">\r\n" +
+ " <servlet>\r\n" +
+ " <servlet-name>FacesServlet</servlet-name>\r\n" +
+ " <servlet-class>javax.faces.webapp.NoFacesServlet</servlet-class>\r\n" +
+ " </servlet>\r\n" +
+ "</web-app>";
+
+
+ public void testHasFacesServlet() {
+ InputStream is = null;
+ assertFalse(JSFUtils.hasFacesServlet(is));
+
+ is = new ByteArrayInputStream(webXml.getBytes());
+ assertTrue(JSFUtils.hasFacesServlet(is));
+
+ is = new ByteArrayInputStream(webXmlNoFaces.getBytes());
+ assertFalse(JSFUtils.hasFacesServlet(is));
+ }
+
+}
12 years, 11 months
JBoss Tools SVN: r38281 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard: appimport and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-01-30 12:26:30 -0500 (Mon, 30 Jan 2012)
New Revision: 38281
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportExistingApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java
Log:
[JBIDE-10479] corrected confirmation message and strategy selection when importing to existing project
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportExistingApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportExistingApplicationWizard.java 2012-01-30 17:20:58 UTC (rev 38280)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportExistingApplicationWizard.java 2012-01-30 17:26:30 UTC (rev 38281)
@@ -22,6 +22,7 @@
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jgit.errors.TransportException;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
import org.jboss.tools.common.ui.DelegatingProgressMonitor;
@@ -34,7 +35,7 @@
import com.openshift.express.client.OpenShiftException;
/**
- * @author Andr� Dietisheim
+ * @author Andre Dietisheim
* @author Xavier Coulon
*/
public class ImportExistingApplicationWizard extends AbstractOpenShiftApplicationWizard<ImportExistingApplicationWizardModel> implements IImportWizard {
@@ -92,16 +93,32 @@
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
try {
delegatingMonitor.add(monitor);
-
- if (getWizardModel().isNewProject()) {
- getWizardModel().importProject(delegatingMonitor);
+ ImportExistingApplicationWizardModel wizardModel = getWizardModel();
+ if (wizardModel.isNewProject()) {
+ wizardModel.importProject(delegatingMonitor);
+ } else if (!wizardModel.isGitSharedProject()) {
+ if (!askForConfirmation(
+ NLS.bind("OpenShift application {0} will be enabled on project {1} by " +
+ "copying OpenShift configuration and enabling Git for the project.\n " +
+ "This cannot be undone. Do you wish to continue ?"
+ , wizardModel.getApplicationName()
+ , wizardModel.getProjectName()),
+ wizardModel.getApplicationName())) {
+ return Status.CANCEL_STATUS;
+ }
+ getWizardModel().configureUnsharedProject(delegatingMonitor);
} else {
- if (!askForConfirmation(getWizardModel().getApplicationName(), getWizardModel().getProjectName())) {
+ if (!askForConfirmation(
+ NLS.bind("OpenShift application {0} will be enabled on project {1} by copying OpenShift " +
+ "configuration and adding the OpenShift git repo as remote.\n " +
+ "This cannot be undone. Do you wish to continue ?"
+ , wizardModel.getApplicationName()
+ , wizardModel.getProjectName())
+ , wizardModel.getApplicationName())) {
return Status.CANCEL_STATUS;
}
- getWizardModel().configureUnsharedProject(delegatingMonitor);
+ wizardModel.configureGitSharedProject(delegatingMonitor);
}
-
return Status.OK_STATUS;
} catch (final WontOverwriteException e) {
openError("Project already present", e.getMessage());
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java 2012-01-30 17:20:58 UTC (rev 38280)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java 2012-01-30 17:26:30 UTC (rev 38281)
@@ -13,6 +13,7 @@
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collection;
@@ -26,6 +27,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.op.AddToIndexOperation;
+import org.eclipse.jgit.lib.Repository;
import org.eclipse.osgi.util.NLS;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.tools.openshift.egit.core.EGitUtils;
@@ -105,17 +107,27 @@
addToModified(copyOpenshiftConfigurations(getApplication(), getRemoteName(), project, monitor));
addToModified(setupGitIgnore(project, monitor));
addToModified(setupOpenShiftMavenProfile(project, monitor));
+ addRemote(getRemoteName(), getApplication().getUUID(), project);
- EGitUtils.addRemoteTo(
- getRemoteName(),
- getApplication().getGitUri(),
- EGitUtils.getRepository(project));
-
addAndCommitModifiedResource(project, monitor);
return Collections.singletonList(project);
}
+ private void addRemote(String remoteName, String uuid, IProject project) throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException {
+ Repository repository = EGitUtils.getRepository(project);
+ Assert.isTrue(repository != null);
+
+ if (EGitUtils.hasRemote("rhcloud.com", repository)) {
+ return;
+ }
+
+ EGitUtils.addRemoteTo(
+ getRemoteName(),
+ getApplication().getGitUri(),
+ repository);
+ }
+
private void addAndCommitModifiedResource(IProject project, IProgressMonitor monitor) throws CoreException {
new AddToIndexOperation(modifiedResources).execute(monitor);
EGitUtils.commit(project, monitor);
12 years, 11 months
JBoss Tools SVN: r38280 - in trunk/openshift: tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-01-30 12:20:58 -0500 (Mon, 30 Jan 2012)
New Revision: 38280
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
Log:
[JBIDE-10479] corrected EGitUtils#isDirty to report dirty repos & added tests
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2012-01-30 17:10:03 UTC (rev 38279)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2012-01-30 17:20:58 UTC (rev 38280)
@@ -22,6 +22,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Assert;
@@ -685,6 +687,22 @@
repository.toString()));
}
}
+
+ public static boolean hasRemote(String regex, Repository repository) throws CoreException {
+ return hasRemote(Pattern.compile(regex), repository);
+ }
+
+ public static boolean hasRemote(Pattern pattern, Repository repository) throws CoreException {
+ for (RemoteConfig config : getAllRemoteConfigs(repository)) {
+ for(URIish uri : config.getURIs()) {
+ Matcher matcher = pattern.matcher(uri.toString());
+ if (matcher.find()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
/**
* Returns <code>true</code> if the given repository has several configured
@@ -774,7 +792,13 @@
/**
* Returns <code>true</code> if the given repository has uncommitted
- * changes.
+ * changes. Uncommitted changes taken into account are
+ * <ul>
+ * <li>freshly added (but uncommitted resources)</li>
+ * <li>changed (but uncommitted)</li>
+ * <li>modified (but uncommitted resources)</li>
+ * <li>removed (but uncommitted resources)</li>
+ * </ul>
*
* @param repository
* the repository to check for uncommitted changes
@@ -788,7 +812,9 @@
hasChanges |= !repoStatus.getAdded().isEmpty();
hasChanges |= !repoStatus.getChanged().isEmpty();
hasChanges |= !repoStatus.getModified().isEmpty();
- hasChanges |= repoStatus.getRemoved().isEmpty();
+ hasChanges |= !repoStatus.getRemoved().isEmpty();
+ hasChanges |= !repoStatus.getConflicting().isEmpty();
+ hasChanges |= !repoStatus.getMissing().isEmpty();
return hasChanges;
}
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2012-01-30 17:10:03 UTC (rev 38279)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2012-01-30 17:20:58 UTC (rev 38280)
@@ -3,6 +3,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
import java.io.File;
import java.io.IOException;
@@ -17,6 +18,7 @@
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.StoredConfig;
+import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.openshift.egit.core.EGitUtils;
import org.jboss.tools.openshift.egit.internal.test.util.TestProject;
import org.jboss.tools.openshift.egit.internal.test.util.TestRepository;
@@ -190,4 +192,43 @@
assertTrue(subsections.contains(remoteName));
assertEquals(gitUri, config.getString(ConfigConstants.CONFIG_REMOTE_SECTION, remoteName, ConfigConstants.CONFIG_KEY_URL));
}
+
+ @Test
+ public void addedButNotCommittedIsDirty() throws IOException {
+ assertFalse(EGitUtils.isDirty(testRepository.getRepository()));
+ File file = testRepository.createFile("a.txt", "protoculture");
+ testRepository.add(file);
+ assertTrue(EGitUtils.isDirty(testRepository.getRepository()));
+ }
+
+ @Test
+ public void changedButNotCommittedIsDirty() throws Exception {
+ assertFalse(EGitUtils.isDirty(testRepository.getRepository()));
+ File file = testRepository.createFile("a.txt", "ethnica");
+ testRepository.addAndCommit(file, "commit-by-junit-tests");
+ assertFalse(EGitUtils.isDirty(testRepository.getRepository()));
+ FileUtil.writeFileDefault(file, "depeche-mode");
+ testRepository.add(file);
+ assertTrue(EGitUtils.isDirty(testRepository.getRepository()));
+ }
+
+ @Test
+ public void modifiedButNotCommittedIsDirty() throws Exception {
+ assertFalse(EGitUtils.isDirty(testRepository.getRepository()));
+ File file = testRepository.createFile("a.txt", "protonica");
+ testRepository.addAndCommit(file, "commit-by-junit-tests");
+ FileUtil.writeFileDefault(file, "atrix");
+ assertTrue(EGitUtils.isDirty(testRepository.getRepository()));
+ }
+
+ @Test
+ public void removedButNotCommittedIsDirty() throws Exception {
+ assertFalse(EGitUtils.isDirty(testRepository.getRepository()));
+ File file = testRepository.createFile("a.txt", "protonica");
+ testRepository.addAndCommit(file, "commit-by-junit-tests");
+ assertFalse(EGitUtils.isDirty(testRepository.getRepository()));
+ file.delete();
+ assertTrue(EGitUtils.isDirty(testRepository.getRepository()));
+ }
+
}
12 years, 11 months
JBoss Tools SVN: r38279 - in trunk/central/plugins/org.jboss.tools.central.discovery: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-01-30 12:10:03 -0500 (Mon, 30 Jan 2012)
New Revision: 38279
Added:
trunk/central/plugins/org.jboss.tools.central.discovery/images/testng_32.gif
Removed:
trunk/central/plugins/org.jboss.tools.central.discovery/images/testng_16.gif
Modified:
trunk/central/plugins/org.jboss.tools.central.discovery/plugin.xml
Log:
switch to testng 32-bit icon for size consistency w/ others
Deleted: trunk/central/plugins/org.jboss.tools.central.discovery/images/testng_16.gif
===================================================================
(Binary files differ)
Added: trunk/central/plugins/org.jboss.tools.central.discovery/images/testng_32.gif
===================================================================
--- trunk/central/plugins/org.jboss.tools.central.discovery/images/testng_32.gif (rev 0)
+++ trunk/central/plugins/org.jboss.tools.central.discovery/images/testng_32.gif 2012-01-30 17:10:03 UTC (rev 38279)
@@ -0,0 +1,2 @@
+GIF89a
+
\ No newline at end of file
Modified: trunk/central/plugins/org.jboss.tools.central.discovery/plugin.xml
===================================================================
--- trunk/central/plugins/org.jboss.tools.central.discovery/plugin.xml 2012-01-30 16:34:03 UTC (rev 38278)
+++ trunk/central/plugins/org.jboss.tools.central.discovery/plugin.xml 2012-01-30 17:10:03 UTC (rev 38279)
@@ -290,7 +290,7 @@
provider="Cedric Beust"
siteUrl="http://download.jboss.org/jbosstools/updates/indigo/extras/">
<icon
- image32="images/testng_16.gif">
+ image32="images/testng_32.gif">
</icon>
<overview
summary="TestNG plug-in for Eclipse"
12 years, 11 months
JBoss Tools SVN: r38278 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-01-30 11:34:03 -0500 (Mon, 30 Jan 2012)
New Revision: 38278
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt
Log:
Modifying TODO list
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt 2012-01-30 16:33:22 UTC (rev 38277)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/todo.txt 2012-01-30 16:34:03 UTC (rev 38278)
@@ -1 +1,4 @@
-* manually add resteasy libs to project with EAP target server (RESTfulTestBase)
\ No newline at end of file
+* Fix AnnotationProperties to be able to change Annotation parameter value
+* Complete AnnotationPropertiesTest
+* Complete multiple tests run (against AS 7 and EAP 5.1)
+* Complete maven integration
\ No newline at end of file
12 years, 11 months
JBoss Tools SVN: r38277 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-01-30 11:33:22 -0500 (Mon, 30 Jan 2012)
New Revision: 38277
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
Log:
Modifying WSAllBotTests to include new AnnotationPropertiesTest as well
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2012-01-30 16:32:36 UTC (rev 38276)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2012-01-30 16:33:22 UTC (rev 38277)
@@ -11,6 +11,7 @@
package org.jboss.tools.ws.ui.bot.test;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ws.ui.bot.test.annotation.AnnotationPropertiesTest;
import org.jboss.tools.ws.ui.bot.test.rest.completion.RESTfulCompletionTest;
import org.jboss.tools.ws.ui.bot.test.rest.explorer.RESTfulExplorerTest;
import org.jboss.tools.ws.ui.bot.test.rest.explorer.RESTfulSupportTest;
@@ -53,6 +54,7 @@
SampleRESTWebServiceTest.class,
SimpleSoapWebServiceTest.class,
SimpleRESTWebServiceTest.class,
+ AnnotationPropertiesTest.class,
RESTfulSupportTest.class,
RESTfulExplorerTest.class,
RESTfulValidationTest.class,
12 years, 11 months
JBoss Tools SVN: r38276 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/annotation.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-01-30 11:32:36 -0500 (Mon, 30 Jan 2012)
New Revision: 38276
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/annotation/AnnotationPropertiesTest.java
Log:
Template of new ws bot test added
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/annotation/AnnotationPropertiesTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/annotation/AnnotationPropertiesTest.java (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/annotation/AnnotationPropertiesTest.java 2012-01-30 16:32:36 UTC (rev 38276)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.ws.ui.bot.test.annotation;
+
+import org.jboss.tools.ws.ui.bot.test.rest.RESTfulTestBase;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class AnnotationPropertiesTest extends RESTfulTestBase {
+
+
+ @Override
+ public String getWsProjectName() {
+ return "AnnotationViewTest";
+ }
+
+ @Override
+ public String getWsPackage() {
+ return "org.ws.annotation.properties.test";
+ }
+
+ @Override
+ public String getWsName() {
+ return "WSService";
+ }
+
+ /**
+ * 1 there are no incorrectly checked annotations
+ * 2 there are no incorrectly unchecked annotations
+ */
+ @Test
+ public void testAbsenceOfAnnotation() {
+
+ }
+
+ /**
+ * 1 there are correctly checked annotations
+ * 2 there are correctly unchecked annotations
+ */
+ @Test
+ public void testPresenceOfAnnotation() {
+
+ }
+
+ /**
+ * 1 check equality of param values
+ * 2 changing param values is mirrored to class
+ */
+ @Test
+ public void testAnnotationParamValues() {
+
+ }
+
+ /**
+ * 1 activating annotation through view is mirrored to class
+ */
+ @Test
+ public void testAnnotationActivating() {
+
+ }
+
+ /**
+ * 1 deactivating annotation through view is mirrored to class
+ */
+ @Test
+ public void testAnnotationDeactivating() {
+
+ }
+
+}
12 years, 11 months