JBoss Tools SVN: r21157 - branches/modular_build/cdi/tests/org.jboss.tools.cdi.text.ext.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-03-31 12:29:05 -0400 (Wed, 31 Mar 2010)
New Revision: 21157
Modified:
branches/modular_build/cdi/tests/org.jboss.tools.cdi.text.ext.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBDS-486
Modified: branches/modular_build/cdi/tests/org.jboss.tools.cdi.text.ext.test/META-INF/MANIFEST.MF
===================================================================
--- branches/modular_build/cdi/tests/org.jboss.tools.cdi.text.ext.test/META-INF/MANIFEST.MF 2010-03-31 16:25:45 UTC (rev 21156)
+++ branches/modular_build/cdi/tests/org.jboss.tools.cdi.text.ext.test/META-INF/MANIFEST.MF 2010-03-31 16:29:05 UTC (rev 21157)
@@ -6,13 +6,8 @@
Require-Bundle: org.junit;bundle-version="3.8.2",
org.eclipse.core.resources;bundle-version="3.5.0",
org.eclipse.jface.text;bundle-version="3.5.0",
- org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
- org.eclipse.wst.sse.ui;bundle-version="1.1.100",
- org.eclipse.wst.sse.core;bundle-version="1.1.400",
- org.jboss.tools.common.test;bundle-version="2.0.0",
org.jboss.tools.common.text.ext;bundle-version="2.0.0",
- org.jboss.tools.tests;bundle-version="2.0.0",
org.eclipse.core.runtime;bundle-version="3.5.0",
org.jboss.tools.cdi.text.ext;bundle-version="1.0.0",
org.eclipse.jdt.ui;bundle-version="3.5.0",
14 years, 8 months
JBoss Tools SVN: r21156 - branches/modular_build/tests.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-03-31 12:25:45 -0400 (Wed, 31 Mar 2010)
New Revision: 21156
Removed:
branches/modular_build/tests/tests/
Log:
remove tests component's tests folder since this is for FRAMEWORK only; actual tests can go in common
14 years, 8 months
JBoss Tools SVN: r21155 - branches/modular_build/tests/features.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-03-31 11:48:07 -0400 (Wed, 31 Mar 2010)
New Revision: 21155
Removed:
branches/modular_build/tests/features/org.jboss.tools.all.test.feature/
Log:
JBDS-486 feature not required and creates circular dep on common
14 years, 8 months
JBoss Tools SVN: r21154 - branches/modular_build/tests/features/org.jboss.tools.all.test.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-03-31 11:35:24 -0400 (Wed, 31 Mar 2010)
New Revision: 21154
Modified:
branches/modular_build/tests/features/org.jboss.tools.all.test.feature/feature.xml
Log:
JBDS-486 all.test.feature should not depend on o.e.test and o.e.ant.opt.junit
Modified: branches/modular_build/tests/features/org.jboss.tools.all.test.feature/feature.xml
===================================================================
--- branches/modular_build/tests/features/org.jboss.tools.all.test.feature/feature.xml 2010-03-31 15:10:08 UTC (rev 21153)
+++ branches/modular_build/tests/features/org.jboss.tools.all.test.feature/feature.xml 2010-03-31 15:35:24 UTC (rev 21154)
@@ -22,7 +22,7 @@
Raleigh NC 27606 USA.
</license>
- <plugin
+ <!-- <plugin
id="org.eclipse.ant.optional.junit"
download-size="0"
install-size="0"
@@ -33,7 +33,7 @@
id="org.eclipse.test"
download-size="0"
install-size="0"
- version="0.0.0"/>
+ version="0.0.0"/> -->
<plugin
id="org.jboss.tools.common.model.test"
14 years, 8 months
JBoss Tools SVN: r21153 - in trunk: jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-03-31 11:10:08 -0400 (Wed, 31 Mar 2010)
New Revision: 21153
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java
Log:
Set properly server runtime for struts test. Added timeouts when starting application server.
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-03-31 14:12:35 UTC (rev 21152)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTJBTExt.java 2010-03-31 15:10:08 UTC (rev 21153)
@@ -18,6 +18,7 @@
import org.apache.log4j.Logger;
import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Table;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
@@ -137,11 +138,12 @@
SWTEclipseExt swtEclipseExt = new SWTEclipseExt();
SWTBot servers = swtEclipseExt.showView(ViewType.SERVERS);
SWTBotTree serverTree = servers.tree();
-
ContextMenuHelper.prepareTreeItemForContextMenu(serverTree, index);
-
- new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree,
- menuLabel, false)).click();
+ SWTTestExt.util.waitForAll(timeOut);
+ SWTBotMenu menu = new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree,
+ menuLabel, false));
+ SWTTestExt.util.waitForAll(timeOut);
+ menu.click();
SWTTestExt.util.waitForAll(timeOut);
}
/**
@@ -192,19 +194,20 @@
if (serverTreeItemChildren != null && serverTreeItemChildren.length > 0){
int itemIndex = 0;
boolean found = false;
+ String treeItemlabel = null;
do{
- String treeItemlabel = serverTreeItemChildren[itemIndex].getText();
+ treeItemlabel = serverTreeItemChildren[itemIndex].getText();
found = treeItemlabel.startsWith(projectName)
&& (suffix == null || treeItemlabel.endsWith(suffix));
} while (!found && ++itemIndex < serverTreeItemChildren.length);
// Server Tree Item has Child with Text equal to JSF TEst Project
if (found){
- log.info("Found project to be removed from server: " + serverTreeItemChildren[itemIndex].getText());
+ log.info("Found project to be removed from server: " + treeItemlabel);
ContextMenuHelper.prepareTreeItemForContextMenu(serverTree,serverTreeItemChildren[itemIndex]);
new SWTBotMenu(ContextMenuHelper.getContextMenu(serverTree, IDELabel.Menu.REMOVE, false)).click();
bot.shell("Server").activate();
bot.button(IDELabel.Button.OK).click();
- log.info("Removed project from server: " + serverTreeItemChildren[itemIndex].getText());
+ log.info("Removed project from server: " + treeItemlabel);
bot.sleep(10*1000L);
}
}
@@ -394,5 +397,51 @@
removeProjectFromServers(projectName);
removeProjectFromServers("/" + projectName,"-ds.xml");
}
-
+ /**
+ * Returns string representing version of defined Server Runtime on rowIndex position in Defined Server Runtime table
+ * @param bot
+ * @param rowIndex
+ * @return null when no server runtime is specified, "unknown when not possible to determine server runtime version" or server runtime version
+ */
+ public static String getDefinedServerRuntimeVersion(SWTWorkbenchBot bot , int rowIndex){
+
+ String result = null;
+
+ bot.menu(IDELabel.Menu.WINDOW).menu(IDELabel.Menu.PREFERENCES).click();
+ bot.shell(IDELabel.Shell.PREFERENCES).activate();
+ bot.tree().expandNode(IDELabel.PreferencesDialog.SERVER_GROUP).select(
+ PreferencesDialog.RUNTIME_ENVIRONMENTS);
+
+ SWTBotTable serverRuntimesTable = bot.table();
+ if (serverRuntimesTable.rowCount() > rowIndex){
+ String[] splitServerRuntimeType = serverRuntimesTable.cell(rowIndex, 1).split(" ");
+ int index = 0;
+ while (index < splitServerRuntimeType.length && result == null){
+ if (splitServerRuntimeType[index].length() > 0 &&
+ splitServerRuntimeType[index].charAt(0) >= '0' &&
+ splitServerRuntimeType[index].charAt(0) <= '9'){
+ result = splitServerRuntimeType[index].trim();
+ }
+ else{
+ index++;
+ }
+ }
+ }
+
+ bot.button(IDELabel.Button.OK).click();
+
+ return result;
+
+ }
+
+ /**
+ * Returns string representing version of defined Server Runtime on index position in Defined Server Runtime table
+ * @param rowIndex
+ * @return null when no server runtime is specified, "unknown when not possible to determine server runtime version" or server runtime version
+ */
+ public String getDefinedServerRuntimeVersion(int index){
+
+ return SWTJBTExt.getDefinedServerRuntimeVersion(bot,index);
+
+ }
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-03-31 14:12:35 UTC (rev 21152)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2010-03-31 15:10:08 UTC (rev 21153)
@@ -261,6 +261,7 @@
public static final String JBOSS_EAP_4_3 = "JBoss EAP 4.3 Runtime";
// Server Runtime with this Label is created during JBDS installation for bundled EAP
public static final String JBOSS_EAP = "jboss-eap Runtime";
+ public static final String JBOSS_EAP_5_0 = "JBoss EAP 5.0 Runtime";
}
Modified: trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java 2010-03-31 14:12:35 UTC (rev 21152)
+++ trunk/struts/tests/org.jboss.tools.struts.ui.bot.test/src/org/jboss/tools/struts/ui/bot/test/smoke/CreateNewStrutsProjectTest.java 2010-03-31 15:10:08 UTC (rev 21153)
@@ -30,28 +30,51 @@
* Test create new Struts Project
*/
@Test
- public void testCreateNewStrutsProject() {
- if (!SWTJBTExt.isServerRuntimeDefined(bot)){
+ public void testCreateNewStrutsProject() {
+ // Default server version is 4.3
+ String serverGroup = IDELabel.ServerGroup.JBOSS_EAP_4_3;
+ String serverType = IDELabel.ServerType.JBOSS_EAP_4_3;
+
+ if (!SWTJBTExt.isServerRuntimeDefined(bot)) {
eclipse.addServerRuntime(IDELabel.ServerRuntimeName.JBOSS_EAP_4_3,
IDELabel.ServerGroup.JBOSS_EAP_4_3,
- IDELabel.ServerRuntimeType.JBOSS_EAP_4_3,
- StrutsAllBotTests.getProperty("JBossEap4.3Home"));
+ IDELabel.ServerRuntimeType.JBOSS_EAP_4_3, StrutsAllBotTests
+ .getProperty("JBossEap4.3Home"));
}
- eclipse.showView(ViewType.WEB_PROJECTS);
- eclipse.createNew(EntityType.STRUTS_PROJECT);
- bot.shell(IDELabel.Shell.NEW_STRUTS_PROJECT).activate();
- bot.textWithLabel(IDELabel.NewStrutsProjectDialog.NAME).setText(StrutsAllBotTests.STRUTS_PROJECT_NAME);
- bot.comboBoxWithLabel(IDELabel.NewStrutsProjectDialog.TEMPLATE).setSelection(IDELabel.NewStrutsProjectDialog.TEMPLATE_KICK_START);
- bot.button(IDELabel.Button.NEXT).click();
- SWTJBTExt.addServerToServerViewOnWizardPage(bot, IDELabel.ServerGroup.JBOSS_EAP_4_3, IDELabel.ServerType.JBOSS_EAP_4_3);
- bot.sleep(1000L);
- bot.button(IDELabel.Button.NEXT).click();
- bot.button(IDELabel.Button.FINISH).click();
+ else{
+ // Check version of already defined server runtime
+ String serverRuntimeVersion = SWTJBTExt.getDefinedServerRuntimeVersion(bot, 0);
+ if (serverRuntimeVersion != null){
+ if (serverRuntimeVersion.equals("5.0")){
+ serverGroup = IDELabel.ServerGroup.JBOSS_EAP_5_0;
+ serverType = IDELabel.ServerType.JBOSS_EAP_5_0;
+ }else if(!serverRuntimeVersion.equals("4.3")){
+ throw new RuntimeException("Unsupported server runtime: " + serverRuntimeVersion);
+ }
+ }
+ else{
+ throw new RuntimeException("Unsupported server runtime: " + serverRuntimeVersion);
+ }
+ }
+ eclipse.showView(ViewType.WEB_PROJECTS);
+ eclipse.createNew(EntityType.STRUTS_PROJECT);
+ bot.shell(IDELabel.Shell.NEW_STRUTS_PROJECT).activate();
+ bot.textWithLabel(IDELabel.NewStrutsProjectDialog.NAME).setText(
+ StrutsAllBotTests.STRUTS_PROJECT_NAME);
+ bot.comboBoxWithLabel(IDELabel.NewStrutsProjectDialog.TEMPLATE)
+ .setSelection(IDELabel.NewStrutsProjectDialog.TEMPLATE_KICK_START);
+ bot.button(IDELabel.Button.NEXT).click();
+ SWTJBTExt.addServerToServerViewOnWizardPage(bot,
+ serverGroup, serverType);
+ bot.sleep(1000L);
+ bot.button(IDELabel.Button.NEXT).click();
+ bot.button(IDELabel.Button.FINISH).click();
eclipse.closeOpenAssociatedPerspectiveShellIfOpened(false);
-
- assertTrue("Project "+ StrutsAllBotTests.STRUTS_PROJECT_NAME + " was not created properly.",
- SWTEclipseExt.treeContainsItemWithLabel(bot.viewByTitle(IDELabel.View.WEB_PROJECTS).bot().tree(),
- StrutsAllBotTests.STRUTS_PROJECT_NAME));
- }
-
+
+ assertTrue("Project " + StrutsAllBotTests.STRUTS_PROJECT_NAME
+ + " was not created properly.", SWTEclipseExt
+ .treeContainsItemWithLabel(bot.viewByTitle(IDELabel.View.WEB_PROJECTS)
+ .bot().tree(), StrutsAllBotTests.STRUTS_PROJECT_NAME));
+ }
+
}
14 years, 8 months
JBoss Tools SVN: r21152 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-31 10:12:35 -0400 (Wed, 31 Mar 2010)
New Revision: 21152
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6086
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2010-03-31 14:02:25 UTC (rev 21151)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2010-03-31 14:12:35 UTC (rev 21152)
@@ -23,12 +23,10 @@
import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
import org.jboss.tools.common.model.ui.outline.XModelObjectContentOutlineProvider;
import org.jboss.tools.common.model.ui.select.XModelObjectSelectionProvider;
-import org.jboss.tools.common.model.ui.wizards.one.ServiceDialogOption;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.*;
@@ -36,7 +34,6 @@
import org.eclipse.ui.dialogs.SaveAsDialog;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.part.MultiPageEditorSite;
@@ -46,11 +43,8 @@
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.osgi.framework.Bundle;
import org.jboss.tools.common.meta.action.XAction;
import org.jboss.tools.common.meta.action.XActionInvoker;
-import org.jboss.tools.common.meta.key.WizardKeys;
-import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
@@ -99,7 +93,15 @@
protected void setInput(IEditorInput input) {
super.setInput(XModelObjectEditorInput.checkInput(input));
updateFile();
- firePropertyChange(IEditorPart.PROP_INPUT);
+ if(Display.getCurrent() == null) {
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_INPUT);
+ }
+ });
+ } else {
+ firePropertyChange(IEditorPart.PROP_INPUT);
+ }
}
protected IEditorSite createSite(IEditorPart editor) {
@@ -421,11 +423,10 @@
}
}
} else {
- int offset = marker.getAttribute(IMarker.CHAR_START, -1);
- int length = marker.getAttribute(IMarker.CHAR_END, -1);
- if (offset > -1 && length > -1) {
- postponedTextSelection.clean();
- if(textEditor != null) textEditor.gotoMarker(marker);
+ postponedTextSelection.clean();
+ if(textEditor != null) {
+ switchToPage(getSourcePageIndex());
+ textEditor.gotoMarker(marker);
}
}
}
@@ -1121,7 +1122,7 @@
}
public void resourceChanged(IResourceChangeEvent event) {
- IEditorInput ei = editorPart.getEditorInput();
+ final IEditorInput ei = editorPart.getEditorInput();
if(ei instanceof IModelObjectEditorInput) {
XModelObject o = ((IModelObjectEditorInput)ei).getXModelObject();
@@ -1146,21 +1147,20 @@
if(p instanceof FolderImpl) {
((FolderImpl)p).update();
}
- XModelObject o = EclipseResourceUtil.getObjectByResource(f);
+ final XModelObject o = EclipseResourceUtil.getObjectByResource(f);
if(f != null && f.exists() && o != null) {
if(editorPart instanceof ObjectMultiPageEditor) {
- ObjectMultiPageEditor e = (ObjectMultiPageEditor)editorPart;
+ final ObjectMultiPageEditor e = (ObjectMultiPageEditor)editorPart;
if(ei instanceof XModelObjectEditorInput) {
- IEditorInput e2 = XModelObjectEditorInput.createInstance(o);
- e.setInput(e2);
- e.updateTitle();
- if(e.textEditor instanceof AbstractTextEditor) {
- ((AbstractTextEditor)e.textEditor).setInput(e2);
- ((XModelObjectEditorInput)ei).synchronize();
- if(((XModelObjectEditorInput)ei).getXModelObject() != o) {
- closeEditor();
- return;
- }
+ final IEditorInput e2 = XModelObjectEditorInput.createInstance(o);
+ if(Display.getCurrent() == null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ apply(e, o, ei, e2);
+ }
+ });
+ } else {
+ apply(e, o, ei, e2);
}
}
}
@@ -1168,6 +1168,19 @@
if(f == null || f.exists()) return;
closeEditor();
}
+
+ void apply(ObjectMultiPageEditor e, XModelObject o, IEditorInput ei, IEditorInput e2) {
+ e.setInput(e2);
+ e.updateTitle();
+ if(e.textEditor instanceof AbstractTextEditor) {
+ ((AbstractTextEditor)e.textEditor).setInput(e2);
+ ((XModelObjectEditorInput)ei).synchronize();
+ if(((XModelObjectEditorInput)ei).getXModelObject() != o) {
+ closeEditor();
+ return;
+ }
+ }
+ }
private void closeEditor() {
Display.getDefault().asyncExec(new Runnable() {
14 years, 8 months
JBoss Tools SVN: r21151 - in trunk/common/plugins/org.jboss.tools.common.verification: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-31 10:02:25 -0400 (Wed, 31 Mar 2010)
New Revision: 21151
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.verification/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5827
Modified: trunk/common/plugins/org.jboss.tools.common.verification/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/META-INF/MANIFEST.MF 2010-03-31 14:01:35 UTC (rev 21150)
+++ trunk/common/plugins/org.jboss.tools.common.verification/META-INF/MANIFEST.MF 2010-03-31 14:02:25 UTC (rev 21151)
@@ -20,6 +20,7 @@
org.eclipse.ui,
org.jboss.tools.common.model,
org.eclipse.core.resources,
- org.eclipse.core.runtime
+ org.eclipse.core.runtime,
+ org.eclipse.wst.validation
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/common/plugins/org.jboss.tools.common.verification/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/plugin.xml 2010-03-31 14:01:35 UTC (rev 21150)
+++ trunk/common/plugins/org.jboss.tools.common.verification/plugin.xml 2010-03-31 14:02:25 UTC (rev 21151)
@@ -56,4 +56,32 @@
<xclass id="org.jboss.tools.common.verification.vrules.model.VRulesTree"
class="org.jboss.tools.common.verification.vrules.model.VRulesTree"/>
</extension>
+
+
+ <extension
+ point="org.eclipse.wst.validation.validator"
+ id="CommonVerification"
+ name="Project Verification">
+ <validator>
+ <projectNature id="org.eclipse.jdt.core.javanature" />
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.xml"/>
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.tld"/>
+ <markerId
+ markerIdValue="org.jboss.tools.jst.web.ui.strutsmarker">
+ </markerId>
+ <helper
+ class="org.eclipse.wst.validation.internal.operations.WorkbenchContext">
+ </helper>
+ <run
+ class="org.jboss.tools.common.verification.vrules.core.resources.CommonValidator"
+ incremental="true"
+ fullBuild="true"
+ />
+ </validator>
+ </extension>
+
</plugin>
\ No newline at end of file
14 years, 8 months
JBoss Tools SVN: r21150 - trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-31 10:01:35 -0400 (Wed, 31 Mar 2010)
New Revision: 21150
Added:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/CommonValidator.java
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/VerifyBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5827
Added: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/CommonValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/CommonValidator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/CommonValidator.java 2010-03-31 14:01:35 UTC (rev 21150)
@@ -0,0 +1,158 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.verification.vrules.core.resources;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.verification.vrules.VHelper;
+import org.jboss.tools.common.verification.vrules.VModel;
+import org.jboss.tools.common.verification.vrules.VObject;
+import org.jboss.tools.common.verification.vrules.VRule;
+import org.jboss.tools.common.verification.vrules.VTask;
+import org.jboss.tools.common.verification.vrules.layer.VModelFactory;
+
+/**
+ * This Manager invokes all dependent validators that should be invoked in one job.
+ * We need this one because wst validation framework does not let us invoke
+ * dependent validators in the same job.
+ * @author Alexey Kazakov
+ */
+public class CommonValidator implements IValidatorJob {
+
+ private static Set<IProject> validatingProjects = new HashSet<IProject>();
+
+ public CommonValidator() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#getSchedulingRule(org.eclipse.wst.validation.internal.provisional.core.IValidationContext)
+ */
+ public ISchedulingRule getSchedulingRule(IValidationContext helper) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.validation.internal.provisional.core.IValidatorJob#validateInJob(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
+ */
+ public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
+ IWorkbenchContext validationHelper = (IWorkbenchContext)helper;
+ IProject project = validationHelper.getProject();
+ String[] uris = validationHelper.getURIs();
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ if(project == null && uris != null && uris.length != 0) {
+ for (String s: uris) {
+ IProject f = root.getProject(new Path(s).segment(0));
+ if(f != null && f.exists()) {
+ project = f;
+ break;
+ }
+ }
+ }
+
+ if(project == null) {
+ return OK_STATUS;
+ }
+ IModelNature n = EclipseResourceUtil.getModelNature(project);
+ XModel model = n == null ? null : n.getModel();
+ if(model == null || VHelper.getManager() == null) {
+ return OK_STATUS;
+ }
+ VModel vmodel = VModelFactory.getModel(model);
+ if(vmodel == null) {
+ return OK_STATUS;
+ }
+ if(uris == null || uris.length == 0) {
+ XModelObject object = FileSystemsHelper.getWebInf(model);
+ if(object == null) {
+ return OK_STATUS;
+ }
+ VObject vobject = vmodel.getObjectByPath(object.getPath());
+ VRule[] rules = VHelper.getRules(VHelper.getManager(), vobject);
+ if(rules == null) return OK_STATUS;
+ VTask task = VHelper.getManager().createTask(vobject);
+ VTaskListenerImpl listener = new VTaskListenerImpl();
+ listener.setModel(model);
+ listener.setTask(task);
+ listener.setSignificance(VHelper.getManager().getMinSignificance());
+ task.addTaskListener(listener);
+ task.run();
+ task.removeTaskListener(listener);
+ return OK_STATUS;
+ }
+ List<IFile> files = new ArrayList<IFile>();
+ for (String uri: uris) {
+ IFile f = root.getFile(new Path(uri));
+ if(f != null && f.exists() && f.getProject() == project) {
+ files.add(f);
+ }
+ }
+ if(files.isEmpty()) {
+ return OK_STATUS;
+ }
+ IStatus status = OK_STATUS;
+ for (IFile file: files) {
+ XModelObject object = EclipseResourceUtil.getObjectByResource(file);
+ if(object == null) continue;
+ VObject vobject = vmodel.getObjectByPath(object.getPath());
+ if(vobject == null) continue;
+ VRule[] rules = VHelper.getRules(VHelper.getManager(), vobject);
+ if(rules == null) continue;
+ VTask task = VHelper.getManager().createTask(vobject);
+ VTaskListenerImpl listener = new VTaskListenerImpl();
+ listener.setModel(model);
+ listener.setTask(task);
+ listener.setSignificance(VHelper.getManager().getMinSignificance());
+ task.addTaskListener(listener);
+ task.run();
+ task.removeTaskListener(listener);
+ }
+ return status;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#cleanup(org.eclipse.wst.validation.internal.provisional.core.IReporter)
+ */
+ public void cleanup(IReporter reporter) {
+ reporter = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.validation.internal.provisional.core.IValidator#validate(org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
+ */
+ public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
+ validateInJob(helper, reporter);
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/CommonValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/VerifyBuilder.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/VerifyBuilder.java 2010-03-31 13:53:56 UTC (rev 21149)
+++ trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/core/resources/VerifyBuilder.java 2010-03-31 14:01:35 UTC (rev 21150)
@@ -17,27 +17,27 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.verification.vrules.plugin.VerificationPlugin;
+//This builder is obsolete. It's functionality is moved to WTP's Validation framework.
+//The builder is preserved for backward compatibility.
public class VerifyBuilder extends IncrementalProjectBuilder
{
public static final String BUILDER_ID = VerificationPlugin.PLUGIN_ID + ".verifybuilder"; //$NON-NLS-1$
- GlobalBuilderImpl builderImpl = null;
+// GlobalBuilderImpl builderImpl = null;
protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
throws CoreException
{
- IProject currentProject = getProject();
- IModelNature n = EclipseResourceUtil.getModelNature(currentProject);
- if (n != null) {
- if(builderImpl == null) {
- builderImpl = new GlobalBuilderImpl();
- builderImpl.setModel(n.getModel());
- }
- builderImpl.execute(null);
- }
+// IProject currentProject = getProject();
+// IModelNature n = EclipseResourceUtil.getModelNature(currentProject);
+// if (n != null) {
+// if(builderImpl == null) {
+// builderImpl = new GlobalBuilderImpl();
+// builderImpl.setModel(n.getModel());
+// }
+// builderImpl.execute(null);
+// }
return null;
}
14 years, 8 months
JBoss Tools SVN: r21149 - trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-31 09:53:56 -0400 (Wed, 31 Mar 2010)
New Revision: 21149
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsProject.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5827
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsProject.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsProject.java 2010-03-31 13:52:04 UTC (rev 21148)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/StrutsProject.java 2010-03-31 13:53:56 UTC (rev 21149)
@@ -28,7 +28,8 @@
public void configure() throws CoreException {
super.configure();
- addToBuildSpec(BUILDER_ID);
+//Verify builder is deprecated. WTP's validation framework is used for the functionality.
+// addToBuildSpec(BUILDER_ID);
}
public void deconfigure() throws CoreException {
14 years, 8 months
JBoss Tools SVN: r21148 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-03-31 09:52:04 -0400 (Wed, 31 Mar 2010)
New Revision: 21148
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSFNature.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5827
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSFNature.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSFNature.java 2010-03-31 13:10:54 UTC (rev 21147)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSFNature.java 2010-03-31 13:52:04 UTC (rev 21148)
@@ -42,7 +42,8 @@
public void configure() throws CoreException {
super.configure();
- addToBuildSpec(BUILDER_ID);
+//Verify builder is deprecated. WTP's validation framework is used for the functionality.
+// addToBuildSpec(BUILDER_ID);
}
public void deconfigure() throws CoreException {
14 years, 8 months