JBoss Tools SVN: r41690 - trunk/documentation/whatsnew/openshift/images.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-06-04 14:19:06 -0400 (Mon, 04 Jun 2012)
New Revision: 41690
Added:
trunk/documentation/whatsnew/openshift/images/also-add-mysql.png
trunk/documentation/whatsnew/openshift/images/gears-and-scaling.png
Log:
[JBIDE-11950] writing N&N for openshift
Added: trunk/documentation/whatsnew/openshift/images/also-add-mysql.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/also-add-mysql.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/images/gears-and-scaling.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/gears-and-scaling.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
13 years, 4 months
JBoss Tools SVN: r41689 - in trunk/documentation/whatsnew/openshift: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-06-04 14:18:48 -0400 (Mon, 04 Jun 2012)
New Revision: 41689
Added:
trunk/documentation/whatsnew/openshift/images/keep-waiting.png
trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.CR1.html
Log:
[JBIDE-11950] writing N&N for openshift
Added: trunk/documentation/whatsnew/openshift/images/keep-waiting.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/openshift/images/keep-waiting.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.CR1.html
===================================================================
--- trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.CR1.html (rev 0)
+++ trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.CR1.html 2012-06-04 18:18:48 UTC (rev 41689)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!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">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>OpenShift Tools 2.3.0.CR1 What's New</title>
+<script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push([ '_setAccount', 'UA-17645367-5' ]);
+ _gaq.push([ '_trackPageview' ]);
+
+ (function() {
+ var ga = document.createElement('script');
+ ga.type = 'text/javascript';
+ ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl'
+ : 'http://www')
+ + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(ga, s);
+ })();
+</script>
+</head>
+<body>
+ <h1>OpenShift 2.3.0.CR1 What's New</h1>
+
+ <p align="right">
+ <a href="../index.html">< Main Index</a> <a
+ href="../maven/maven-news-3.3.0.Beta3.html">Maven Tools ></a>
+ </p>
+ <table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>General</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <a name="itemname3" id="itemname3"></a>
+ <b>Plenty of bugfixes</b>
+ </td>
+ <td valign="top">
+ As always when getting closer to GA, we very much focus on fixing bugs.
+ We tackled a total of 82 issues and improvements in the CR1 iteration.
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>OpenShift Application Wizards</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <b>Handling timeouts gracefully</b><p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-11314">Related Jira</a>
+ </small>
+ </p>
+
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <b>Required embedded cartridges</b>
+ </td>
+ <td valign="top">
+ We now assist you when you add or remove embedded cartridges. We tell you what additional cartridges you'll
+ need if you add a cartridge. We also tell you about conflicting ones that have to be removed first.
+ <p><img src="images/also-add-mysql.png" alt="also add mysql"/></p>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-10852">Related Jira</a>
+ </small>
+ </p>
+
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left">
+ <b>Gears and scalable applications</b>
+ </td>
+ <td valign="top">
+ OpenShift gears constrain the resources an application may consume.
+ <p><img src="images/gears-and-scaling.png" alt="gear and scaling"/></p>
+ <p>
+ <small>
+ <a href="https://issues.jboss.org/browse/JBIDE-11505">Related Jira</a>
+ </small>
+ </p>
+
+ </td>
+ </tr> </table>
+</body>
+
+</html>
+
+
Property changes on: trunk/documentation/whatsnew/openshift/openshift-news-2.3.0.CR1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 4 months
JBoss Tools SVN: r41688 - in trunk/maven: tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-06-04 11:53:42 -0400 (Mon, 04 Jun 2012)
New Revision: 41688
Added:
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/pom.xml
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/Bar.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/resources/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/test/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/test/java/
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/test/resources/
Modified:
trunk/maven/plugins/org.jboss.tools.maven.jdt/src/org/jboss/tools/maven/jdt/configurators/EndorsedLibProjectConfigurator.java
trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/EndorsedLibConfiguratorTest.java
Log:
JBIDE-12092 : Fix Endorsed Libraries configurator doesn't support quotes in <compilerArgument>
Modified: trunk/maven/plugins/org.jboss.tools.maven.jdt/src/org/jboss/tools/maven/jdt/configurators/EndorsedLibProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.jdt/src/org/jboss/tools/maven/jdt/configurators/EndorsedLibProjectConfigurator.java 2012-06-04 15:43:42 UTC (rev 41687)
+++ trunk/maven/plugins/org.jboss.tools.maven.jdt/src/org/jboss/tools/maven/jdt/configurators/EndorsedLibProjectConfigurator.java 2012-06-04 15:53:42 UTC (rev 41688)
@@ -132,7 +132,7 @@
MojoExecution mojoExecution = getCompilerMojoExecution(mavenProjectFacade, session, monitor);
//Parse <compilerArgument> for -Djava.endorsed.dirs
- String compilerArgument = maven.getMojoParameterValue(session, mojoExecution, "compilerArgument", String.class);
+ String compilerArgument = maven.getMojoParameterValue(session, mojoExecution, "compilerArgument", String.class);//
File[] javaEndorsedDirs = parseJavaEndorsedDirs(mavenProjectFacade.getProject(), compilerArgument);
//Check <compilerArguments> for <endorseddirs>
@@ -148,12 +148,29 @@
if (compilerArgument == null) {
return null;
}
- Matcher matcher = jAVA_ENDORSED_DIRS_PATTERN.matcher(compilerArgument);
- if (matcher.matches()) {
- String endorsedDirs = matcher.group(1);
- return parseEndorsedDirs(project, endorsedDirs);
+
+ //We can expect patterns like -Djava.endorsed.dirs=/path/white space/dir" "-Dfoo=bar
+ //as a workaround for maven-compiler-plugin <compilerArgument> not handling multiple values correctly
+ //So instead of using rexeps to parse the path, we manually look for the presence of quotes and spaces
+ String key = "-Djava.endorsed.dirs=";
+ int start = compilerArgument.indexOf(key);
+ if (start < 0) {
+ return null;
}
- return null;
+ File[] dirs = null;
+ int end = compilerArgument.indexOf("\"", start);
+ if (end < 0) {
+ end = compilerArgument.indexOf(" ", start);
+ if (end < 0) {
+ end = compilerArgument.length();
+ }
+ }
+ if (end > 0) {
+ String argument = compilerArgument.substring(start+key.length(), end);
+ dirs = parseEndorsedDirs(project, argument);
+
+ }
+ return dirs;
}
private File[] parseEndorsedDirs(IProject project, String endorsedDirs) {
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/pom.xml
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/pom.xml (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/pom.xml 2012-06-04 15:53:42 UTC (rev 41688)
@@ -0,0 +1,84 @@
+<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>foo.bar</groupId>
+ <artifactId>endorsing_quotehack</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <compilerArgument>-Djava.endorsed.dirs=${basedir}/target/end orsed" "-Dfoo=bar</compilerArgument>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/end orsed</outputDirectory>
+
+ <artifactItems>
+ <artifactItem>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <type>jar</type>
+ <overWrite>false</overWrite>
+ <destFileName>optional-new-name.jar</destFileName>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.apache.maven.plugins
+ </groupId>
+ <artifactId>
+ maven-dependency-plugin
+ </artifactId>
+ <versionRange>
+ [2.1,)
+ </versionRange>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/Bar.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/Bar.java (rev 0)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/Bar.java 2012-06-04 15:53:42 UTC (rev 41688)
@@ -0,0 +1,7 @@
+package foo;
+
+import junit.framework.Assert;
+
+public class Bar extends Assert {
+
+}
Modified: trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/EndorsedLibConfiguratorTest.java
===================================================================
--- trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/EndorsedLibConfiguratorTest.java 2012-06-04 15:43:42 UTC (rev 41687)
+++ trunk/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/EndorsedLibConfiguratorTest.java 2012-06-04 15:53:42 UTC (rev 41688)
@@ -70,7 +70,52 @@
ClasspathHelpers.isEndorsedDirsClasspathContainer(classpath[0].getPath()));
}
+
@Test
+ public void testJBIDE11738_quote_hack_support() throws Exception {
+ String projectLocation = "projects/endorsed_lib/endorsing_quotehack";
+ IProject endorsing = importProject(projectLocation+"/pom.xml");
+ endorsing.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
+ waitForJobsToComplete();
+
+ //When the project is imported, the endorsed dir doesn't exist, so we should see
+ //compilation errors and a marker about that missing Endorsed dir
+ List<IMarker> errors = findErrorMarkers(endorsing);
+ assertEquals(toString(errors), 3, errors.size());
+ IMarker marker = errors.get(2);
+ String error = getMessage(marker);
+ assertTrue("Unexpected error message :"+error, error.startsWith("Endorsed dir"));
+
+ //Since the endorsed dir is missing, no Endorsed Libraries classpath library
+ //is added to the project's classpath
+ IJavaProject javaProject = JavaCore.create(endorsing);
+ IClasspathEntry[] classpath = javaProject.getRawClasspath();
+ assertFalse("Endorsed Lib should not have been added",
+ ClasspathHelpers.isEndorsedDirsClasspathContainer(classpath[0].getPath()));
+
+ //Now let's fix the project
+
+ //Check quick fix is available
+ MissingEndorsedLibMarkerResolutionGenerator generator = new MissingEndorsedLibMarkerResolutionGenerator();
+ assertTrue("project should be fixable", generator.hasResolutions(marker));
+ IMarkerResolution[] resolutions = generator.getResolutions(marker);
+ assertEquals(1, resolutions.length);
+ //Execute quick fix
+ resolutions[0].run(marker);
+ waitForJobsToComplete();
+ endorsing.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
+ waitForJobsToComplete();
+
+ //Check it compiles properly now
+ assertNoErrors(endorsing);
+
+ //And Endorsed Libraries is added first on the classpath
+ classpath = javaProject.getRawClasspath();
+ assertTrue("Endorsed Lib should have been added first",
+ ClasspathHelpers.isEndorsedDirsClasspathContainer(classpath[0].getPath()));
+ }
+
+ @Test
public void testJBIDE11738_non_fixable_endorsed_libraries() throws Exception {
String projectLocation = "projects/endorsed_lib/broken_endorsing";
IProject endorsing = importProject(projectLocation+"/pom.xml");
13 years, 4 months
JBoss Tools SVN: r41687 - in trunk/ws: plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-06-04 11:43:42 -0400 (Mon, 04 Jun 2012)
New Revision: 41687
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtilsTestCase.java
Log:
Fixed - JBIDE-11886
NPE when adding PathParam annotation through Annotation Properties view
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java 2012-06-04 15:38:47 UTC (rev 41686)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java 2012-06-04 15:43:42 UTC (rev 41687)
@@ -233,7 +233,7 @@
private void refreshUriPathTemplate() {
// compute the URI Path Template from the chain of Methods/Resources
StringBuilder uriPathTemplateBuilder = new StringBuilder();
- if (application != null) {
+ if (application != null && application.getApplicationPath() != null) {
uriPathTemplateBuilder.append(application.getApplicationPath());
}
for (JaxrsResourceMethod resourceMethod : resourceMethods) {
@@ -266,8 +266,10 @@
for (Iterator<JavaMethodParameter> iterator = matrixParameters.iterator(); iterator.hasNext();) {
JavaMethodParameter matrixParam = iterator.next();
final Annotation matrixParamAnnotation = matrixParam.getAnnotation(MatrixParam.class.getName());
- uriPathTemplateBuilder.append(";").append(matrixParamAnnotation.getValue("value")).append("={")
- .append(matrixParam.getTypeName()).append("}");
+ if(matrixParamAnnotation.getValue("value") != null) {
+ uriPathTemplateBuilder.append(";").append(matrixParamAnnotation.getValue("value")).append("={")
+ .append(matrixParam.getTypeName()).append("}");
+ }
}
}
@@ -286,18 +288,20 @@
JavaMethodParameter queryParam = iterator.next();
final Annotation queryParamAnnotation = queryParam.getAnnotation(QueryParam.class.getName());
final String paramName = queryParamAnnotation.getValue("value");
- final String paramType = queryParam.getTypeName();
- uriPathTemplateBuilder.append(paramName).append("={");
- uriPathTemplateBuilder.append(paramName).append(":").append(paramType);
- final Annotation defaultValueAnnotation = queryParam.getAnnotation(DefaultValue.class.getName());
- if (defaultValueAnnotation != null) {
- uriPathTemplateBuilder.append('=').append(defaultValueAnnotation.getValue("value"));
+ if(paramName != null) {
+ final String paramType = queryParam.getTypeName();
+ uriPathTemplateBuilder.append(paramName).append("={");
+ uriPathTemplateBuilder.append(paramName).append(":").append(paramType);
+ final Annotation defaultValueAnnotation = queryParam.getAnnotation(DefaultValue.class.getName());
+ if (defaultValueAnnotation != null) {
+ uriPathTemplateBuilder.append('=').append(defaultValueAnnotation.getValue("value"));
+ }
+ uriPathTemplateBuilder.append('}');
+
+ if (iterator.hasNext()) {
+ uriPathTemplateBuilder.append('&');
+ }
}
- uriPathTemplateBuilder.append('}');
-
- if (iterator.hasNext()) {
- uriPathTemplateBuilder.append('&');
- }
}
}
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java 2012-06-04 15:38:47 UTC (rev 41686)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java 2012-06-04 15:43:42 UTC (rev 41687)
@@ -172,6 +172,9 @@
@Override
public final int compareTo(final IJaxrsHttpMethod other) {
+ if(this.getHttpVerb() == null) {
+ return 1;
+ }
if (this.getHttpVerb().equals(other.getHttpVerb())) {
return 0;
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java 2012-06-04 15:38:47 UTC (rev 41686)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java 2012-06-04 15:43:42 UTC (rev 41687)
@@ -276,7 +276,7 @@
for (JavaMethodParameter parameter : this.javaMethodParameters) {
final Annotation annotation = parameter
.getAnnotation(PathParam.class.getName());
- if (annotation != null
+ if (annotation != null && annotation.getValue("value") != null
&& annotation.getValue("value").equals(proposal)) {
matching = true;
break;
@@ -309,14 +309,16 @@
.getAnnotation(PathParam.class.getName());
if (annotation != null) {
final String value = annotation.getValue("value");
- if (!pathParamValueProposals.contains(value)) {
- final String msg = NLS
- .bind(ValidationMessages.INVALID_PATHPARAM_VALUE,
- pathParamValueProposals);
- final TypedRegion region = annotation.getRegion();
- ValidatorMessage validationMsg = createValidationMessage(msg, IMarker.SEVERITY_ERROR, region.getOffset(), region.getLength());
- hasErrors(true);
- messages.add(validationMsg);
+ if(value != null) {
+ if (!pathParamValueProposals.contains(value)) {
+ final String msg = NLS
+ .bind(ValidationMessages.INVALID_PATHPARAM_VALUE,
+ pathParamValueProposals);
+ final TypedRegion region = annotation.getRegion();
+ ValidatorMessage validationMsg = createValidationMessage(msg, IMarker.SEVERITY_ERROR, region.getOffset(), region.getLength());
+ hasErrors(true);
+ messages.add(validationMsg);
+ }
}
}
}
@@ -484,7 +486,7 @@
public List<String> getPathParamValueProposals() {
final List<String> proposals = new ArrayList<String>();
final Annotation methodPathAnnotation = getPathAnnotation();
- if (methodPathAnnotation != null) {
+ if (methodPathAnnotation != null && methodPathAnnotation.getValue("value") != null) {
final String value = methodPathAnnotation.getValue("value");
proposals.addAll(extractParamsFromUriTemplateFragment(value));
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-06-04 15:38:47 UTC (rev 41686)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-06-04 15:43:42 UTC (rev 41687)
@@ -138,12 +138,14 @@
final Map<String, List<String>> annotationElements = new HashMap<String, List<String>>();
for (IMemberValuePairBinding binding : annotationBinding.getAllMemberValuePairs()) {
final List<String> values = new ArrayList<String>();
- if (binding.getValue() instanceof Object[]) {
- for (Object v : (Object[]) binding.getValue()) {
- values.add(v.toString());
+ if(binding.getValue() != null) {
+ if (binding.getValue() instanceof Object[]) {
+ for (Object v : (Object[]) binding.getValue()) {
+ values.add(v.toString());
+ }
+ } else {
+ values.add(binding.getValue().toString());
}
- } else {
- values.add(binding.getValue().toString());
}
annotationElements.put(binding.getName(), values);
}
Modified: trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtilsTestCase.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtilsTestCase.java 2012-06-04 15:38:47 UTC (rev 41686)
+++ trunk/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtilsTestCase.java 2012-06-04 15:43:42 UTC (rev 41687)
@@ -30,6 +30,7 @@
import javax.ws.rs.GET;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
@@ -454,6 +455,22 @@
}
@Test
+ public void shouldResolveJavaMethodSignaturesWithNullAnnotationValue() throws CoreException {
+ // pre-condition
+ final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
+ IMethod method = WorkbenchUtils.getMethod(type, "getCustomer");
+ method = WorkbenchUtils.replaceFirstOccurrenceOfCode(method, "@PathParam(\"id\") Integer id", "@PathParam() Integer id",
+ false);
+ // operation
+ final JavaMethodSignature methodSignature = JdtUtils.resolveMethodSignature(method,
+ JdtUtils.parse(type, progressMonitor));
+ // verification
+ Assert.assertNotNull(methodSignature);
+ Assert.assertEquals(2, methodSignature.getMethodParameters().size());
+ Assert.assertNull(methodSignature.getMethodParameters().get(0).getAnnotation(PathParam.class.getName()).getValue("value"));
+ }
+
+ @Test
public void shouldResolveJavaMethodSignaturesForParameterizedType() throws CoreException {
final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.ParameterizedResource");
// operation
13 years, 4 months
JBoss Tools SVN: r41686 - in branches/jbosstools-3.3.x/ws: plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-06-04 11:38:47 -0400 (Mon, 04 Jun 2012)
New Revision: 41686
Modified:
branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java
branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java
branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java
branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
branches/jbosstools-3.3.x/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtilsTestCase.java
Log:
Fixed - JBIDE-11886
NPE when adding PathParam annotation through Annotation Properties view
Modified: branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java
===================================================================
--- branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java 2012-06-04 15:37:24 UTC (rev 41685)
+++ branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsEndpoint.java 2012-06-04 15:38:47 UTC (rev 41686)
@@ -233,7 +233,7 @@
private void refreshUriPathTemplate() {
// compute the URI Path Template from the chain of Methods/Resources
StringBuilder uriPathTemplateBuilder = new StringBuilder();
- if (application != null) {
+ if (application != null && application.getApplicationPath() != null) {
uriPathTemplateBuilder.append(application.getApplicationPath());
}
for (JaxrsResourceMethod resourceMethod : resourceMethods) {
@@ -266,8 +266,10 @@
for (Iterator<JavaMethodParameter> iterator = matrixParameters.iterator(); iterator.hasNext();) {
JavaMethodParameter matrixParam = iterator.next();
final Annotation matrixParamAnnotation = matrixParam.getAnnotation(MatrixParam.class.getName());
- uriPathTemplateBuilder.append(";").append(matrixParamAnnotation.getValue("value")).append("={")
- .append(matrixParam.getTypeName()).append("}");
+ if(matrixParamAnnotation.getValue("value") != null) {
+ uriPathTemplateBuilder.append(";").append(matrixParamAnnotation.getValue("value")).append("={")
+ .append(matrixParam.getTypeName()).append("}");
+ }
}
}
@@ -286,18 +288,20 @@
JavaMethodParameter queryParam = iterator.next();
final Annotation queryParamAnnotation = queryParam.getAnnotation(QueryParam.class.getName());
final String paramName = queryParamAnnotation.getValue("value");
- final String paramType = queryParam.getTypeName();
- uriPathTemplateBuilder.append(paramName).append("={");
- uriPathTemplateBuilder.append(paramName).append(":").append(paramType);
- final Annotation defaultValueAnnotation = queryParam.getAnnotation(DefaultValue.class.getName());
- if (defaultValueAnnotation != null) {
- uriPathTemplateBuilder.append('=').append(defaultValueAnnotation.getValue("value"));
+ if(paramName != null) {
+ final String paramType = queryParam.getTypeName();
+ uriPathTemplateBuilder.append(paramName).append("={");
+ uriPathTemplateBuilder.append(paramName).append(":").append(paramType);
+ final Annotation defaultValueAnnotation = queryParam.getAnnotation(DefaultValue.class.getName());
+ if (defaultValueAnnotation != null) {
+ uriPathTemplateBuilder.append('=').append(defaultValueAnnotation.getValue("value"));
+ }
+ uriPathTemplateBuilder.append('}');
+
+ if (iterator.hasNext()) {
+ uriPathTemplateBuilder.append('&');
+ }
}
- uriPathTemplateBuilder.append('}');
-
- if (iterator.hasNext()) {
- uriPathTemplateBuilder.append('&');
- }
}
}
}
Modified: branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java
===================================================================
--- branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java 2012-06-04 15:37:24 UTC (rev 41685)
+++ branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsHttpMethod.java 2012-06-04 15:38:47 UTC (rev 41686)
@@ -172,6 +172,9 @@
@Override
public final int compareTo(final IJaxrsHttpMethod other) {
+ if(this.getHttpVerb() == null) {
+ return 1;
+ }
if (this.getHttpVerb().equals(other.getHttpVerb())) {
return 0;
}
Modified: branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java
===================================================================
--- branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java 2012-06-04 15:37:24 UTC (rev 41685)
+++ branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java 2012-06-04 15:38:47 UTC (rev 41686)
@@ -276,7 +276,7 @@
for (JavaMethodParameter parameter : this.javaMethodParameters) {
final Annotation annotation = parameter
.getAnnotation(PathParam.class.getName());
- if (annotation != null
+ if (annotation != null && annotation.getValue("value") != null
&& annotation.getValue("value").equals(proposal)) {
matching = true;
break;
@@ -309,14 +309,16 @@
.getAnnotation(PathParam.class.getName());
if (annotation != null) {
final String value = annotation.getValue("value");
- if (!pathParamValueProposals.contains(value)) {
- final String msg = NLS
- .bind(ValidationMessages.INVALID_PATHPARAM_VALUE,
- pathParamValueProposals);
- final TypedRegion region = annotation.getRegion();
- ValidatorMessage validationMsg = createValidationMessage(msg, IMarker.SEVERITY_ERROR, region.getOffset(), region.getLength());
- hasErrors(true);
- messages.add(validationMsg);
+ if(value != null) {
+ if (!pathParamValueProposals.contains(value)) {
+ final String msg = NLS
+ .bind(ValidationMessages.INVALID_PATHPARAM_VALUE,
+ pathParamValueProposals);
+ final TypedRegion region = annotation.getRegion();
+ ValidatorMessage validationMsg = createValidationMessage(msg, IMarker.SEVERITY_ERROR, region.getOffset(), region.getLength());
+ hasErrors(true);
+ messages.add(validationMsg);
+ }
}
}
}
@@ -484,7 +486,7 @@
public List<String> getPathParamValueProposals() {
final List<String> proposals = new ArrayList<String>();
final Annotation methodPathAnnotation = getPathAnnotation();
- if (methodPathAnnotation != null) {
+ if (methodPathAnnotation != null && methodPathAnnotation.getValue("value") != null) {
final String value = methodPathAnnotation.getValue("value");
proposals.addAll(extractParamsFromUriTemplateFragment(value));
}
Modified: branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java
===================================================================
--- branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-06-04 15:37:24 UTC (rev 41685)
+++ branches/jbosstools-3.3.x/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/jdt/JavaMethodSignaturesVisitor.java 2012-06-04 15:38:47 UTC (rev 41686)
@@ -138,12 +138,14 @@
final Map<String, List<String>> annotationElements = new HashMap<String, List<String>>();
for (IMemberValuePairBinding binding : annotationBinding.getAllMemberValuePairs()) {
final List<String> values = new ArrayList<String>();
- if (binding.getValue() instanceof Object[]) {
- for (Object v : (Object[]) binding.getValue()) {
- values.add(v.toString());
+ if(binding.getValue() != null) {
+ if (binding.getValue() instanceof Object[]) {
+ for (Object v : (Object[]) binding.getValue()) {
+ values.add(v.toString());
+ }
+ } else {
+ values.add(binding.getValue().toString());
}
- } else {
- values.add(binding.getValue().toString());
}
annotationElements.put(binding.getName(), values);
}
Modified: branches/jbosstools-3.3.x/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtilsTestCase.java
===================================================================
--- branches/jbosstools-3.3.x/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtilsTestCase.java 2012-06-04 15:37:24 UTC (rev 41685)
+++ branches/jbosstools-3.3.x/ws/tests/org.jboss.tools.ws.jaxrs.core.test/src/org/jboss/tools/ws/jaxrs/core/jdt/JdtUtilsTestCase.java 2012-06-04 15:38:47 UTC (rev 41686)
@@ -30,6 +30,7 @@
import javax.ws.rs.GET;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
@@ -454,6 +455,22 @@
}
@Test
+ public void shouldResolveJavaMethodSignaturesWithNullAnnotationValue() throws CoreException {
+ // pre-condition
+ final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.CustomerResource");
+ IMethod method = WorkbenchUtils.getMethod(type, "getCustomer");
+ method = WorkbenchUtils.replaceFirstOccurrenceOfCode(method, "@PathParam(\"id\") Integer id", "@PathParam() Integer id",
+ false);
+ // operation
+ final JavaMethodSignature methodSignature = JdtUtils.resolveMethodSignature(method,
+ JdtUtils.parse(type, progressMonitor));
+ // verification
+ Assert.assertNotNull(methodSignature);
+ Assert.assertEquals(2, methodSignature.getMethodParameters().size());
+ Assert.assertNull(methodSignature.getMethodParameters().get(0).getAnnotation(PathParam.class.getName()).getValue("value"));
+ }
+
+ @Test
public void shouldResolveJavaMethodSignaturesForParameterizedType() throws CoreException {
final IType type = getType("org.jboss.tools.ws.jaxrs.sample.services.ParameterizedResource");
// operation
13 years, 4 months
JBoss Tools SVN: r41685 - in trunk/forge/plugins: org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-06-04 11:37:24 -0400 (Mon, 04 Jun 2012)
New Revision: 41685
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferences.java
trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeLaunchHelper.java
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/preferences/ForgeStartupPreferencePage.java
Log:
JBIDE-11998: Make a preference option that can toggle launching Forge in RUN/DEBUG mode
Modified: trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferences.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferences.java 2012-06-04 15:29:33 UTC (rev 41684)
+++ trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/preferences/ForgeRuntimesPreferences.java 2012-06-04 15:37:24 UTC (rev 41685)
@@ -37,6 +37,7 @@
public static final String PREF_FORGE_RUNTIMES = "org.jboss.tools.forge.core.runtimes";
public static final String PREF_FORGE_STARTUP = "org.jboss.tools.forge.core.startup";
+ public static final String PREF_FORGE_START_IN_DEBUG = "org.jboss.tools.forge.core.startInDebug";
public static final ForgeRuntimesPreferences INSTANCE = new ForgeRuntimesPreferences();
@@ -64,6 +65,10 @@
}
+ public boolean getStartInDebug() {
+ return getForgeCorePreferences().getBoolean(PREF_FORGE_START_IN_DEBUG, false);
+ }
+
private IEclipsePreferences getForgeCorePreferences() {
return InstanceScope.INSTANCE.getNode(ForgeCorePlugin.PLUGIN_ID);
}
@@ -152,13 +157,25 @@
public void setStartup(boolean startup) {
try {
- IEclipsePreferences eclipsePreferences = getForgeCorePreferences();
- eclipsePreferences.putBoolean(PREF_FORGE_STARTUP, startup);
- eclipsePreferences.flush();
+ setBoolean(PREF_FORGE_STARTUP, startup);
} catch (BackingStoreException e) {
ForgeCorePlugin.log(e);
}
}
+
+ public void setStartInDebug(boolean startup) {
+ try {
+ setBoolean(PREF_FORGE_START_IN_DEBUG, startup);
+ } catch (BackingStoreException e) {
+ ForgeCorePlugin.log(e);
+ }
+ }
+
+ private void setBoolean(String prefKey, boolean startup) throws BackingStoreException {
+ IEclipsePreferences eclipsePreferences = getForgeCorePreferences();
+ eclipsePreferences.putBoolean(prefKey, startup);
+ eclipsePreferences.flush();
+ }
public void addPreferenceChangeListener(IPreferenceChangeListener listener) {
getForgeCorePreferences().addPreferenceChangeListener(listener);
Modified: trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeLaunchHelper.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeLaunchHelper.java 2012-06-04 15:29:33 UTC (rev 41684)
+++ trunk/forge/plugins/org.jboss.tools.forge.core/src/org/jboss/tools/forge/core/process/ForgeLaunchHelper.java 2012-06-04 15:37:24 UTC (rev 41685)
@@ -17,6 +17,7 @@
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.jboss.tools.forge.core.ForgeCorePlugin;
+import org.jboss.tools.forge.core.preferences.ForgeRuntimesPreferences;
public class ForgeLaunchHelper {
@@ -65,7 +66,7 @@
if (workingCopy != null) {
try {
LAUNCH_MANAGER.addLaunchListener(new ForgeLaunchListener(launchConfigurationName));
- launch = workingCopy.doSave().launch(ILaunchManager.RUN_MODE, null, false, true);
+ launch = workingCopy.doSave().launch(getLaunchMode(), null, false, true);
} catch (CoreException e) {
ForgeCorePlugin.log(new RuntimeException("Problem while launching working copy.", e));
}
@@ -73,8 +74,11 @@
return launch;
}
+ private static String getLaunchMode() {
+ return ForgeRuntimesPreferences.INSTANCE.getStartInDebug() ?
+ ILaunchManager.DEBUG_MODE : ILaunchManager.RUN_MODE;
+ }
-
private static ILaunchConfigurationWorkingCopy createWorkingCopy(String name, String location) {
ILaunchConfigurationWorkingCopy result = null;
try {
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/preferences/ForgeStartupPreferencePage.java
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/preferences/ForgeStartupPreferencePage.java 2012-06-04 15:29:33 UTC (rev 41684)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/preferences/ForgeStartupPreferencePage.java 2012-06-04 15:37:24 UTC (rev 41685)
@@ -15,11 +15,13 @@
IWorkbenchPreferencePage {
private Button startupButton;
+ private Button startInDebugButton;
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
Composite clientArea = createClientArea(parent);
createStartupButton(clientArea);
+ createStartInDebugButton(clientArea);
return null;
}
@@ -30,12 +32,19 @@
startupButton.setSelection(ForgeRuntimesPreferences.INSTANCE.getStartup());
}
+ private void createStartInDebugButton(Composite parent) {
+ startInDebugButton = new Button(parent, SWT.CHECK);
+ startInDebugButton.setText("Start Forge in Debug Mode." );
+ startInDebugButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ startInDebugButton.setSelection(ForgeRuntimesPreferences.INSTANCE.getStartInDebug());
+ }
+
private Composite createClientArea(Composite parent) {
Composite clientArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
- layout.numColumns = 2;
+ layout.numColumns = 1;
clientArea.setLayout(layout);
- GridData gridData = new GridData(GridData.FILL_BOTH);
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
clientArea.setLayoutData(gridData);
return clientArea;
}
@@ -44,6 +53,7 @@
public boolean performOk() {
ForgeRuntimesPreferences.INSTANCE.setStartup(startupButton.getSelection());
+ ForgeRuntimesPreferences.INSTANCE.setStartInDebug(startInDebugButton.getSelection());
return true;
}
}
13 years, 4 months
JBoss Tools SVN: r41684 - in branches/jbosstools-3.3.x/maven: tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-06-04 11:29:33 -0400 (Mon, 04 Jun 2012)
New Revision: 41684
Added:
branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/
branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/pom.xml
branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/
branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/
branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/
branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/
branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/Bar.java
Modified:
branches/jbosstools-3.3.x/maven/plugins/org.jboss.tools.maven.jdt/src/org/jboss/tools/maven/jdt/configurators/EndorsedLibProjectConfigurator.java
branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/EndorsedLibConfiguratorTest.java
Log:
JBIDE-12092 : Fix Endorsed Libraries configurator doesn't support quotes in <compilerArgument>
Modified: branches/jbosstools-3.3.x/maven/plugins/org.jboss.tools.maven.jdt/src/org/jboss/tools/maven/jdt/configurators/EndorsedLibProjectConfigurator.java
===================================================================
--- branches/jbosstools-3.3.x/maven/plugins/org.jboss.tools.maven.jdt/src/org/jboss/tools/maven/jdt/configurators/EndorsedLibProjectConfigurator.java 2012-06-04 15:21:22 UTC (rev 41683)
+++ branches/jbosstools-3.3.x/maven/plugins/org.jboss.tools.maven.jdt/src/org/jboss/tools/maven/jdt/configurators/EndorsedLibProjectConfigurator.java 2012-06-04 15:29:33 UTC (rev 41684)
@@ -132,7 +132,7 @@
MojoExecution mojoExecution = getCompilerMojoExecution(mavenProjectFacade, session, monitor);
//Parse <compilerArgument> for -Djava.endorsed.dirs
- String compilerArgument = maven.getMojoParameterValue(session, mojoExecution, "compilerArgument", String.class);
+ String compilerArgument = maven.getMojoParameterValue(session, mojoExecution, "compilerArgument", String.class);//
File[] javaEndorsedDirs = parseJavaEndorsedDirs(mavenProjectFacade.getProject(), compilerArgument);
//Check <compilerArguments> for <endorseddirs>
@@ -148,12 +148,29 @@
if (compilerArgument == null) {
return null;
}
- Matcher matcher = jAVA_ENDORSED_DIRS_PATTERN.matcher(compilerArgument);
- if (matcher.matches()) {
- String endorsedDirs = matcher.group(1);
- return parseEndorsedDirs(project, endorsedDirs);
+
+ //We can expect patterns like -Djava.endorsed.dirs=/path/white space/dir" "-Dfoo=bar
+ //as a workaround for maven-compiler-plugin <compilerArgument> not handling multiple values correctly
+ //So instead of using rexeps to parse the path, we manually look for the presence of quotes and spaces
+ String key = "-Djava.endorsed.dirs=";
+ int start = compilerArgument.indexOf(key);
+ if (start < 0) {
+ return null;
}
- return null;
+ File[] dirs = null;
+ int end = compilerArgument.indexOf("\"", start);
+ if (end < 0) {
+ end = compilerArgument.indexOf(" ", start);
+ if (end < 0) {
+ end = compilerArgument.length();
+ }
+ }
+ if (end > 0) {
+ String argument = compilerArgument.substring(start+key.length(), end);
+ dirs = parseEndorsedDirs(project, argument);
+
+ }
+ return dirs;
}
private File[] parseEndorsedDirs(IProject project, String endorsedDirs) {
Added: branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/pom.xml
===================================================================
--- branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/pom.xml (rev 0)
+++ branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/pom.xml 2012-06-04 15:29:33 UTC (rev 41684)
@@ -0,0 +1,84 @@
+<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>foo.bar</groupId>
+ <artifactId>endorsing_quotehack</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <compilerArgument>-Djava.endorsed.dirs=${basedir}/target/end orsed" "-Dfoo=bar</compilerArgument>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/end orsed</outputDirectory>
+
+ <artifactItems>
+ <artifactItem>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <type>jar</type>
+ <overWrite>false</overWrite>
+ <destFileName>optional-new-name.jar</destFileName>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ org.apache.maven.plugins
+ </groupId>
+ <artifactId>
+ maven-dependency-plugin
+ </artifactId>
+ <versionRange>
+ [2.1,)
+ </versionRange>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
Added: branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/Bar.java
===================================================================
--- branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/Bar.java (rev 0)
+++ branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/projects/endorsed_lib/endorsing_quotehack/src/main/java/foo/Bar.java 2012-06-04 15:29:33 UTC (rev 41684)
@@ -0,0 +1,7 @@
+package foo;
+
+import junit.framework.Assert;
+
+public class Bar extends Assert {
+
+}
Modified: branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/EndorsedLibConfiguratorTest.java
===================================================================
--- branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/EndorsedLibConfiguratorTest.java 2012-06-04 15:21:22 UTC (rev 41683)
+++ branches/jbosstools-3.3.x/maven/tests/org.jboss.tools.maven.configurators.tests/src/org/jboss/tools/maven/configurators/tests/EndorsedLibConfiguratorTest.java 2012-06-04 15:29:33 UTC (rev 41684)
@@ -70,7 +70,52 @@
ClasspathHelpers.isEndorsedDirsClasspathContainer(classpath[0].getPath()));
}
+
@Test
+ public void testJBIDE11738_quote_hack_support() throws Exception {
+ String projectLocation = "projects/endorsed_lib/endorsing_quotehack";
+ IProject endorsing = importProject(projectLocation+"/pom.xml");
+ endorsing.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
+ waitForJobsToComplete();
+
+ //When the project is imported, the endorsed dir doesn't exist, so we should see
+ //compilation errors and a marker about that missing Endorsed dir
+ List<IMarker> errors = findErrorMarkers(endorsing);
+ assertEquals(toString(errors), 3, errors.size());
+ IMarker marker = errors.get(2);
+ String error = getMessage(marker);
+ assertTrue("Unexpected error message :"+error, error.startsWith("Endorsed dir"));
+
+ //Since the endorsed dir is missing, no Endorsed Libraries classpath library
+ //is added to the project's classpath
+ IJavaProject javaProject = JavaCore.create(endorsing);
+ IClasspathEntry[] classpath = javaProject.getRawClasspath();
+ assertFalse("Endorsed Lib should not have been added",
+ ClasspathHelpers.isEndorsedDirsClasspathContainer(classpath[0].getPath()));
+
+ //Now let's fix the project
+
+ //Check quick fix is available
+ MissingEndorsedLibMarkerResolutionGenerator generator = new MissingEndorsedLibMarkerResolutionGenerator();
+ assertTrue("project should be fixable", generator.hasResolutions(marker));
+ IMarkerResolution[] resolutions = generator.getResolutions(marker);
+ assertEquals(1, resolutions.length);
+ //Execute quick fix
+ resolutions[0].run(marker);
+ waitForJobsToComplete();
+ endorsing.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
+ waitForJobsToComplete();
+
+ //Check it compiles properly now
+ assertNoErrors(endorsing);
+
+ //And Endorsed Libraries is added first on the classpath
+ classpath = javaProject.getRawClasspath();
+ assertTrue("Endorsed Lib should have been added first",
+ ClasspathHelpers.isEndorsedDirsClasspathContainer(classpath[0].getPath()));
+ }
+
+ @Test
public void testJBIDE11738_non_fixable_endorsed_libraries() throws Exception {
String projectLocation = "projects/endorsed_lib/broken_endorsing";
IProject endorsing = importProject(projectLocation+"/pom.xml");
13 years, 4 months
JBoss Tools SVN: r41683 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-06-04 11:21:22 -0400 (Mon, 04 Jun 2012)
New Revision: 41683
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
Log:
Closing of welcome screen did not work on Maven. Closing and opening java perspective instead.
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2012-06-04 14:29:35 UTC (rev 41682)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2012-06-04 15:21:22 UTC (rev 41683)
@@ -31,7 +31,6 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.ui.bot.ext.gen.ActionItem;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.logging.WidgetsLogger;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.types.IDELabel.PreferencesDialog;
import org.jboss.tools.ui.bot.ext.types.ViewType;
@@ -559,10 +558,13 @@
// do nothing there is no Atlassian Connector installed
}
+ // Get rid of welcome screen. Simple close did not work when run in maven
try {
- bot.cTabItem("Welcome").close();
+ bot.menu("Window").menu("Close Perspective").click();
+ SWTBotFactory.getOpen().perspective(ActionItem.Perspective.JAVA.LABEL);
} catch (WidgetNotFoundException e){
// ok, Welcome screen not present
+ log.info("Welcome window not present");
}
}
/**
13 years, 4 months
JBoss Tools SVN: r41682 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-06-04 10:29:35 -0400 (Mon, 04 Jun 2012)
New Revision: 41682
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/VariousProjectsArchiving.java
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeployingArchiveTest.java
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java
Log:
new test VariousProjectArchiving implemented and added into test suite
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-06-04 14:28:58 UTC (rev 41681)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesAllBotTests.java 2012-06-04 14:29:35 UTC (rev 41682)
@@ -21,6 +21,7 @@
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({
ViewIsPresentTest.class,
+ VariousProjectsArchiving.class,
BuildingArchiveNode.class,
BuildingProjectTest.class,
BuildingArchiveTest.class,
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java 2012-06-04 14:28:58 UTC (rev 41681)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/CreatingArchiveTest.java 2012-06-04 14:29:35 UTC (rev 41682)
@@ -54,7 +54,7 @@
}
@Test
- public void testCreatingArchivetWithView() {
+ public void testCreatingArchiveWithView() {
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java 2012-06-04 14:28:58 UTC (rev 41681)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeletingArchiveTest.java 2012-06-04 14:29:35 UTC (rev 41682)
@@ -39,7 +39,7 @@
}
@Test
- public void testDeletingArchivetWithView() {
+ public void testDeletingArchiveWithView() {
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeployingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeployingArchiveTest.java 2012-06-04 14:28:58 UTC (rev 41681)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/DeployingArchiveTest.java 2012-06-04 14:29:35 UTC (rev 41682)
@@ -46,7 +46,7 @@
}
@Test
- public void testDeployingArchivetWithView() {
+ public void testDeployingArchiveWithView() {
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java 2012-06-04 14:28:58 UTC (rev 41681)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ModifyingArchiveTest.java 2012-06-04 14:29:35 UTC (rev 41682)
@@ -49,7 +49,7 @@
}
@Test
- public void testModifyingArchivetWithView() {
+ public void testModifyingArchiveWithView() {
/* prepare view for testing */
ProjectArchivesView view = viewForProject(project);
Added: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/VariousProjectsArchiving.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/VariousProjectsArchiving.java (rev 0)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/VariousProjectsArchiving.java 2012-06-04 14:29:35 UTC (rev 41682)
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2010-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.archives.ui.bot.test;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.jboss.tools.archives.ui.bot.test.view.ProjectArchivesView;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.gen.INewObject;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.junit.After;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+@Require(clearProjects = true, perspective = "Java",
+ server = @Server(state = ServerState.NotRunning,
+ version = "6.0", operator = ">="))
+public class VariousProjectsArchiving extends ArchivesTestBase {
+
+ @BeforeClass
+ public static void prepareWorkspace() {
+ showErrorView();
+ clearErrorView();
+ }
+
+ @After
+ public void testEmptyErrorLog() {
+ assertClearErrorLog();
+ }
+
+ @Test
+ public void testDynamicWebProject() {
+ String project = "pr1";
+
+ /* create dynamic web project */
+ createDynamicWebProject(project);
+
+ /* open view for project */
+ ProjectArchivesView view = viewForProject(project);
+
+ /* create archive */
+ view.createNewJarArchive(project).finish();
+
+ /* test if archive was created and no error was thrown*/
+ assertItemExistsInView(view,
+ project, project + ".jar [/" + project + "]");
+ }
+
+ @Test
+ public void testEJBProject() {
+ String project = "pr2";
+
+ /* create ejb project */
+ createEJBProject(project);
+
+ /* open view for project */
+ ProjectArchivesView view = viewForProject(project);
+
+ /* create archive */
+ view.createNewJarArchive(project).finish();
+
+ /* test if archive was created and no error was thrown*/
+ assertItemExistsInView(view,
+ project, project + ".jar [/" + project + "]");
+ }
+
+ private void createDynamicWebProject(String project) {
+ createProject(ActionItem.NewObject.
+ WebDynamicWebProject.LABEL, project);
+ }
+
+ private void createEJBProject(String project) {
+ createProject(ActionItem.NewObject.
+ EJBEJBProject.LABEL, project);
+
+ }
+
+ private void createProject(INewObject object,
+ String project) {
+ SWTBot bot = open.newObject(object);
+ SWTBotText t = bot.textWithLabel("Project name:");
+ t.setFocus();
+ t.setText(project);
+ bot.button(IDELabel.Button.FINISH).click();
+ handlePerspectivePopUpDialog();
+ util.waitForNonIgnoredJobs();
+ }
+
+ private void handlePerspectivePopUpDialog() {
+ try {
+ bot.shell(IDELabel.Shell.OPEN_ASSOCIATED_PERSPECTIVE)
+ .bot().button(IDELabel.Button.NO).click();
+ } catch (WidgetNotFoundException exc) {
+ //do nothing here
+ }
+ }
+}
13 years, 4 months
JBoss Tools SVN: r41681 - trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-06-04 10:28:58 -0400 (Mon, 04 Jun 2012)
New Revision: 41681
Modified:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
Log:
new methods added in ArchiveTestBase
Modified: trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java
===================================================================
--- trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java 2012-06-04 14:13:56 UTC (rev 41680)
+++ trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/ArchivesTestBase.java 2012-06-04 14:28:58 UTC (rev 41681)
@@ -18,6 +18,7 @@
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.helper.ImportHelper;
+import org.jboss.tools.ui.bot.ext.view.ErrorLogView;
import org.jboss.tools.ui.bot.ext.view.ServersView;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -49,19 +50,23 @@
}
protected void assertItemExistsInView(ProjectArchivesView view, String... path) {
- assertTrue(view.itemExists(path));
+ assertTrue("Item " + path[path.length-1] +
+ " does not exist in Project Archives View", view.itemExists(path));
}
protected void assertItemExistsInExplorer(ProjectArchivesExplorer explorer, String... path) {
- assertTrue(explorer.itemExists(path));
+ assertTrue("Item " + path[path.length-1] +
+ " does not exist in Project Archives explorer", explorer.itemExists(path));
}
protected void assertItemNotExistsInView(ProjectArchivesView view, String... path) {
- assertFalse(view.itemExists(path));
+ assertFalse("Item " + path[path.length-1] +
+ " should not exist in Project Archives View", view.itemExists(path));
}
protected void assertItemNotExistsInExplorer(ProjectArchivesExplorer explorer, String... path) {
- assertFalse(explorer.itemExists(path));
+ assertFalse("Item " + path[path.length-1] +
+ " should not exist in Project Archives explorer", explorer.itemExists(path));
}
protected void assertArchiveIsDeployed(String archive) {
@@ -101,6 +106,19 @@
return serversView;
}
+ public void assertClearErrorLog() {
+ assertTrue("Error log contains some records",
+ new ErrorLogView().getRecordCount() == 0);
+ }
+
+ public static void showErrorView() {
+ new ErrorLogView().show();
+ }
+
+ public static void clearErrorView() {
+ new ErrorLogView().clear();
+ }
+
protected static void importProject(String projectName) {
String location = "/resources/prj/" + projectName;
13 years, 4 months