JBoss Tools SVN: r35531 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-11 06:10:09 -0400 (Tue, 11 Oct 2011)
New Revision: 35531
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
Log:
[JBIDE-9793] cloning openshift repo: corrected required egit.ui plugin
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-11 10:07:51 UTC (rev 35530)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-11 10:10:09 UTC (rev 35531)
@@ -6,7 +6,7 @@
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator
Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
org.jboss.ide.eclipse.as.egit.core;bundle-version="2.3.0",
- org.eclipse.egit.ui;bundle-version="1.2.0",
+ org.eclipse.egit.ui;bundle-version="[1.1.0,2.0.0)",
org.eclipse.egit.core;bundle-version="[1.1.0,2.0.0)",
org.eclipse.jgit,
com.jcraft.jsch;bundle-version="0.1.44",
13 years, 3 months
JBoss Tools SVN: r35530 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-11 06:07:51 -0400 (Tue, 11 Oct 2011)
New Revision: 35530
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
Log:
[JBIDE-9793] cloning openshift repo (finally managed to get cloned repo added to repo view)
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-11 09:17:58 UTC (rev 35529)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-11 10:07:51 UTC (rev 35530)
@@ -171,18 +171,18 @@
cell.setText(application.getCartridge().getName());
}
}, viewer, tableLayout);
- createTableColumn("URL", 3, new CellLabelProvider() {
-
- @Override
- public void update(ViewerCell cell) {
- try {
- IApplication application = (IApplication) cell.getElement();
- cell.setText(application.getApplicationUrl());
- } catch (OpenshiftException e) {
- // ignore
- }
- }
- }, viewer, tableLayout);
+// createTableColumn("URL", 3, new CellLabelProvider() {
+//
+// @Override
+// public void update(ViewerCell cell) {
+// try {
+// IApplication application = (IApplication) cell.getElement();
+// cell.setText(application.getApplicationUrl());
+// } catch (OpenshiftException e) {
+// // ignore
+// }
+// }
+// }, viewer, tableLayout);
return viewer;
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-11 09:17:58 UTC (rev 35529)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-11 10:07:51 UTC (rev 35530)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.egit.core.op.CloneOperation;
+import org.eclipse.egit.ui.Activator;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.InitCommand;
import org.eclipse.jgit.api.errors.CheckoutConflictException;
@@ -66,16 +67,18 @@
public void setupProject() throws OpenshiftException, URISyntaxException, InvocationTargetException, InterruptedException, IOException, NoHeadException, ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException, WrongRepositoryStateException, NoMessageException, CoreException {
String applicationWorkingdir = "openshift-" + application.getName();
// File workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
- String userHome = System.getProperty("user.home");
+ String userHome = System.getProperty("java.io.tmpdir");
// File workDir = new File(workspace, applicationWorkingdir);
- File workDir = new File(userHome, applicationWorkingdir);
+ File clonedDirectory = new File(userHome, applicationWorkingdir);
URIish gitUri = new URIish(application.getGitUri());
- if (workDir.exists()) {
- FileUtil.completeDelete(workDir);
+ if (clonedDirectory.exists()) {
+ FileUtil.completeDelete(clonedDirectory);
}
- CloneOperation cloneOperation = new CloneOperation(gitUri, true, null, workDir, "refs/heads/*", "master", 10 * 1024);
+ CloneOperation cloneOperation = new CloneOperation(gitUri, true, null, clonedDirectory, Constants.HEAD, "origin", 10 * 1024);
// cloneOperation.setCredentialsProvider(new UsernamePasswordCredentialsProvider(user.getRhlogin(), user.getPassword()));
cloneOperation.run(null);
+ File gitDirectory = new File(clonedDirectory, Constants.DOT_GIT);
+ Activator.getDefault().getRepositoryUtil().addConfiguredRepository(gitDirectory);
// File repositoryFile = createRepositoryFile(applicationWorkingdir);
// Git git = createGit(repositoryFile);
// TODO replace remote name by user setting
13 years, 3 months
JBoss Tools SVN: r35529 - in trunk/as/plugins/org.jboss.tools.openshift.express.ui: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-11 05:17:58 -0400 (Tue, 11 Oct 2011)
New Revision: 35529
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/bin/
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
Log:
[JBIDE-9793] cloning openshift repo
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-11 00:57:36 UTC (rev 35528)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-11 09:17:58 UTC (rev 35529)
@@ -6,8 +6,10 @@
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator
Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
org.jboss.ide.eclipse.as.egit.core;bundle-version="2.3.0",
+ org.eclipse.egit.ui;bundle-version="1.2.0",
org.eclipse.egit.core;bundle-version="[1.1.0,2.0.0)",
org.eclipse.jgit,
+ com.jcraft.jsch;bundle-version="0.1.44",
org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.databinding;bundle-version="1.4.0",
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-11 00:57:36 UTC (rev 35528)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-11 09:17:58 UTC (rev 35529)
@@ -16,13 +16,23 @@
import java.net.URISyntaxException;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.egit.core.op.CloneOperation;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.InitCommand;
+import org.eclipse.jgit.api.errors.CheckoutConflictException;
+import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException;
+import org.eclipse.jgit.api.errors.InvalidMergeHeadsException;
+import org.eclipse.jgit.api.errors.NoHeadException;
+import org.eclipse.jgit.api.errors.NoMessageException;
+import org.eclipse.jgit.api.errors.WrongRepositoryStateException;
import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.merge.MergeStrategy;
import org.eclipse.jgit.transport.URIish;
-import org.jboss.ide.eclipse.as.egit.core.EGitUtils;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.IUser;
@@ -33,6 +43,7 @@
*/
public class ServerAdapterWizardModel extends ObservableUIPojo {
+ private static final String REMOTE_NAME = "openshift";
private IUser user;
private IApplication application;
@@ -52,32 +63,53 @@
this.application = application;
}
- public void setupProject() throws OpenshiftException, URISyntaxException, InvocationTargetException, InterruptedException, IOException {
+ public void setupProject() throws OpenshiftException, URISyntaxException, InvocationTargetException, InterruptedException, IOException, NoHeadException, ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException, WrongRepositoryStateException, NoMessageException, CoreException {
String applicationWorkingdir = "openshift-" + application.getName();
// File workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
+ String userHome = System.getProperty("user.home");
// File workDir = new File(workspace, applicationWorkingdir);
-// URIish gitUri = new URIish(application.getGitUri());
-// new CloneOperation(gitUri, true, null, workDir, "refs/heads/*", "master", 10 * 1024).run(null);
- Repository repository = createRepository(applicationWorkingdir);
+ File workDir = new File(userHome, applicationWorkingdir);
+ URIish gitUri = new URIish(application.getGitUri());
+ if (workDir.exists()) {
+ FileUtil.completeDelete(workDir);
+ }
+ CloneOperation cloneOperation = new CloneOperation(gitUri, true, null, workDir, "refs/heads/*", "master", 10 * 1024);
+// cloneOperation.setCredentialsProvider(new UsernamePasswordCredentialsProvider(user.getRhlogin(), user.getPassword()));
+ cloneOperation.run(null);
+// File repositoryFile = createRepositoryFile(applicationWorkingdir);
+// Git git = createGit(repositoryFile);
// TODO replace remote name by user setting
- EGitUtils.addRemoteTo("openshift", new URIish(application.getGitUri()), repository);
-
+// Repository repository = git.getRepository();
+// EGitUtils.addRemoteTo(REMOTE_NAME, new URIish(application.getGitUri()), repository);
+// mergeWithRemote(git, REMOTE_NAME);
+
createServerAdapterIfRequired();
}
+ private void mergeWithRemote(Git git, String remoteName) throws CoreException, NoHeadException,
+ ConcurrentRefUpdateException, CheckoutConflictException, InvalidMergeHeadsException,
+ WrongRepositoryStateException, NoMessageException, IOException {
+ Repository repository = git.getRepository();
+ ObjectId objectId = repository.resolve("HEAD");
+ git.merge().include(objectId).setStrategy(MergeStrategy.OURS).call();
+ }
+
private void createServerAdapterIfRequired() {
// TODO
}
- private Repository createRepository(String name) throws IOException {
+ private Git createGit(File repositoryFile) throws IOException {
InitCommand init = Git.init();
+ init.setDirectory(repositoryFile);
+ init.setBare(false);
+ return init.call();
+ }
+
+ private File createRepositoryFile(String name) {
IPath workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation();
IPath gitRepoProject = workspace.append(name);
File repositoryFile = new File(gitRepoProject.toFile(), Constants.DOT_GIT);
- init.setDirectory(repositoryFile);
- init.setBare(false);
- Git git = init.call();
- return git.getRepository();
+ return repositoryFile;
}
}
13 years, 3 months
JBoss Tools SVN: r35528 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test: v30 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-10 20:57:36 -0400 (Mon, 10 Oct 2011)
New Revision: 35528
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/SeamConfigValidationTest.java
Log:
JBIDE-9881
https://issues.jboss.org/browse/JBIDE-9881
Reporting unresolved seam config nodes enhanced.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java 2011-10-11 00:57:17 UTC (rev 35527)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamConfigValidationTest.java 2011-10-11 00:57:36 UTC (rev 35528)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
@@ -73,31 +74,37 @@
}
public void testBeanResolution() throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean1"));
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, "org.jboss.beans.validation.test.MyBean2");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 8);
+ message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, "org.jboss.beans.validation.test.MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, message);
}
public void testFieldResolution() throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "param"), 21);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "value"), 28);
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "field3", "MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 15);
+ message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "field1", "MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, message);
}
public void testMethodResolution() throws CoreException {
//It is unresolved member because no member with that name is found.
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method2"), 38);
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "method2", "MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 38);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 34);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 34);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, ".*", 34);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 42);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 42);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, ".*", 42);
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 47);
+ message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, "method1(Boolean)", "MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 47);
}
public void testAnnotationMemberResolution() throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field3"), 15);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field1"));
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, "param()", "Named");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 21);
+ message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, "value()", "Named");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, message, 28);
}
public void testSettingInlineBeanValuesToBeanOrSetOrMap() throws CoreException {
@@ -136,7 +143,8 @@
AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
GenericBeanValidationTest.removeFile(project, path);
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, "org.jboss.beans.validation.test.MyBean2");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 8);
}
/**
@@ -147,8 +155,8 @@
* @throws CoreException
*/
public void testPreference() throws CoreException {
- String pattern1 = MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1");
- String pattern2 = MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method2");
+ String pattern1 = MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "method1(Boolean)", "MyBean1");
+ String pattern2 = MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "method2", "MyBean1");
AbstractResourceMarkerTest.assertMarkerIsCreated(f, pattern1, 47);
AbstractResourceMarkerTest.assertMarkerIsCreated(f, pattern2, 38);
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/SeamConfigValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/SeamConfigValidationTest.java 2011-10-11 00:57:17 UTC (rev 35527)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/v30/SeamConfigValidationTest.java 2011-10-11 00:57:36 UTC (rev 35528)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
@@ -73,31 +74,37 @@
}
public void testBeanResolution() throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean1"));
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, "org.jboss.beans.validation.test.MyBean2");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 8);
+ message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, "org.jboss.beans.validation.test.MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, message);
}
public void testFieldResolution() throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "param"), 21);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "value"), 28);
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "field3", "MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 15);
+ message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "field1", "MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, message);
}
public void testMethodResolution() throws CoreException {
//It is unresolved member because no member with that name is found.
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method2"), 38);
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "method2", "MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 38);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 34);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 34);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, ".*", 34);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method1"), 42);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 42);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, ".*", 42);
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1"), 47);
+ message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, "method1(Boolean)", "MyBean1");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 47);
}
public void testAnnotationMemberResolution() throws CoreException {
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field3"), 15);
- AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:field1"));
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, "param()", "Named");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 21);
+ message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, "value()", "Named");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, message, 28);
}
public void testSettingInlineBeanValuesToBeanOrSetOrMap() throws CoreException {
@@ -136,7 +143,8 @@
AbstractResourceMarkerTest.assertMarkerIsNotCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
GenericBeanValidationTest.removeFile(project, path);
- AbstractResourceMarkerTest.assertMarkerIsCreated(f, MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_TYPE, "v:MyBean2"), 8);
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, "org.jboss.beans.validation.test.MyBean2");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(f, message, 8);
}
/**
@@ -147,8 +155,8 @@
* @throws CoreException
*/
public void testPreference() throws CoreException {
- String pattern1 = MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "v:method1");
- String pattern2 = MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "v:method2");
+ String pattern1 = MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_METHOD, "method1(Boolean)", "MyBean1");
+ String pattern2 = MessageFormat.format(SeamConfigValidationMessages.UNRESOLVED_MEMBER, "method2", "MyBean1");
AbstractResourceMarkerTest.assertMarkerIsCreated(f, pattern1, 47);
AbstractResourceMarkerTest.assertMarkerIsCreated(f, pattern2, 38);
13 years, 3 months
JBoss Tools SVN: r35527 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core: definition and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-10 20:57:17 -0400 (Mon, 10 Oct 2011)
New Revision: 35527
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SAXNodeProblem.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties
Log:
JBIDE-9881
https://issues.jboss.org/browse/JBIDE-9881
Reporting unresolved seam config nodes enhanced.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-10-11 00:19:18 UTC (rev 35526)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-10-11 00:57:17 UTC (rev 35527)
@@ -12,8 +12,6 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -35,6 +33,7 @@
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.cdi.seam.config.core.definition.ConfigTypeDefinition;
+import org.jboss.tools.cdi.seam.config.core.definition.SAXNodeProblem;
import org.jboss.tools.cdi.seam.config.core.definition.SeamBeanDefinition;
import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
import org.jboss.tools.cdi.seam.config.core.definition.SeamFieldDefinition;
@@ -43,8 +42,6 @@
import org.jboss.tools.cdi.seam.config.core.scanner.ConfigFileSet;
import org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder;
import org.jboss.tools.cdi.seam.config.core.validation.SeamConfigValidationMessages;
-import org.jboss.tools.cdi.seam.config.core.xml.SAXAttribute;
-import org.jboss.tools.cdi.seam.config.core.xml.SAXElement;
import org.jboss.tools.cdi.seam.config.core.xml.SAXNode;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.java.IParametedType;
@@ -54,6 +51,7 @@
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.preferences.SeverityPreferences;
+import org.jboss.tools.common.text.ITextSourceReference;
/**
*
@@ -197,28 +195,22 @@
public void validateResource(IFile file, CDICoreValidator validator) {
SeamBeansDefinition def = context.getDefinition(file.getFullPath());
if(def != null) {
- Map<SAXNode, String> nodes = def.getUnresolvedNodes();
- for (Entry<SAXNode, String> entry: nodes.entrySet()) {
- SAXNode node = entry.getKey();
- String problemId = entry.getValue();
+ Set<SAXNodeProblem> nodes = def.getUnresolvedNodes();
+ for (SAXNodeProblem problem: nodes) {
+ SAXNode node = problem.getNode();
+ String problemId = problem.getProblemId();
+ String message = problem.getMessage();
+ ITextSourceReference ref = new TextSourceReference(def.getFileObject(), file, node);
if(CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE.equals(problemId)) {
- String name = node instanceof SAXElement ? ((SAXElement)node).getName() : node instanceof SAXAttribute ? ((SAXAttribute)node).getName() : null;
- String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, name);
- validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_TYPE, new TextSourceReference(def.getFileObject(), file, node), file);
+ validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_TYPE, ref, file);
} else if(CDISeamConfigConstants.ERROR_UNRESOLVED_MEMBER.equals(problemId)) {
- String name = node instanceof SAXElement ? ((SAXElement)node).getName() : node instanceof SAXAttribute ? ((SAXAttribute)node).getName() : null;
- String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, name);
- validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_MEMBER, new TextSourceReference(def.getFileObject(), file, node), file);
+ validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_MEMBER, ref, file);
} else if(CDISeamConfigConstants.ERROR_UNRESOLVED_METHOD.equals(problemId)) {
- String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, ((SAXElement)node).getName());
- validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_METHOD, new TextSourceReference(def.getFileObject(), file, node), file);
+ validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_METHOD, ref, file);
} else if(CDISeamConfigConstants.ERROR_UNRESOLVED_CONSTRUCTOR.equals(problemId)) {
- String name = node instanceof SAXElement && ((SAXElement)node).getParent() != null ? ((SAXElement)node).getParent().getName() : null;
- String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_CONSTRUCTOR, name);
- validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_CONSTRUCTOR, new TextSourceReference(def.getFileObject(), file, node), file);
+ validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_CONSTRUCTOR, ref, file);
} else if(CDISeamConfigConstants.ERROR_ANNOTATION_EXPECTED.equals(problemId)) {
- String message = NLS.bind(SeamConfigValidationMessages.ANNOTATION_EXPECTED, null);
- validator.addError(message, CDISeamConfigPreferences.ANNOTATION_EXPECTED, new TextSourceReference(def.getFileObject(), file, node), file);
+ validator.addError(message, CDISeamConfigPreferences.ANNOTATION_EXPECTED, ref, file);
}
}
Set<SeamBeanDefinition> bs = def.getBeanDefinitions();
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SAXNodeProblem.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SAXNodeProblem.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SAXNodeProblem.java 2011-10-11 00:57:17 UTC (rev 35527)
@@ -0,0 +1,28 @@
+package org.jboss.tools.cdi.seam.config.core.definition;
+
+import org.jboss.tools.cdi.seam.config.core.xml.SAXNode;
+
+public class SAXNodeProblem {
+ SAXNode node;
+ String problemId;
+ String message;
+
+ public SAXNodeProblem(SAXNode node, String problemId, String message) {
+ this.node = node;
+ this.problemId = problemId;
+ this.message = message;
+ }
+
+ public SAXNode getNode() {
+ return node;
+ }
+
+ public String getProblemId() {
+ return problemId;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SAXNodeProblem.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-10-11 00:19:18 UTC (rev 35526)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-10-11 00:57:17 UTC (rev 35527)
@@ -11,7 +11,6 @@
package org.jboss.tools.cdi.seam.config.core.definition;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -47,7 +46,7 @@
public class SeamBeansDefinition {
IResource resource;
XModelObject file;
- Map<SAXNode, String> unresolvedNodes = new HashMap<SAXNode, String>();
+ Set<SAXNodeProblem> unresolvedNodes = new HashSet<SAXNodeProblem>();
Set<String> possibleTypeNames = new HashSet<String>();
Set<SeamBeanDefinition> beanDefinitions = new HashSet<SeamBeanDefinition>();
@@ -74,7 +73,7 @@
return resource;
}
- public Map<SAXNode, String> getUnresolvedNodes() {
+ public Set<SAXNodeProblem> getUnresolvedNodes() {
return unresolvedNodes;
}
@@ -87,10 +86,14 @@
return possibleTypeNames;
}
- public void addUnresolvedNode(SAXNode node, String problem) {
- unresolvedNodes.put(node, problem);
+ public void addUnresolvedNode(SAXNodeProblem problem) {
+ unresolvedNodes.add(problem);
}
+ public void addUnresolvedNode(SAXNode node, String problemId, String message) {
+ addUnresolvedNode(new SAXNodeProblem(node, problemId, message));
+ }
+
public void addPossibleTypeNames(Set<String> types) {
possibleTypeNames.addAll(types);
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-10-11 00:19:18 UTC (rev 35526)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-10-11 00:57:17 UTC (rev 35527)
@@ -22,6 +22,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationDefinition;
@@ -37,6 +38,7 @@
import org.jboss.tools.cdi.seam.config.core.definition.SeamParameterDefinition;
import org.jboss.tools.cdi.seam.config.core.definition.SeamVirtualFieldDefinition;
import org.jboss.tools.cdi.seam.config.core.util.Util;
+import org.jboss.tools.cdi.seam.config.core.validation.SeamConfigValidationMessages;
import org.jboss.tools.cdi.seam.config.core.xml.SAXAttribute;
import org.jboss.tools.cdi.seam.config.core.xml.SAXElement;
import org.jboss.tools.cdi.seam.config.core.xml.SAXParser;
@@ -89,7 +91,7 @@
IType type = Util.resolveType(element, project);
if(type == null) {
- result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ reportUnresolvedType(element);
result.addPossibleTypeNames(Util.getPossibleTypeNames(element));
return;
}
@@ -108,6 +110,19 @@
}
}
+ private void reportUnresolvedType(SAXElement element) {
+ Set<String> ps = Util.getPossibleTypeNames(element);
+ if(ps.size() == 1) {
+ String type = ps.iterator().next();
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, type);
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE, message);
+ } else {
+ String type = element.getLocalName();
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, type);
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE, message);
+ }
+ }
+
private void scanAnnotation(SAXElement element, IType type) {
context.getRootContext().getAnnotationKind(type); // kick it
AnnotationDefinition def = new AnnotationDefinition();
@@ -170,7 +185,7 @@
SeamMethodDefinition md = scanMethod(c, type);
if(md != null) def.addMethod(md);
} else {
- result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_MEMBER);
+ reportUnresolvedMember(c, type);
}
}
Set<String> as = element.getAttributeNames();
@@ -178,7 +193,7 @@
SAXAttribute a = element.getAttribute(name);
IField f = type.getField(name);
if(f == null || !f.exists()) {
- result.addUnresolvedNode(a, CDISeamConfigConstants.ERROR_UNRESOLVED_MEMBER);
+ reportUnresolvedField(a, type);
} else {
def.addField(scanField(a, f));
}
@@ -186,13 +201,38 @@
return def;
}
+ void reportUnresolvedMember(SAXElement c, IType type) {
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, c.getLocalName(), type.getElementName());
+ result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_MEMBER, message);
+ }
+
+ void reportUnresolvedMethod(SAXElement c, IType type, String params) {
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, c.getLocalName() + "(" + params + ")", type.getElementName());
+ result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_METHOD, message);
+ }
+
+ void reportUnresolvedConstructor(SAXElement c, IType type, String params) {
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_CONSTRUCTOR, type.getElementName() + "(" + params + ")");
+ result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_CONSTRUCTOR, message);
+ }
+
+ void reportUnresolvedField(SAXAttribute c, IType type) {
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_FIELD, c.getName(), type.getElementName());
+ result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_MEMBER, message);
+ }
+
+ void reportUnresolvedMethod(SAXAttribute c, IType type) {
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, c.getName() + "()", type.getElementName());
+ result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_METHOD, message);
+ }
+
private SeamVirtualFieldDefinition scanVirtualProducerField(SAXElement element) {
SeamVirtualFieldDefinition def = new SeamVirtualFieldDefinition();
def.setResource(resource);
def.setNode(element);
IType type = Util.resolveType(element, project);
if(type == null) {
- result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ reportUnresolvedType(element);
return null;
}
def.setType(type);
@@ -233,7 +273,7 @@
if(a != null) def.addAnnotation(a);
continue;
} else {
- result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ reportUnresolvedType(c);
}
}
@@ -311,18 +351,19 @@
SeamMethodDefinition def = new SeamMethodDefinition();
def.setResource(resource);
def.setNode(element);
+ StringBuilder paramPresentation = new StringBuilder();
List<SAXElement> es = element.getChildElements();
for (SAXElement c: es) {
if(!Util.isConfigRelevant(c)) continue;
if(Util.isParameters(c)) {
List<SAXElement> ps = c.getChildElements();
for (SAXElement p: ps) {
- SeamParameterDefinition pd = scanParameter(p);
+ SeamParameterDefinition pd = scanParameter(p, paramPresentation);
if(pd != null) def.addParameter(pd);
}
continue;
} else if(Util.isArray(c)) {
- SeamParameterDefinition pd = scanParameter(c);
+ SeamParameterDefinition pd = scanParameter(c, paramPresentation);
if(pd != null) def.addParameter(pd);
continue;
}
@@ -332,7 +373,7 @@
if(a != null) def.addAnnotation(a);
continue;
} else {
- result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ reportUnresolvedType(c);
}
}
@@ -345,7 +386,7 @@
if(method != null) {
def.setMethod(method);
} else {
- result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_METHOD);
+ reportUnresolvedMethod(element, type, paramPresentation.toString());
def = null;
}
return def;
@@ -355,14 +396,15 @@
SeamMethodDefinition def = new SeamMethodDefinition();
def.setResource(resource);
def.setNode(element);
+ StringBuilder paramPresentation = new StringBuilder();
if(Util.isParameters(element)) {
List<SAXElement> ps = element.getChildElements();
for (SAXElement p: ps) {
- SeamParameterDefinition pd = scanParameter(p);
+ SeamParameterDefinition pd = scanParameter(p, paramPresentation);
if(pd != null) def.addParameter(pd);
}
} else if(Util.isArray(element)) {
- SeamParameterDefinition pd = scanParameter(element);
+ SeamParameterDefinition pd = scanParameter(element, paramPresentation);
if(pd != null) def.addParameter(pd);
}
IJavaAnnotation inject = createInject(element);
@@ -376,14 +418,14 @@
if(method != null) {
def.setMethod(method);
} else {
- result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_CONSTRUCTOR);
+ reportUnresolvedConstructor(element, type, paramPresentation.toString());
def = null;
}
return def;
}
- private SeamParameterDefinition scanParameter(SAXElement element) {
+ private SeamParameterDefinition scanParameter(SAXElement element, StringBuilder paramPresentation) {
if(!Util.isConfigRelevant(element)) return null;
SeamParameterDefinition def = new SeamParameterDefinition();
def.setResource(resource);
@@ -397,9 +439,14 @@
List<SAXElement> es = element.getChildElements();
for (SAXElement c: es) {
if(!Util.isConfigRelevant(c)) continue;
+
+ if(paramPresentation.length() > 0) paramPresentation.append(",");
+ paramPresentation.append(c.getLocalName());
+ for (int q = 0; q < def.getDimensions(); q++) paramPresentation.append("[]");
+
IType type = Util.resolveType(c, project);
if(type == null) {
- result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ reportUnresolvedType(c);
continue;
}
TypeCheck typeCheck = new TypeCheck(type, c);
@@ -412,9 +459,12 @@
}
}
} else {
+ if(paramPresentation.length() > 0) paramPresentation.append(",");
+ paramPresentation.append(element.getLocalName());
+
IType type = Util.resolveType(element, project);
if(type == null) {
- result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ reportUnresolvedType(element);
return null;
}
def.setType(type);
@@ -442,7 +492,7 @@
IType type = Util.resolveType(element, project);
if(type == null) {
if(contextKind == IN_ANNOTATION_TYPE) {
- result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ reportUnresolvedType(element);
}
return null;
}
@@ -466,12 +516,12 @@
literal.addMemberValuePair(n, v, IMemberValuePair.K_STRING);
IMethod m = type.getMethod(n, new String[0]);
if(!m.exists()) {
- result.addUnresolvedNode(attr, CDISeamConfigConstants.ERROR_UNRESOLVED_MEMBER);
+ reportUnresolvedMethod(attr, type);
}
}
return literal;
} else if(contextKind == IN_ANNOTATION_TYPE) {
- result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_ANNOTATION_EXPECTED);
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_ANNOTATION_EXPECTED, SeamConfigValidationMessages.ANNOTATION_EXPECTED);
}
return null;
}
@@ -484,7 +534,7 @@
isAnnotation = type.isAnnotation();
} catch (JavaModelException e) {
CDISeamConfigCorePlugin.getDefault().logError(e);
- result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
+ reportUnresolvedType(element);
isCorrupted = true;
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java 2011-10-11 00:19:18 UTC (rev 35526)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java 2011-10-11 00:57:17 UTC (rev 35527)
@@ -8,6 +8,7 @@
public static String UNRESOLVED_TYPE;
public static String UNRESOLVED_MEMBER;
+ public static String UNRESOLVED_FIELD;
public static String UNRESOLVED_METHOD;
public static String UNRESOLVED_CONSTRUCTOR;
public static String ANNOTATION_EXPECTED;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties 2011-10-11 00:19:18 UTC (rev 35526)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties 2011-10-11 00:57:17 UTC (rev 35527)
@@ -1,7 +1,8 @@
-UNRESOLVED_TYPE=Cannot resolve type in node {0}.
-UNRESOLVED_MEMBER=Cannot resolve member in node {0}.
-UNRESOLVED_METHOD=Cannot resolve method in node {0}.
-UNRESOLVED_CONSTRUCTOR=Cannot resolve constructor in type node {0}.
+UNRESOLVED_TYPE=Cannot resolve type {0}.
+UNRESOLVED_MEMBER=Cannot resolve field or method {0} in type {1}.
+UNRESOLVED_FIELD=Cannot resolve field {0} in type {1}.
+UNRESOLVED_METHOD=Cannot resolve method {0} in type {1}.
+UNRESOLVED_CONSTRUCTOR=Cannot resolve constructor {0}.
ANNOTATION_EXPECTED=Annotation types are only allowed here.
INLINE_BEAN_TYPE_MISMATCH=Type mismatch: cannot convert from {0} to {1}.
TYPE_IS_ABSTRACT=Abstract type {0} cannot be configured as a bean.
13 years, 3 months
JBoss Tools SVN: r35526 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-10 20:19:18 -0400 (Mon, 10 Oct 2011)
New Revision: 35526
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
https://issues.jboss.org/browse/JBIDE-9880 org.jboss.tools.seam.core.test.SeamValidatorsTest failure
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2011-10-11 00:02:35 UTC (rev 35525)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2011-10-11 00:19:18 UTC (rev 35526)
@@ -34,7 +34,6 @@
import org.jboss.tools.seam.core.ISeamComponentMethod;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamComponentMethodType;
-import org.jboss.tools.seam.core.SeamCoreBuilder;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.core.test.validation.ELValidatorWrapper;
@@ -43,7 +42,6 @@
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.validation.SeamValidationErrorManager;
import org.jboss.tools.seam.internal.core.validation.SeamValidationMessages;
-import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
@@ -76,19 +74,14 @@
}
}
}
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
- originalFile.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, "org.eclipse.jdt.internal.core.builder.JavaBuilder", null, null);
- JobUtils.waitForIdle();
- originalFile.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, SeamCoreBuilder.BUILDER_ID, null, null);
-// originalFile.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
- JobUtils.waitForIdle();
+ originalFile.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ originalFile.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
}
+ @Override
protected void setUp() throws Exception {
- JobUtils.waitForIdle();
- IResource project = ResourcesPlugin.getWorkspace().getRoot().findMember("SeamWebWarTestProject");
- if(project == null) {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject("SeamWebWarTestProject");
+ if(!project.exists()) {
ProjectImportTestSetup setup = new ProjectImportTestSetup(
this,
"org.jboss.tools.seam.core.test",
@@ -96,24 +89,14 @@
"SeamWebWarTestProject");
project = setup.importProject();
}
- this.project = project.getProject();
-// JobUtils.waitForIdle();
}
-
+
@Override
protected void tearDown() throws Exception {
-
}
- private ISeamProject getSeamProject(IProject project) {
- refreshProject(project);
-
- ISeamProject seamProject = null;
- try {
- seamProject = (ISeamProject)project.getNature(SeamProject.NATURE_ID);
- } catch (Exception e) {
- JUnitUtils.fail("Cannot get seam nature.",e);
- }
+ private ISeamProject getSeamProject(IProject project) throws CoreException {
+ ISeamProject seamProject = (ISeamProject)project.getNature(SeamProject.NATURE_ID);
assertNotNull("Seam project is null", seamProject);
return seamProject;
}
@@ -129,12 +112,11 @@
SeamCoreValidatorWrapper seamValidator = new SeamCoreValidatorWrapper(project);
seamValidator.validate(componentFile);
-
+
assertTrue("Error marker not found", seamValidator.isMessageCreated(SeamValidationMessages.UNKNOWN_FACTORY_NAME, new String[]{"somethings"}));
copyContentsFile(componentFile, "src/action/org/domain/SeamWebWarTestProject/session/FactoryTest.original");
}
-
/**
* Test for https://jira.jboss.org/jira/browse/JBIDE-784
* @throws CoreException
@@ -186,7 +168,7 @@
seamValidator = new SeamCoreValidatorWrapper(project);
seamValidator.validate(subclassComponentFile);
-
+
assertTrue("We changed super class of component but it still don't see changes.", seamValidator.getMessages().size()==0);
}
@@ -194,28 +176,28 @@
// Test for http://jira.jboss.com/jira/browse/JBIDE-1631
IFile jbide1631XHTMLFile = project.getFile("WebContent/JBIDE-1631.xhtml");
IFile jbide1631XHTMLFile2 = project.getFile("WebContent/JBIDE-1631.1");
-
+
copyContentsFile(jbide1631XHTMLFile, jbide1631XHTMLFile2);
-
+
ELValidatorWrapper elValidator = new ELValidatorWrapper(project);
elValidator.validate(jbide1631XHTMLFile);
-
+
assertTrue("Error marker not found", elValidator.isMessageCreated(ELValidationMessages.UNKNOWN_EL_VARIABLE_NAME, new Object[]{"foo1"}));
assertTrue("Error marker not found", elValidator.isMessageCreated(ELValidationMessages.UNKNOWN_EL_VARIABLE_NAME, new Object[]{"foo2"}));
}
-
+
public void testDuplicateComponentNameValidator() throws CoreException, ValidationException {
copyContentsFile(
"src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.java",
"src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.original");
IFile bbcComponentFile = project
.getFile("src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.java");
-
+
SeamCoreValidatorWrapper seamValidator = new SeamCoreValidatorWrapper(project);
seamValidator.validate(bbcComponentFile);
assertFalse("Error marker was found", seamValidator.isMessageCreated(
SeamValidationMessages.NONUNIQUE_COMPONENT_NAME_MESSAGE, new Object[]{"abcComponent"}));
-
+
// Duplicate component name
copyContentsFile(
"src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.java",
@@ -224,20 +206,18 @@
seamValidator.validate(bbcComponentFile);
assertTrue("Error marker not found", seamValidator.isMessageCreated(
SeamValidationMessages.NONUNIQUE_COMPONENT_NAME_MESSAGE, new Object[]{"abcComponent"}));
-
+
// restore file content
copyContentsFile(
"src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.java",
"src/action/org/domain/SeamWebWarTestProject/session/BbcComponent.original");
}
-
+
public void testStatefulComponentWithoutRemoveMethodValidator() throws CoreException, ValidationException {
IFile statefulComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java");
-
+
String markerText = "Stateful component \"statefulComponent\" must have a method marked @Remove";
-
-// assertMarkerIsNotCreated(statefulComponentFile, MARKER_TYPE, markerText);
-
+
// Stateful component does not contain @Remove method
assertMarkerIsCreatedForLine("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java",
"src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.2",
@@ -245,7 +225,7 @@
new Object[]{"statefulComponent"},
16);
}
-
+
private void assertMarkerIsCreatedForLine(String target, String newContent, String markerTemplate,
Object[] parameters,int lineNumber) throws CoreException, ValidationException {
IValidatorSupport validator = new SeamCoreValidatorWrapper(project);
@@ -293,7 +273,7 @@
IValidatorSupport validator = new SeamCoreValidatorWrapper(project);
assertMarkerIsNotCreatedForFile(validator, target, markerTemplate, parameters);
}
-
+
private void assertMarkerIsNotCreatedForFile(IValidatorSupport validator, String target, String markerTemplate, Object[] parameters)
throws ValidationException, CoreException {
IFile targetFile = project.getFile(target);
@@ -309,7 +289,7 @@
new Object[] {"statefulComponent"},
16);
}
-
+
public void testStatefulComponentHasWrongScopeValidator() throws CoreException, ValidationException {
// Stateful component has wrong scope
assertMarkerIsCreatedForLine(
@@ -319,7 +299,7 @@
new Object[] {"statefulComponent"},
16);
}
-
+
public void testComponentTypeValidator() throws CoreException, ValidationException {
// Component class name cannot be resolved to a type
assertMarkerIsCreatedForLine(
@@ -329,7 +309,7 @@
new Object[] {"org.domain.SeamWebWarTestProject.session.StateComponent"},
15);
}
-
+
public void testComponentWithoutSetterValidator() throws CoreException, ValidationException {
// Component class does not contain setter for property
assertMarkerIsCreatedForLine(
@@ -349,25 +329,21 @@
new Object[]{"abcEntity"}, 15);
}
- final String TARGET_FILE_NAME
- = "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java";
-
+ final String TARGET_FILE_NAME = "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java";
+
public void testDuplicateDestroyMethodValidator() throws CoreException, ValidationException {
final String NEW_CONTENT_FILE_NAME6 = "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.6";
-
assertMarkerIsCreatedForLine(
TARGET_FILE_NAME,
NEW_CONTENT_FILE_NAME6,
SeamValidationMessages.DUPLICATE_DESTROY,new Object[]{"destroyMethod"}, 34);
-
assertMarkerIsCreatedForLine(
TARGET_FILE_NAME,
SeamValidationMessages.DUPLICATE_DESTROY,new Object[]{"destroyMethod2"}, 39);
}
-
+
public void testDuplicateCreateMethodValidator() throws CoreException, ValidationException {
// Duplicate @Create method
-
final String NEW_CONTENT_FILE_NAME7 = "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.7";
assertMarkerIsCreatedForLine(
@@ -379,7 +355,7 @@
TARGET_FILE_NAME, SeamValidationMessages.DUPLICATE_CREATE,
new Object[]{"createMethod2"}, 41);
}
-
+
public void testDuplicateUnwrapMethodValidator() throws CoreException, ValidationException {
// Duplicate @Unwrap method
@@ -393,7 +369,7 @@
TARGET_FILE_NAME, SeamValidationMessages.DUPLICATE_UNWRAP,
new Object[] { "unwrapMethod2"}, 45);
}
-
+
public void testOnlyJavaBeansAndStatefulSessionBeansSupportDestroyMethodValidator() throws CoreException, ValidationException {
// Only JavaBeans and stateful session beans support @Destroy methods
@@ -405,10 +381,9 @@
new Object[] {"destroyMethod"},
25);
}
-
+
public void testOnlyComponentClassCanHaveCreateMethodValidator() throws CoreException, ValidationException {
// Only component class can have @Create method
-
final String NEW_CONTENT_FILE_NAME10 = "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.10";
assertMarkerIsCreatedForLine(
@@ -418,7 +393,7 @@
new Object[]{"createMethod"},
25);
}
-
+
public void testOnlyComponentClassCanHaveUnwrapMethodValidator() throws CoreException, ValidationException {
// Only component class can have @Unwrap method
@@ -429,10 +404,9 @@
NEW_CONTENT_FILE_NAME11,
SeamValidationMessages.UNWRAP_DOESNT_BELONG_TO_COMPONENT, new Object[] {"unwrapMethod"}, 26);
}
-
+
public void testOnlyComponentClassCanHaveObserverMethodValidator() throws CoreException, ValidationException {
// Only component class can have @Observer method
-
final String NEW_CONTENT_FILE_NAME12 = "src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.12";
assertMarkerIsCreatedForLine(
@@ -440,7 +414,7 @@
NEW_CONTENT_FILE_NAME12,
SeamValidationMessages.OBSERVER_DOESNT_BELONG_TO_COMPONENT, new Object[] {"observerMethod"}, 26);
}
-
+
public void testDuplicateRemoveMethodValidator() throws CoreException, ValidationException {
// Duplicate @Remove method
@@ -482,7 +456,6 @@
*/
protected void assertMarkerIsCreated(String targetPath,
String pattern, int line) throws CoreException {
-
IFile targetFile = project.getFile(targetPath);
assertMarkerIsCreated(targetFile, MARKER_TYPE, pattern, line);
}
@@ -490,8 +463,9 @@
/**
* The validator should check duplicate @Remove methods only in stateful session bean component
* This method tests usual component (not stateful sessian bean) with two @Remove methods. It must not have error markers.
+ * @throws CoreException
*/
- public void testDuplicateRemoveMethodInComponent_Validator() {
+ public void testDuplicateRemoveMethodInComponent_Validator() throws CoreException {
getSeamProject(project);
IFile componentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/UsualComponent.java");
int number = getMarkersNumberByGroupName(componentFile, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
@@ -503,9 +477,7 @@
"src/action/org/domain/SeamWebWarTestProject/session/Component12.java",
SeamValidationMessages.UNKNOWN_FACTORY_NAME,
new Object[] {"messageList2"});
-
// Unknown factory name
-
assertMarkerIsCreatedForLine(
"src/action/org/domain/SeamWebWarTestProject/session/Component12.java",
"src/action/org/domain/SeamWebWarTestProject/session/Component12.2",
@@ -513,7 +485,7 @@
new Object[] {"messageList2"},
24);
}
-
+
public void testDuplicateFactoryNameValidator() throws CoreException, ValidationException {
assertMarkerIsNotCreatedForFile(
"src/action/org/domain/SeamWebWarTestProject/session/DuplicateFactory.java",
@@ -535,30 +507,29 @@
}
public void testMultipleDataBinderValidator() throws CoreException, ValidationException {
-
assertMarkerIsNotCreatedForFile(
"src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java",
SeamValidationMessages.MULTIPLE_DATA_BINDER,
new Object[] {});
-
+
assertMarkerIsNotCreatedForFile(
"src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java",
SeamValidationMessages.MULTIPLE_DATA_BINDER,
new Object[] {});
-
+
assertMarkerIsCreatedForLine(
"src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java",
"src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.2",
SeamValidationMessages.MULTIPLE_DATA_BINDER,
new Object[] {},
21);
-
+
assertMarkerIsCreatedForLine(
"src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java",
SeamValidationMessages.MULTIPLE_DATA_BINDER,
new Object[] {},
24);
-
+
assertMarkerIsCreatedForLine(
"src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java",
"src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.2",
@@ -572,19 +543,19 @@
new Object[] {},
24);
}
-
+
public void testUnknownDataModelNameValidator() throws CoreException, ValidationException {
IFile selectionTestFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java");
IFile selectionIndexTestFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java");
// Unknown @DataModel/@Out name
-
+
assertMarkerIsCreatedForLine(
"src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.java",
"src/action/org/domain/SeamWebWarTestProject/session/SelectionTest.3",
SeamValidationMessages.UNKNOWN_DATA_MODEL,
new Object[] {"messageList2"},
27);
-
+
assertMarkerIsCreatedForLine(
"src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.java",
"src/action/org/domain/SeamWebWarTestProject/session/SelectionIndexTest.3",
@@ -595,12 +566,12 @@
public void testDuplicateVariableName_Validator() throws CoreException, ValidationException {
modifyPreferences();
-
+
assertMarkerIsNotCreatedForFile(
"src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java",
SeamValidationMessages.DUPLICATE_VARIABLE_NAME,
new Object[] {"messageList"});
-
+
assertMarkerIsCreatedForLine(
"src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java",
"src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.2",
@@ -614,16 +585,15 @@
new Object[] {"messageList"},
41);
}
-
+
public void testUnknownVariableNameValidator() throws CoreException, ValidationException {
IFile contextVariableTestFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java");
-
+
String markerText = "Unknown context variable name: \"messageList5\"";
-
+
assertMarkerIsNotCreated(contextVariableTestFile, MARKER_TYPE, markerText);
-
+
// Unknown variable name
-
assertMarkerIsCreatedForLine(
"src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.java",
"src/action/org/domain/SeamWebWarTestProject/session/ContextVariableTest.3",
@@ -638,24 +608,22 @@
"WebContent/abcComponent.xhtml",
ELValidationMessages.UNKNOWN_EL_VARIABLE_NAME,
new Object[]{"bcComponent"});
-
+
// Context variable cannot be resolved
-
assertMarkerIsCreatedForLine(new ELValidatorWrapper(project),
"WebContent/abcComponent.xhtml",
"WebContent/abcComponent.2",
ELValidationMessages.UNKNOWN_EL_VARIABLE_NAME,
new Object[]{"bcComponent"}, 22);
}
-
+
public void testPropertyCannotBeResolvedValidator() throws CoreException, ValidationException {
-
assertMarkerIsNotCreatedForFile(
new ELValidatorWrapper(project),
"WebContent/abcComponent.xhtml",
ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[]{"actionType2"});
-
+
// Property cannot be resolved
assertMarkerIsCreatedForLine(
new ELValidatorWrapper(project),
@@ -665,7 +633,7 @@
new Object[]{"actionType2"},
22);
}
-
+
public void testPropertyHasOnlySetterValidator() throws CoreException, ValidationException {
// Unpaired Getter/Setter
try {
@@ -692,7 +660,7 @@
// ELValidationMessages.UNPAIRED_GETTER_OR_SETTER,
// new Object[] {"actionType","Setter","Getter"},
// true);
-
+
assertMarkerIsCreatedForLine(
wrapper,
"WebContent/abcComponent.xhtml",
@@ -704,7 +672,7 @@
enableUnpairGetterOrSetterValidation(false);
}
}
-
+
public void testPropertyHasOnlyGetterValidator() throws CoreException, ValidationException {
//I am not sure that we need build here. If test is stable, lets remove this.
// project.build(IncrementalProjectBuilder.FULL_BUILD, null);
@@ -726,7 +694,7 @@
// ELValidationMessages.UNPAIRED_GETTER_OR_SETTER,
// new Object[] {"actionType", "Getter", "Setter"},
// true);
-
+
assertMarkerIsCreatedForLine(
wrapper,
"WebContent/abcComponent.xhtml",
@@ -751,7 +719,7 @@
}
}
- public void testInheritedMethods() {
+ public void testInheritedMethods() throws CoreException {
ISeamProject seamProject = getSeamProject(project);
ISeamComponent c = seamProject.getComponent("inheritedComponent");
@@ -770,7 +738,6 @@
// See https://jira.jboss.org/jira/browse/JBIDE-4393
public void testDuplicateComponents() throws CoreException, ValidationException {
-
assertMarkerIsCreatedForLine(
"WebContent/WEB-INF/components.xml",
"WebContent/WEB-INF/duplicateComponents.test",
@@ -789,10 +756,13 @@
SeamValidationMessages.NONUNIQUE_COMPONENT_NAME_MESSAGE,
new Object[] {"duplicateJavaAndXmlComponentName"},
5);
-
}
- // See https://jira.jboss.org/browse/JBIDE-6352
+ /**
+ * See https://jira.jboss.org/browse/JBIDE-6352
+ * @throws CoreException
+ * @throws ValidationException
+ */
public void testErrorMarkerForEL() throws CoreException, ValidationException{
assertMarkerIsCreatedForLine(
new ELValidatorWrapper(project),
@@ -804,7 +774,7 @@
public void testErrorMarkerInPagesXML() throws CoreException, ValidationException {
SeamCoreValidatorWrapper seamValidator = new SeamCoreValidatorWrapper(project);
-
+
assertMarkerIsCreatedForLine(
seamValidator,
"WebContent/WEB-INF/pages.xml",
@@ -870,7 +840,7 @@
}
}
}
-
+
private void modifyPreference(String name, String value){
IPreferenceStore store = SeamCorePlugin.getDefault().getPreferenceStore();
@@ -894,18 +864,10 @@
}
}
- private void refreshProject(IProject project){
- JobUtils.waitForIdle();
- }
-
public static class SeamMarkerFilter implements IMarkerFilter {
public boolean accept(IMarker marker) {
String groupName = marker.getAttribute("groupName", null);
return groupName!=null && (groupName.equals(SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP) || groupName.equals(IValidator.MARKED_RESOURCE_MESSAGE_GROUP));
}
}
-
- private void invokeIncrementalBuild() throws CoreException {
- project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
- }
}
\ No newline at end of file
13 years, 3 months
JBoss Tools SVN: r35525 - branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-10-10 20:02:35 -0400 (Mon, 10 Oct 2011)
New Revision: 35525
Modified:
branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml
branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml
Log:
updated with known issue
Modified: branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml
===================================================================
--- branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2011-10-10 23:52:55 UTC (rev 35524)
+++ branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Article_Info.xml 2011-10-11 00:02:35 UTC (rev 35525)
@@ -8,7 +8,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.1</productnumber>
<edition>4.1.1</edition>
- <pubsnumber>27</pubsnumber>
+ <pubsnumber>28</pubsnumber>
<abstract>
<para>
These release notes contain important information related to the JBoss Developer Studio. New features, known issues, resources, and other current issues are addressed here.
Modified: branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml
===================================================================
--- branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml 2011-10-10 23:52:55 UTC (rev 35524)
+++ branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Fixed_Issues.xml 2011-10-11 00:02:35 UTC (rev 35525)
@@ -445,11 +445,6 @@
</listitem>
<listitem>
<para>
- <ulink url="http://jira.jboss.com/jira/browse/JBDS-1781">JBDS-1781</ulink>: When using the toolset on Ubuntu 11.04 with the Unity interface, only the <guilabel>Window</guilabel> menu item would appear in the top menu bar of the JBoss Developer Studio workspace. For the user this meant that all other menu functions were absent (for example, all options in the <guilabel>File</guilabel> and <guilabel> Edit</guilabel> menus). To correct the issue a new script is distributed with this JBoss Developer Studio release called <filename>jbdevstudio-unity</filename> that sets the environment variable <property>UBUNTU_MENUPROXY=0</property> prior to launching JBoss Developer Studio. By result of this script running is that Ubuntu Unity is forced to disable the global menu for JBoss Developer Studio, enabling the normal JBoss Developer Studio menu to be shown (containing all the usual menu options such as <guilabel>File</guilabel> and <guilabel> Edit</guilabel>). All other applica!
tion windows within Ubuntu Unity remain unaffected.
- </para>
- </listitem>
- <listitem>
- <para>
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-9514">JBIDE-9514</ulink>: Project Example ZIP files that contain empty folders, would not be imported correctly and the empty folders would be excluded, though they are necessary for the project to work (for example, the <filename>src</filename> folder). To fix this issue the <filename>NewProjectExamplesWizard.java</filename> has been modified to allow for empty folders within ZIP files to be imported correctly.
</para>
</listitem>
Modified: branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml
===================================================================
--- branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml 2011-10-10 23:52:55 UTC (rev 35524)
+++ branches/jbosstools-3.2.x/documentation/guides/JBDS_Release_Notes/en-US/Known_Issues.xml 2011-10-11 00:02:35 UTC (rev 35525)
@@ -6,16 +6,19 @@
<para>
Following is a list of known issues at the time of release.
</para>
-<!-- <formalpara>
+ <formalpara>
<title>General Known Issues</title>
<para>
<itemizedlist>
<listitem>
<para>
- <ulink url="http://jira.jboss.com/jira/browse/JBIDE-0000">JBIDE-0000</ulink>:
+ <ulink url="http://jira.jboss.com/jira/browse/JBDS-1781">JBDS-1781</ulink>: When using the toolset on Ubuntu 11.04 with the Unity interface, only the <guilabel>Window</guilabel> menu item appears in the top menu bar of the JBoss Developer Studio workspace. For the user this means that all other menu functions are absent (for example, all options in the <guilabel>File</guilabel> and <guilabel> Edit</guilabel> menus). The current workarpund to correct the issue is to start JBoss Developer Studio using a new script called <filename>jbdevstudio-unity</filename>. The script sets the environment variable <property>UBUNTU_MENUPROXY=0</property> prior to launching JBoss Developer Studio, forcing Ubuntu Unity to disable the global menu for the JBoss Developer Studio instance, enabling the normal JBoss Developer Studio menu to be shown (containing all the usual menu options such as <guilabel>File</guilabel> and <guilabel> Edit</guilabel>). All other application windows within U!
buntu Unity remain unaffected.
</para>
+ <para>
+ Another option available to users is to use a different Ubuntu desktop manager such as Ubuntu Classic.
+ </para>
</listitem>
</itemizedlist>
</para>
- </formalpara> -->
+ </formalpara>
</section>
13 years, 3 months
JBoss Tools SVN: r35524 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-10 19:52:55 -0400 (Mon, 10 Oct 2011)
New Revision: 35524
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-9880 org.jboss.tools.seam.core.test.SeamValidatorsTest failure
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2011-10-10 19:47:26 UTC (rev 35523)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2011-10-10 23:52:55 UTC (rev 35524)
@@ -744,7 +744,6 @@
} else {
addError(SeamValidationMessages.UNKNOWN_COMPONENT_CLASS_NAME, SeamPreferences.UNKNOWN_COMPONENT_CLASS_NAME_GUESS, new String[]{className}, location, declaration.getResource());
}
- return;
} else if(!type.isBinary()) {
validationContext.addLinkedCoreResource(SHORT_ID, componentName, type.getResource().getFullPath(), true);
}
13 years, 3 months
JBoss Tools SVN: r35523 - workspace/Denny/esb-example-soa-p5.0.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-10-10 15:47:26 -0400 (Mon, 10 Oct 2011)
New Revision: 35523
Modified:
workspace/Denny/esb-example-soa-p5.0/helloworld.zip
workspace/Denny/esb-example-soa-p5.0/helloworld_action.zip
workspace/Denny/esb-example-soa-p5.0/helloworld_action_all.zip
workspace/Denny/esb-example-soa-p5.0/helloworld_action_client.zip
workspace/Denny/esb-example-soa-p5.0/helloworld_all.zip
workspace/Denny/esb-example-soa-p5.0/helloworld_file_action.zip
workspace/Denny/esb-example-soa-p5.0/helloworld_file_action_all.zip
workspace/Denny/esb-example-soa-p5.0/helloworld_file_action_client.zip
workspace/Denny/esb-example-soa-p5.0/helloworld_testclient.zip
workspace/Denny/esb-example-soa-p5.0/transform_CSV2XML.zip
workspace/Denny/esb-example-soa-p5.0/transform_CSV2XML_all.zip
workspace/Denny/esb-example-soa-p5.0/transform_CSV2XML_client.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2POJO.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2POJO_all.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2POJO_client.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_date_manipulation.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_date_manipulation_all.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_date_manipulation_client.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_simple.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_simple_all.zip
workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_simple_client.zip
workspace/Denny/esb-example-soa-p5.0/webservice_consumer1.zip
workspace/Denny/esb-example-soa-p5.0/webservice_consumer1_all.zip
workspace/Denny/esb-example-soa-p5.0/webservice_producer.zip
workspace/Denny/esb-example-soa-p5.0/webservice_producer_all.zip
workspace/Denny/esb-example-soa-p5.0/webservice_producer_client.zip
Log:
JBDS-1859 - updated readmes for all of the soa p.5.0 project examples to read "To run this example, you should create EAP 5.x server runtime in your workspace", which removes the inconsistency with the SOA-P 5.3 or SOA-P 5.0 runtime text there before.
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_action.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_action_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_action_client.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_file_action.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_file_action_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_file_action_client.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/helloworld_testclient.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_CSV2XML.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_CSV2XML_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_CSV2XML_client.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2POJO.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2POJO_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2POJO_client.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_date_manipulation.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_date_manipulation_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_date_manipulation_client.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_simple.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_simple_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/transform_XML2XML_simple_client.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/webservice_consumer1.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/webservice_consumer1_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/webservice_producer.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/webservice_producer_all.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example-soa-p5.0/webservice_producer_client.zip
===================================================================
(Binary files differ)
13 years, 3 months
JBoss Tools SVN: r35522 - in trunk/cdi: plugins/org.jboss.tools.cdi.seam.config.core and 15 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-10 15:12:11 -0400 (Mon, 10 Oct 2011)
New Revision: 35522
Removed:
trunk/cdi/plugins/org.jboss.tools.cdi.core/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.ui/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.xml.ui/.settings/
trunk/cdi/plugins/org.jboss.tools.cdi.xml/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/.settings/
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/.settings/
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java
Log:
https://issues.jboss.org/browse/JBIDE-9844
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java 2011-10-10 19:04:36 UTC (rev 35521)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/perspective/CDIPerspectiveTest.java 2011-10-10 19:12:11 UTC (rev 35522)
@@ -15,7 +15,6 @@
import junit.framework.TestCase;
-import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.WorkbenchException;
import org.jboss.tools.test.util.WorkbenchUtils;
@@ -46,11 +45,12 @@
assertTrue("Have not found org.jboss.tools.cdi.ui.wizard.NewDecoratorCreationWizard in org.eclipse.jst.j2ee.J2EEPerspective.", shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewDecoratorCreationWizard"));
assertTrue("Have not found org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard in org.eclipse.jst.j2ee.J2EEPerspective.", shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewAnnotationLiteralCreationWizard"));
assertTrue("Have not found org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard in org.eclipse.jst.j2ee.J2EEPerspective.", shortcutSet.contains("org.jboss.tools.cdi.ui.wizard.NewBeansXMLCreationWizard"));
- IViewReference[] viewReferences = page.getViewReferences();
- Set<String> viewIds = new HashSet<String>();
- for (IViewReference viewReference : viewReferences) {
- viewIds.add(viewReference.getId());
- }
- assertTrue("Have not found org.eclipse.gef.ui.palette_view in org.eclipse.jst.j2ee.J2EEPerspective.", viewIds.contains("org.eclipse.gef.ui.palette_view"));
+// IViewReference[] viewReferences = page.getViewReferences();
+// Set<String> viewIds = new HashSet<String>();
+// for (IViewReference viewReference : viewReferences) {
+// System.out.println("View ID: " + viewReference.getId());
+// viewIds.add(viewReference.getId());
+// }
+// assertTrue("Have not found org.eclipse.gef.ui.palette_view in org.eclipse.jst.j2ee.J2EEPerspective.", viewIds.contains("org.eclipse.gef.ui.palette_view"));
}
}
\ No newline at end of file
13 years, 3 months