JBoss Tools SVN: r34165 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/util.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-23 07:46:46 -0400 (Tue, 23 Aug 2011)
New Revision: 34165
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/util/CommandUtils.java
Log:
added copyright header and author
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/util/CommandUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/util/CommandUtils.java 2011-08-23 11:18:02 UTC (rev 34164)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.ui/src/org/jboss/ide/eclipse/as/egit/internal/ui/util/CommandUtils.java 2011-08-23 11:46:46 UTC (rev 34165)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.egit.internal.ui.util;
import org.eclipse.core.commands.Command;
@@ -13,6 +23,9 @@
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.handlers.IHandlerService;
+/**
+ * @author André Dietisheim
+ */
public class CommandUtils {
public static boolean executeCommand(String commandId, IStructuredSelection selection) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {
14 years, 7 months
JBoss Tools SVN: r34164 - in trunk: cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2011-08-23 07:18:02 -0400 (Tue, 23 Aug 2011)
New Revision: 34164
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/WSAllBotTests.launch
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/jbt/SampleWSTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/jbt/WsTesterTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WsClientTest.java
Log:
Bot tests operating on Quick Fixed of CDI components have been added
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/CDIQuickFixTest.java 2011-08-23 11:18:02 UTC (rev 34164)
@@ -8,6 +8,7 @@
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
@@ -17,6 +18,7 @@
import org.jboss.tools.ui.bot.ext.view.ProblemsView;
import org.junit.After;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
@@ -32,16 +34,22 @@
@SuiteClasses({ CDIAllBotTests.class })
public class CDIQuickFixTest extends SWTTestExt {
- private static final Logger LOGGER = Logger.getLogger(CDIQuickFixTest.class.getName());
+ private static final Logger LOGGER = Logger.getLogger(CDIQuickFixTest.class
+ .getName());
private static final String PROJECT_NAME = "CDIProject";
private static final String PACKAGE_NAME = "org.cdi.test";
+ private static SWTBotTreeItem[] problemsTrees;
+ private static final String LINE_SEPARATOR = System.getProperty("line.separator");
+ private enum ANNOTATIONS {TARGET, RETENTION, NAMED, TYPED}
@BeforeClass
public static void setup() {
eclipse.showView(ViewType.PROJECT_EXPLORER);
- CDIUtil.createAndCheckCDIProject(bot, util, projectExplorer, PROJECT_NAME);
+ CDIUtil.disableFolding(bot, util);
+ CDIUtil.createAndCheckCDIProject(bot, util, projectExplorer,
+ PROJECT_NAME);
}
-
+
@After
public void waitForJobs() {
util.waitForNonIgnoredJobs();
@@ -62,21 +70,20 @@
CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
.getResourceAsStream("/resources/cdi/B1.java.cdi"), false);
assertContains("@SessionScoped", ed.toTextEditor().getText());
- SWTBotTreeItem[] warningTrees = ProblemsView.
- getFilteredWarningsTreeItems(bot, "Managed bean B1 which", "/"
- + PROJECT_NAME, "B1.java", "CDI Problem");
- assertTrue(warningTrees.length == 1);
-
- CDIUtil.resolveQuickFix(warningTrees[0], bot, util);
+ problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
+ "Managed bean B1 which", "/" + PROJECT_NAME, "B1.java",
+ "CDI Problem");
+ assertTrue(problemsTrees.length == 1);
+
+ CDIUtil.resolveQuickFix(problemsTrees[0], bot, util);
SWTBotEclipseEditor eclEditor = ed.toTextEditor();
assertTrue(eclEditor.getText().contains("import java.io.Serializable;"));
- warningTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
+ problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
"Managed bean B1 which", "/" + PROJECT_NAME, "B1.java",
"CDI Problem");
- assertTrue(warningTrees.length == 0);
+ assertTrue(problemsTrees.length == 0);
}
-
@Test
public void testMultipleBeansQF() {
CDIUtil.bean(PACKAGE_NAME, "Animal", true, false, false, false, null,
@@ -106,54 +113,268 @@
assertTrue(("Q1.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
LOGGER.fine(code);
-
- CDIUtil.bean(PACKAGE_NAME, "BrokenFarm", true, false, false, false, null,
- null, null, null).finish();
+
+ CDIUtil.bean(PACKAGE_NAME, "BrokenFarm", true, false, false, false,
+ null, null, null, null).finish();
util.waitForNonIgnoredJobs();
ed = bot.activeEditor();
CDIUtil.copyResourceToClass(ed, CDIQuickFixTest.class
- .getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"), false);
+ .getResourceAsStream("/resources/cdi/BrokenFarm.java.cdi"),
+ false);
assertTrue(("BrokenFarm.java").equals(ed.getTitle()));
code = ed.toTextEditor().getText();
LOGGER.fine(code);
assertTrue(code.contains("package " + PACKAGE_NAME + ";"));
assertTrue(code.contains("public class BrokenFarm {"));
assertTrue(code.contains("@Inject private Animal animal;"));
-
- SWTBotTreeItem[] warningTrees = ProblemsView
- .getFilteredWarningsTreeItems(bot, "Multiple beans are eligible", "/"
- + PROJECT_NAME, "BrokenFarm.java", "CDI Problem");
- assertTrue("Warnings node should contain only one record instead of "
- + warningTrees.length + " records.", warningTrees.length == 1);
-
- CDIUtil.openQuickFix(warningTrees[0], bot, util);
+
+ problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
+ "Multiple beans are eligible", "/" + PROJECT_NAME,
+ "BrokenFarm.java", "CDI Problem");
+ assertTrue(problemsTrees.length == 1);
+
+ CDIUtil.openQuickFix(problemsTrees[0], bot);
String qualifBean = null;
if (bot.table(0).cell(0, 0).contains("Animal")) {
qualifBean = "Animal";
- }else {
+ } else {
qualifBean = "Dog";
}
bot.activeShell().bot().button("Finish").click();
bot.sleep(Timing.time2S());
util.waitForNonIgnoredJobs();
assertFalse(bot.button("Add >").isEnabled());
- assertFalse(bot.button("Finish").isEnabled());
+ assertFalse(bot.button("Finish").isEnabled());
bot.table(0).click(bot.table(0).indexOf("Q1 - " + PACKAGE_NAME), 0);
assertTrue(bot.button("Add >").isEnabled());
assertFalse(bot.button("Finish").isEnabled());
bot.clickButton("Add >");
assertTrue(bot.button("Finish").isEnabled());
bot.clickButton("Finish");
-
+
bot.sleep(Timing.time2S());
util.waitForNonIgnoredJobs();
code = ed.toTextEditor().getText();
assertTrue(code.contains("@Inject @Q1 private Animal animal;"));
code = bot.editorByTitle(qualifBean + ".java").toTextEditor().getText();
assertTrue(code.contains("@Q1"));
- warningTrees = ProblemsView
- .getFilteredWarningsTreeItems(bot, "Multiple beans are eligible", "/"
- + PROJECT_NAME, "BrokenFarm.java", "CDI Problem");
+ problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot,
+ "Multiple beans are eligible", "/" + PROJECT_NAME,
+ "BrokenFarm.java", "CDI Problem");
+ assertTrue(problemsTrees.length == 0);
+ }
+
+ @Test
+ public void testStereoscopeQF() {
+ CDIUtil.stereotype(PACKAGE_NAME, "S1", null, null, false, false, false,
+ false).finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEclipseEditor ed = bot.activeEditor().toTextEditor();
+ checkStartupWarnings(bot);
+ prepareStereoscope(ed);
+
+ // 1.QF - https://issues.jboss.org/browse/JBIDE-7630
+ checkTargetAnnotation(ed);
+
+ // 2.QF - https://issues.jboss.org/browse/JBIDE-7631
+ checkRetentionAnnotation(ed);
+
+ // 3.QF - https://issues.jboss.org/browse/JBIDE-7634
+ checkNamedAnnotation(ed);
+
+ // 4.QF - https://issues.jboss.org/browse/JBIDE-7640
+ checkTypedAnnotation(ed);
+ }
+
+ @Ignore("not ready yet")
+ @Test
+ public void testQualifiersQF() {
+ /*
+ * 2 QF
+ */
+
+ CDIUtil.qualifier(PACKAGE_NAME, "Q1", false, false).finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = bot.activeEditor();
+ ed.setFocus();
+ }
+
+ @Ignore("not ready yet")
+ @Test
+ public void testScopeQF() {
+ /*
+ * 2 QF
+ */
+
+ CDIUtil.scope(PACKAGE_NAME, "Scope1", false, false, true, false)
+ .finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = bot.activeEditor();
+ ed.setFocus();
+ }
+
+ @Ignore("not ready yet")
+ @Test
+ public void testBeanQF() {
+ /*
+ * 5 QF
+ */
+
+ CDIUtil.bean(PACKAGE_NAME, "MyBean", true, false, false, false, null,
+ null, null, null).finish();
+ util.waitForNonIgnoredJobs();
+ SWTBotEditor ed = bot.activeEditor();
+ ed.setFocus();
+ }
+
+ @Ignore("not ready yet")
+ @Test
+ public void testInterDecorQF() {
+ /*
+ * 5 QF
+ *
+ * tu vytvorim jednotnu metodu, s jednym parametrom - ci iner alebo
+ * decor jediny zmysel pri vytvarani komponenty, potom by to malo byt
+ * rovnake
+ */
+ }
+
+ private void prepareStereoscope(SWTBotEclipseEditor ed) {
+ CDIUtil.replaceInEditor(ed, bot, "@Target({ TYPE, METHOD, FIELD })",
+ "@Target({TYPE, METHOD, FIELD})");
+ }
+
+ private void prepareNamedAnnotation(SWTBotEclipseEditor ed, boolean add) {
+ if (add) {
+ ed.toTextEditor().insertText(ed.getLineCount()-4 , 0,
+ "@Named(\"Stereoscope\")" + LINE_SEPARATOR);
+ ed.toTextEditor().insertText(6 , 0, "import javax.inject.Named;" + LINE_SEPARATOR);
+ } else {
+ CDIUtil.replaceInEditor(ed, bot, "@Named", "");
+ CDIUtil.replaceInEditor(ed, bot,
+ "import javax.inject.Named;", "");
+ }
+ bot.sleep(Timing.time2S());
+ ed.save();
+ }
+
+ private void prepareTypedAnnotation(SWTBotEclipseEditor ed) {
+ ed.toTextEditor().insertText(ed.getLineCount()-4 , 0,
+ "@Typed" + LINE_SEPARATOR);
+ ed.toTextEditor().insertText(6 , 0, "import javax.enterprise.inject.Typed;" + LINE_SEPARATOR);
+ bot.sleep(Timing.time2S());
+ ed.save();
+ }
+
+ private void checkStartupWarnings(SWTBotExt bot) {
+ SWTBotTreeItem[] warningTrees = ProblemsView
+ .getFilteredWarningsTreeItems(bot, null, "/" + PROJECT_NAME,
+ "S1.java", "CDI Problem");
assertTrue(warningTrees.length == 0);
}
+
+ private void checkTargetAnnotation(SWTBotEclipseEditor ed) {
+ checkTargetAnnotWithReplac(ed, "@Target({TYPE, FIELD})");
+ checkTargetAnnotWithReplac(ed, "");
+ }
+
+ private void checkTargetAnnotWithReplac(SWTBotEclipseEditor ed, String replacement) {
+ CDIUtil.replaceInEditor(ed, bot, "@Target({TYPE, METHOD, FIELD})",
+ replacement);
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.ElementType.METHOD;", "");
+ if (replacement.equals("")) {
+ CDIUtil.replaceInEditor(ed, bot,
+ "import java.lang.annotation.Target;", "");
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.ElementType.TYPE;", "");
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.ElementType.FIELD;", "");
+ }
+ checkSimpleQuickFix(ANNOTATIONS.TARGET, replacement, ed);
+ }
+
+ private void checkRetentionAnnotation(SWTBotEclipseEditor ed) {
+ checkRetenAnnotWithReplac(ed, "@Retention(CLASS)");
+ checkRetenAnnotWithReplac(ed, "");
+ }
+
+ private void checkRetenAnnotWithReplac(SWTBotEclipseEditor ed, String replacement) {
+ CDIUtil.replaceInEditor(ed, bot, "@Retention(RUNTIME)", replacement);
+ if (replacement.equals("@Retention(CLASS)")) {
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.RetentionPolicy.RUNTIME;",
+ "import static java.lang.annotation.RetentionPolicy.CLASS;");
+ } else {
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.RetentionPolicy.RUNTIME;",
+ "");
+ CDIUtil.replaceInEditor(ed, bot,
+ "import java.lang.annotation.Retention;", "");
+ }
+
+ checkSimpleQuickFix(ANNOTATIONS.RETENTION, replacement, ed);
+ }
+
+ private void checkNamedAnnotation(SWTBotEclipseEditor ed) {
+ prepareNamedAnnotation(ed, true);
+ checkNamedAnnotWithReplac(ed, "@Named");
+ prepareNamedAnnotation(ed, false);
+ prepareNamedAnnotation(ed, true);
+ checkNamedAnnotWithReplac(ed, "");
+ }
+
+ private void checkNamedAnnotWithReplac(SWTBotEclipseEditor ed, String replacement) {
+ checkSimpleQuickFix(ANNOTATIONS.NAMED, replacement, ed);
+ }
+
+ private void checkTypedAnnotation(SWTBotEclipseEditor ed) {
+ prepareTypedAnnotation(ed);
+ checkTypedAnnotWithReplac(ed, "");
+ }
+
+ private void checkTypedAnnotWithReplac(SWTBotEclipseEditor ed, String replacement) {
+ checkSimpleQuickFix(ANNOTATIONS.TYPED, replacement, ed);
+ }
+
+ private void checkSimpleQuickFix(ANNOTATIONS annonType, String replacement,
+ SWTBotEclipseEditor ed) {
+ if (annonType == ANNOTATIONS.NAMED || annonType == ANNOTATIONS.TYPED) {
+ problemsTrees = ProblemsView.getFilteredErrorsTreeItems(bot, null, "/"
+ + PROJECT_NAME, "S1.java", "CDI Problem");
+ } else {
+ problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot, null, "/"
+ + PROJECT_NAME, "S1.java", "CDI Problem");
+ }
+ assertTrue(problemsTrees.length == 1);
+ if (annonType != ANNOTATIONS.NAMED) {
+ CDIUtil.resolveQuickFix(problemsTrees[0], bot, util);
+ if (annonType == ANNOTATIONS.RETENTION) {
+ if (replacement.equals("@Retention(CLASS)")) {
+ CDIUtil.replaceInEditor(ed, bot,
+ "import static java.lang.annotation.RetentionPolicy.CLASS;","");
+ }
+ }
+ } else {
+ if (replacement.equals("@Named")) {
+ CDIUtil.resolveQuickFix(problemsTrees[0], bot, util);
+ } else {
+ CDIUtil.openQuickFix(problemsTrees[0], bot);
+ bot.table(0).click(1, 0);
+ assertFalse(bot.button("Finish").isEnabled());
+ bot.table(1).getTableItem(0).check();
+ assertTrue(bot.button("Finish").isEnabled());
+ bot.clickButton("Finish");
+ bot.sleep(Timing.time2S());
+ util.waitForNonIgnoredJobs();
+ }
+ }
+ problemsTrees = ProblemsView.getFilteredWarningsTreeItems(bot, null, "/"
+ + PROJECT_NAME, "S1.java", "CDI Problem");
+ assertTrue(problemsTrees.length == 0);
+ problemsTrees = ProblemsView.getFilteredErrorsTreeItems(bot, null, "/"
+ + PROJECT_NAME, "S1.java", "CDI Problem");
+ assertTrue(problemsTrees.length == 0);
+ }
+
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIUtil.java 2011-08-23 11:18:02 UTC (rev 34164)
@@ -7,6 +7,7 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.Result;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -46,12 +47,12 @@
util.waitForNonIgnoredJobs();
}
- public static void openQuickFix(SWTBotTreeItem item, SWTBotExt bot, SWTUtilExt util) {
+ public static void openQuickFix(SWTBotTreeItem item, SWTBotExt bot) {
nodeContextMenu(bot.tree(), item, "Quick Fix").click();
}
public static void resolveQuickFix(SWTBotTreeItem item, SWTBotExt bot, SWTUtilExt util) {
- openQuickFix(item, bot, util);
+ openQuickFix(item, bot);
bot.activeShell().bot().button("Finish").click();
bot.sleep(Timing.time2S());
util.waitForNonIgnoredJobs();
@@ -67,6 +68,39 @@
if (closeEdit) classEdit.close();
}
+ public static void replaceInEditor(SWTBotEclipseEditor ed, SWTBotExt bot, String target, String replacement) {
+ ed.selectRange(0, 0, ed.getText().length());
+ ed.setText(ed.getText().replace(target +
+ (replacement.equals("")?System.getProperty("line.separator"):""),
+ replacement));
+ bot.sleep(Timing.time3S());
+ ed.save();
+ }
+
+ public static void disableFolding(SWTBotExt bot, SWTUtilExt util) {
+ editFolding(bot, util, false);
+ }
+
+ public static void enableFolding(SWTBotExt bot, SWTUtilExt util) {
+ editFolding(bot, util, true);
+ }
+
+ public static void editFolding(SWTBotExt bot, SWTUtilExt util, boolean select) {
+ bot.menu("Window").menu("Preferences").click();
+ bot.shell("Preferences").activate();
+ SWTBotTreeItem item = bot.tree(0).expandNode("Java", "Editor");
+ item.select("Folding");
+ SWTBotCheckBox foldCheckBox = bot.checkBox("Enable folding");
+ if (select) {
+ foldCheckBox.select();
+ } else {
+ foldCheckBox.deselect();
+ }
+ bot.button("OK").click();
+ bot.sleep(Timing.time2S());
+ util.waitForNonIgnoredJobs();
+ }
+
public static SWTBotMenu nodeContextMenu(final SWTBotTree tree,
SWTBotTreeItem item, final String... menu) {
assert menu.length > 0;
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/WSAllBotTests.launch
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/WSAllBotTests.launch 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/WSAllBotTests.launch 2011-08-23 11:18:02 UTC (rev 34164)
@@ -39,7 +39,7 @@
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms256m -Xmx1024m -Dswtbot.test.properties.file=${env_var:HOME}/swtbot.properties -Dusage_reporting_enabled=false"/>
<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.jboss.tools.tests.product"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="show_selected_only" value="false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WSAllBotTests.java 2011-08-23 11:18:02 UTC (rev 34164)
@@ -38,6 +38,7 @@
* @author Lukas Jungmann
* @author jjankovi
*/
+(a)RunWith(RequirementAwareSuite.class)
@SuiteClasses({
SampleWSTest.class,
BottomUpWSTest.class,
@@ -45,6 +46,5 @@
WsClientTest.class,
WsTesterTest.class
})
-(a)RunWith(RequirementAwareSuite.class)
public class WSAllBotTests {
}
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/jbt/SampleWSTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/jbt/SampleWSTest.java 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/jbt/SampleWSTest.java 2011-08-23 11:18:02 UTC (rev 34164)
@@ -11,7 +11,6 @@
package org.jboss.tools.ws.ui.bot.test.jbt;
import java.io.IOException;
-import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.MessageFormat;
@@ -24,14 +23,15 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ws.ui.bot.test.WSAllBotTests;
import org.jboss.tools.ws.ui.bot.test.uiutils.actions.NewSampleWSWizardAction;
import org.jboss.tools.ws.ui.bot.test.uiutils.actions.TreeItemAction;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.SampleWSWizard;
@@ -39,11 +39,13 @@
import org.jboss.tools.ws.ui.bot.test.utils.WSClient;
import org.jboss.tools.ws.ui.bot.test.wtp.WSTestBase;
import org.junit.AfterClass;
-import org.junit.Ignore;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
-@Require(server =
-@Server(), perspective = "Java EE")
+@Require(server=@Server(),perspective="Java EE")
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ WSAllBotTests.class})
public class SampleWSTest extends WSTestBase {
private static final String SOAP_REQUEST = getSoapRequest("<ns1:sayHello xmlns:ns1=\"http://{0}/\"><arg0>{1}</arg0></ns1:sayHello>");
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/jbt/WsTesterTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/jbt/WsTesterTest.java 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/jbt/WsTesterTest.java 2011-08-23 11:18:02 UTC (rev 34164)
@@ -26,8 +26,10 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
+import org.jboss.tools.ws.ui.bot.test.WSAllBotTests;
import org.jboss.tools.ws.ui.bot.test.widgets.SelectWSDLDialog;
import org.jboss.tools.ws.ui.bot.test.widgets.WsTesterView;
import org.jboss.tools.ws.ui.bot.test.widgets.WsTesterView.Request_Arg_Type;
@@ -35,6 +37,8 @@
import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
import org.junit.Assert;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
/**
* Tests for Web Service Tester
@@ -42,6 +46,8 @@
* @author jlukas
*/
@Require(perspective = "Java")
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ WSAllBotTests.class})
public class WsTesterTest extends SWTTestExt {
private static final Logger L = Logger.getLogger(WsTesterTest.class.getName());
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/BottomUpWSTest.java 2011-08-23 11:18:02 UTC (rev 34164)
@@ -10,13 +10,19 @@
******************************************************************************/
package org.jboss.tools.ws.ui.bot.test.wtp;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ws.ui.bot.test.WSAllBotTests;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.WsWizardBase.Slider_Level;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
@Require(server=@Server(),perspective="Java EE")
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ WSAllBotTests.class})
public class BottomUpWSTest extends WSTestBase {
//http://localhost:8080/BottomUpWS/ClassA?wsdl
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/TopDownWSTest.java 2011-08-23 11:18:02 UTC (rev 34164)
@@ -10,12 +10,18 @@
******************************************************************************/
package org.jboss.tools.ws.ui.bot.test.wtp;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ws.ui.bot.test.WSAllBotTests;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.WsWizardBase.Slider_Level;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
@Require(server=@Server(),perspective="Java EE")
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ WSAllBotTests.class})
public class TopDownWSTest extends WSTestBase {
@Override
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WsClientTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WsClientTest.java 2011-08-23 08:56:42 UTC (rev 34163)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/wtp/WsClientTest.java 2011-08-23 11:18:02 UTC (rev 34164)
@@ -12,13 +12,19 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ws.ui.bot.test.WSAllBotTests;
import org.jboss.tools.ws.ui.bot.test.uiutils.wizards.WsWizardBase.Slider_Level;
import org.junit.Assert;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
@Require(server=@Server(),perspective="Java EE")
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ WSAllBotTests.class})
public class WsClientTest extends WSTestBase {
@Override
14 years, 7 months
JBoss Tools SVN: r34163 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal: resource/java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-08-23 04:56:42 -0400 (Tue, 23 Aug 2011)
New Revision: 34163
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceParameterAnnotation.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationImpl.java
Log:
https://issues.jboss.org/browse/JBIDE-9562
JPA: Standalone annotations lose properties when become nested
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java 2011-08-23 08:12:13 UTC (rev 34162)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaGeneratorContainerImpl.java 2011-08-23 08:56:42 UTC (rev 34163)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2010-2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -11,7 +11,6 @@
package org.jboss.tools.hibernate.jpt.core.internal.context.java;
import java.util.Iterator;
-import java.util.List;
import java.util.ListIterator;
import java.util.Vector;
@@ -25,8 +24,6 @@
import org.eclipse.jpt.jpa.core.internal.context.ContextContainerTools;
import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaGeneratorContainer;
import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateAbstractJpaFactory;
import org.jboss.tools.hibernate.jpt.core.internal.context.GenericGenerator;
import org.jboss.tools.hibernate.jpt.core.internal.resource.java.GenericGeneratorAnnotation;
@@ -148,14 +145,14 @@
}
- protected void moveNamedQuery_(int index, JavaGenericGenerator genericGenerator) {
+ protected void moveGenericGenerator_(int index, JavaGenericGenerator genericGenerator) {
this.moveItemInList(index, genericGenerator, this.genericGenerators, GENERIC_GENERATORS_LIST);
}
protected JavaGenericGenerator addGenericGenerator_(int index, GenericGeneratorAnnotation ggAnnotation) {
- JavaGenericGenerator query = this.buildGenericGenerator(ggAnnotation);
- this.addItemToList(index, query, this.genericGenerators, GENERIC_GENERATORS_LIST);
- return query;
+ JavaGenericGenerator generator = this.buildGenericGenerator(ggAnnotation);
+ this.addItemToList(index, generator, this.genericGenerators, GENERIC_GENERATORS_LIST);
+ return generator;
}
protected void removeGenericGenerator_(JavaGenericGenerator rgenericGenerator) {
@@ -183,7 +180,7 @@
}
@Override
public void moveContextElement(int index, JavaGenericGenerator element) {
- HibernateJavaGeneratorContainerImpl.this.moveNamedQuery_(index, element);
+ HibernateJavaGeneratorContainerImpl.this.moveGenericGenerator_(index, element);
}
@Override
public void addContextElement(int index, GenericGeneratorAnnotation resourceElement) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java 2011-08-23 08:12:13 UTC (rev 34162)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/GenericGeneratorAnnotationImpl.java 2011-08-23 08:56:42 UTC (rev 34163)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+import java.util.HashMap;
+import java.util.List;
import java.util.ListIterator;
+import java.util.Map;
import java.util.Vector;
import org.eclipse.jdt.core.IAnnotation;
@@ -92,7 +95,40 @@
this.strategyTextRange = this.buildStrategyTextRange(astRoot);
AnnotationContainerTools.synchronize(this.parametersContainer, astRoot);
}
+
+ @Override
+ public void storeOn(Map<String, Object> map) {
+ super.storeOn(map);
+ map.put(NAME_PROPERTY, this.name);
+ this.name = null;
+ map.put(STRATEGY_PROPERTY, this.strategy);
+ this.strategy = null;
+
+ List<Map<String, Object>> paramStaet = this.buildStateList(this.parameters.size());
+ for (NestableParameterAnnotation param : nestableParameters()) {
+ Map<String, Object> hintState = new HashMap<String, Object>();
+ param.storeOn(hintState);
+ paramStaet.add(hintState);
+ }
+ map.put(PARAMETERS_LIST, paramStaet);
+ this.parameters.clear();
+ }
+
+ @Override
+ public void restoreFrom(Map<String, Object> map) {
+ super.restoreFrom(map);
+
+ this.setName((String) map.get(NAME_PROPERTY));
+ this.setStrategy((String) map.get(STRATEGY_PROPERTY));
+
+ @SuppressWarnings("unchecked")
+ List<Map<String, Object>> paramsState = (List<Map<String, Object>>) map.get(PARAMETERS_LIST);
+ for (Map<String, Object> paramState : paramsState) {
+ this.addParameter().restoreFrom(paramState);
+ }
+ }
+
public String getAnnotationName() {
return ANNOTATION_NAME;
}
@@ -191,6 +227,9 @@
//************************ parameters ***********************
+ private NestableParameterAnnotation addParameter() {
+ return this.addParameter(this.parameters.size());
+ }
public NestableParameterAnnotation addParameter(int index) {
return (NestableParameterAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.parametersContainer);
@@ -362,11 +401,11 @@
}
public static GenericGeneratorAnnotation createNestedGenericGenerator(
- JavaResourceNode parent, AnnotatedElement member,
+ JavaResourceNode parent, AnnotatedElement element,
int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
IndexedDeclarationAnnotationAdapter idaa = buildNestedHibernateDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(member, idaa);
- return new GenericGeneratorAnnotationImpl(parent, member, idaa, annotationAdapter);
+ IndexedAnnotationAdapter annotationAdapter = new ElementIndexedAnnotationAdapter(element, idaa);
+ return new GenericGeneratorAnnotationImpl(parent, element, idaa, annotationAdapter);
}
private static IndexedDeclarationAnnotationAdapter buildNestedHibernateDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter hibernateGenericGeneratorsAdapter) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java 2011-08-23 08:12:13 UTC (rev 34162)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedNativeQueryAnnotation.java 2011-08-23 08:56:42 UTC (rev 34163)
@@ -11,6 +11,7 @@
package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
import java.util.ListIterator;
+import java.util.Map;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
@@ -33,7 +34,6 @@
import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.jpa.core.resource.java.NestableQueryHintAnnotation;
import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
import org.jboss.tools.hibernate.jpt.core.internal.context.CacheModeType;
@@ -602,27 +602,57 @@
}
// ********** NestableAnnotation implementation **********
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- HibernateSourceNamedNativeQueryAnnotation oldQuery = (HibernateSourceNamedNativeQueryAnnotation) oldAnnotation;
- this.setName(oldQuery.getName());
- this.setQuery(oldQuery.getQuery());
- this.setFlushMode(oldQuery.getFlushMode());
- this.setCacheMode(oldQuery.getCacheMode());
- this.setCacheable(oldQuery.isCacheable());
- this.setComment(oldQuery.getComment());
- this.setFetchSize(oldQuery.getFetchSize());
- this.setTimeout(oldQuery.getTimeout());
- this.setCacheRegion(oldQuery.getCacheRegion());
- this.setReadOnly(oldQuery.isReadOnly());
- this.setCallable(oldQuery.isCallable());
- this.setResultClass(oldQuery.getResultClass());
- this.setResultSetMapping(oldQuery.getResultSetMapping());
+ @Override
+ public void storeOn(Map<String, Object> map) {
+ super.storeOn(map);
+
+ map.put(NAME_PROPERTY, this.name);
+ this.name = null;
+ map.put(QUERY_PROPERTY, this.query);
+ this.query = null;
+ map.put(FLUSH_MODE_PROPERTY, this.flushMode);
+ this.flushMode = null;
+ map.put(CACHE_MODE_PROPERTY, this.cacheMode);
+ this.cacheMode = null;
+ map.put(CACHEABLE_PROPERTY, this.cacheable);
+ this.cacheable = null;
+ map.put(CACHE_REGION_PROPERTY, this.cacheRegion);
+ this.cacheRegion = null;
+ map.put(FETCH_SIZE_PROPERTY, this.fetchSize);
+ this.fetchSize = null;
+ map.put(TIMEOUT_PROPERTY, this.timeout);
+ this.timeout = null;
+ map.put(COMMENT_PROPERTY, this.comment);
+ this.comment = null;
+ map.put(READ_ONLY_PROPERTY, this.readOnly);
+ this.readOnly = null;
+ map.put(CALLABLE_PROPERTY, this.callable);
+ this.callable = null;
+ map.put(RESULT_CLASS_PROPERTY, this.resultClass);
+ this.resultClass = null;
+ map.put(RESULT_SET_MAPPING_PROPERTY, this.resultSetMapping);
+ this.resultSetMapping = null;
}
+ @Override
+ public void restoreFrom(Map<String, Object> map) {
+ super.restoreFrom(map);
+
+ this.setName((String) map.get(NAME_PROPERTY));
+ this.setQuery((String) map.get(QUERY_PROPERTY));
+ this.setFlushMode((FlushModeType) map.get(FLUSH_MODE_PROPERTY));
+ this.setCacheMode((CacheModeType) map.get(CACHE_MODE_PROPERTY));
+ this.setCacheable((Boolean) map.get(CACHEABLE_PROPERTY));
+ this.setCacheRegion((String) map.get(CACHE_REGION_PROPERTY));
+ this.setFetchSize((Integer) map.get(FETCH_SIZE_PROPERTY));
+ this.setTimeout((Integer) map.get(TIMEOUT_PROPERTY));
+ this.setComment((String)map.get(COMMENT_PROPERTY));
+ this.setReadOnly((Boolean) map.get(READ_ONLY_PROPERTY));
+ this.setCallable((Boolean) map.get(CALLABLE_PROPERTY));
+ this.setResultClass((String) map.get(RESULT_CLASS_PROPERTY));
+ this.setResultSetMapping((String) map.get(RESULT_SET_MAPPING_PROPERTY));
+ }
+
/**
* convenience implementation of method from NestableAnnotation interface
* for subclasses
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java 2011-08-23 08:12:13 UTC (rev 34162)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/HibernateSourceNamedQueryAnnotation.java 2011-08-23 08:56:42 UTC (rev 34163)
@@ -11,6 +11,7 @@
package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
import java.util.ListIterator;
+import java.util.Map;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
@@ -31,7 +32,6 @@
import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceAnnotation;
import org.eclipse.jpt.jpa.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.jpa.core.resource.java.NestableAnnotation;
import org.eclipse.jpt.jpa.core.resource.java.NestableQueryHintAnnotation;
import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
import org.jboss.tools.hibernate.jpt.core.internal.context.CacheModeType;
@@ -42,7 +42,6 @@
* @author Dmitry Geraskov
*
*/
-@SuppressWarnings("restriction")
public class HibernateSourceNamedQueryAnnotation extends SourceAnnotation<AnnotatedElement>
implements HibernateNamedQueryAnnotation {
@@ -467,25 +466,49 @@
return this.readOnlyAdapter.getValue(astRoot);
}
// ********** NestableAnnotation implementation **********
+ @Override
+ public void storeOn(Map<String, Object> map) {
+ super.storeOn(map);
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- HibernateSourceNamedQueryAnnotation oldQuery = (HibernateSourceNamedQueryAnnotation) oldAnnotation;
- this.setName(oldQuery.getName());
- this.setQuery(oldQuery.getQuery());
- this.setFlushMode(oldQuery.getFlushMode());
- this.setCacheMode(oldQuery.getCacheMode());
- this.setCacheable(oldQuery.isCacheable());
- this.setComment(oldQuery.getComment());
- this.setFetchSize(oldQuery.getFetchSize());
- this.setTimeout(oldQuery.getTimeout());
- this.setCacheRegion(oldQuery.getCacheRegion());
- this.setReadOnly(oldQuery.isReadOnly());
+ map.put(NAME_PROPERTY, this.name);
+ this.name = null;
+ map.put(QUERY_PROPERTY, this.query);
+ this.query = null;
+
+ map.put(FLUSH_MODE_PROPERTY, this.flushMode);
+ this.flushMode = null;
+ map.put(CACHE_MODE_PROPERTY, this.cacheMode);
+ this.cacheMode = null;
+ map.put(CACHEABLE_PROPERTY, this.cacheable);
+ this.cacheable = null;
+ map.put(CACHE_REGION_PROPERTY, this.cacheRegion);
+ this.cacheRegion = null;
+ map.put(FETCH_SIZE_PROPERTY, this.fetchSize);
+ this.fetchSize = null;
+ map.put(TIMEOUT_PROPERTY, this.timeout);
+ this.timeout = null;
+ map.put(COMMENT_PROPERTY, this.comment);
+ this.comment = null;
+ map.put(READ_ONLY_PROPERTY, this.readOnly);
+ this.readOnly = null;
}
+ @Override
+ public void restoreFrom(Map<String, Object> map) {
+ super.restoreFrom(map);
+
+ this.setName((String) map.get(NAME_PROPERTY));
+ this.setQuery((String) map.get(QUERY_PROPERTY));
+ this.setFlushMode((FlushModeType) map.get(FLUSH_MODE_PROPERTY));
+ this.setCacheMode((CacheModeType) map.get(CACHE_MODE_PROPERTY));
+ this.setCacheable((Boolean) map.get(CACHEABLE_PROPERTY));
+ this.setCacheRegion((String) map.get(CACHE_REGION_PROPERTY));
+ this.setFetchSize((Integer) map.get(FETCH_SIZE_PROPERTY));
+ this.setTimeout((Integer) map.get(TIMEOUT_PROPERTY));
+ this.setComment((String)map.get(COMMENT_PROPERTY));
+ this.setReadOnly((Boolean) map.get(READ_ONLY_PROPERTY));
+ }
+
/**
* convenience implementation of method from NestableAnnotation interface
* for subclasses
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceParameterAnnotation.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceParameterAnnotation.java 2011-08-23 08:12:13 UTC (rev 34162)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/SourceParameterAnnotation.java 2011-08-23 08:56:42 UTC (rev 34163)
@@ -10,6 +10,10 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
@@ -144,17 +148,26 @@
// ********** NestableAnnotation implementation **********
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- ParameterAnnotation oldParameter = (ParameterAnnotation) oldAnnotation;
- this.setName(oldParameter.getName());
- this.setValue(oldParameter.getValue());
- }
-
public void moveAnnotation(int newIndex) {
this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
}
+
+ @Override
+ public void storeOn(Map<String, Object> map) {
+ super.storeOn(map);
+ map.put(NAME_PROPERTY, this.name);
+ this.name = null;
+ map.put(VALUE_PROPERTY, this.value);
+ this.value = null;
+ }
+ @Override
+ public void restoreFrom(Map<String, Object> map) {
+ super.restoreFrom(map);
+ this.setName((String) map.get(NAME_PROPERTY));
+ this.setValue((String) map.get(VALUE_PROPERTY));
+ }
+
// ********** static methods **********
public static SourceParameterAnnotation createParameter(JavaResourceNode parent, AnnotatedElement member, DeclarationAnnotationAdapter annotationAdapter, String elementName, int index) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationImpl.java 2011-08-23 08:12:13 UTC (rev 34162)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/resource/java/TypeDefAnnotationImpl.java 2011-08-23 08:56:42 UTC (rev 34163)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal.resource.java;
+import java.util.HashMap;
+import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Vector;
@@ -121,17 +123,33 @@
@Override
public void storeOn(Map<String, Object> map) {
super.storeOn(map);
+ map.put(NAME_PROPERTY, this.name);
+ this.name = null;
map.put(TYPE_CLASS_PROPERTY, this.typeClass);
this.typeClass = null;
map.put(DEF_FOR_TYPE_PROPERTY, this.defaultForType);
this.defaultForType = null;
+ List<Map<String, Object>> paramStaet = this.buildStateList(this.parameters.size());
+ for (NestableParameterAnnotation param : nestableParameters()) {
+ Map<String, Object> hintState = new HashMap<String, Object>();
+ param.storeOn(hintState);
+ paramStaet.add(hintState);
+ }
+ map.put(PARAMETERS_LIST, paramStaet);
+ this.parameters.clear();
}
@Override
public void restoreFrom(Map<String, Object> map) {
super.restoreFrom(map);
+ this.setName((String) map.get(NAME_PROPERTY));
this.setTypeClass((String) map.get(TYPE_CLASS_PROPERTY));
this.setDefaultForType((String) map.get(DEF_FOR_TYPE_PROPERTY));
+ @SuppressWarnings("unchecked")
+ List<Map<String, Object>> paramsState = (List<Map<String, Object>>) map.get(PARAMETERS_LIST);
+ for (Map<String, Object> paramState : paramsState) {
+ this.addParameter().restoreFrom(paramState);
+ }
}
// ********** TypeDefAnnotation implementation **********
@@ -249,7 +267,10 @@
return (this.defaultForType == null) ? null : ASTTools.resolveFullyQualifiedName(this.defaultForTypeAdapter.getExpression(astRoot));
}
//************************ parameters ***********************
-
+ private NestableParameterAnnotation addParameter() {
+ return this.addParameter(this.parameters.size());
+ }
+
public NestableParameterAnnotation addParameter(int index) {
return (NestableParameterAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.parametersContainer);
}
14 years, 7 months
JBoss Tools SVN: r34162 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-08-23 04:12:13 -0400 (Tue, 23 Aug 2011)
New Revision: 34162
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
Log:
[JBIDE-9513] cleaned up
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-08-23 01:20:32 UTC (rev 34161)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-08-23 08:12:13 UTC (rev 34162)
@@ -46,7 +46,7 @@
public class EGitUtils {
private static final RefSpec DEFAULT_PUSH_REF_SPEC =
- new RefSpec("refs/heads/*:refs/heads/*"); //$NON-NLS-1$
+ new RefSpec("refs/heads/*:refs/remotes/origin/*"); //$NON-NLS-1$
private static final int PUSH_TIMEOUT = 10 * 1024;
@@ -67,7 +67,7 @@
*/
Repository repository = getRepository(project);
if (repository == null) {
- throwCoreException(null, "Could not commit. Project \"{0}\" is not attached to a git repo", project.getName());
+ throw new CoreException(createStatus(null, "Could not commit. Project \"{0}\" is not attached to a git repo", project.getName()));
}
UserConfig userConfig = getUserConfig(repository);
CommitOperation op = new CommitOperation(
@@ -97,14 +97,14 @@
try {
RemoteConfig remoteConfig = getRemoteConfig(repository);
if (remoteConfig == null) {
- throwCoreException(null, "Repository \"{0}\" has no remote repository configured", repository.toString());
+ throw new CoreException(createStatus(null, "Repository \"{0}\" has no remote repository configured", repository.toString()));
}
PushOperation pop = createPushOperation(repository, remoteConfig);
pop.run(monitor);
} catch (CoreException e) {
throw e;
} catch (Exception e) {
- throwCoreException(e, "Could not push repo {0}", repository.toString());
+ throw new CoreException(createStatus(e, "Could not push repo {0}", repository.toString()));
}
}
@@ -144,10 +144,10 @@
spec.addURIRefUpdates(uri,
Transport.open(repository, uri).findRemoteRefUpdatesFor(pushRefSpecs));
} catch (NotSupportedException e) {
- throwCoreException(e, "Could not connect repository \"{0}\" to a remote", repository.toString());
+ throw new CoreException(createStatus(e, "Could not connect repository \"{0}\" to a remote", repository.toString()));
} catch (IOException e) {
- throwCoreException(e, "Could not convert remote specifications for repository \"{0}\" to a remote",
- repository.toString());
+ throw new CoreException(createStatus(e, "Could not convert remote specifications for repository \"{0}\" to a remote",
+ repository.toString()));
}
}
}
@@ -218,8 +218,8 @@
Assert.isLegal(repository != null, "Could not get user configuration. No repository provided.");
if (repository.getConfig() == null) {
- throwCoreException(null, "no user configuration (author, committer) are present in repository \"{0}\"",
- repository.toString());
+ throw new CoreException(createStatus(null, "no user configuration (author, committer) are present in repository \"{0}\"",
+ repository.toString()));
}
return repository.getConfig().get(UserConfig.KEY);
}
@@ -242,21 +242,25 @@
private static RemoteConfig getRemoteConfig(Repository repository) throws CoreException {
Assert.isLegal(repository != null, "Could not get configuration. No repository provided.");
+ String branch = getBranch(repository);
+ String remoteName = getRemoteName(repository, branch);
+ List<RemoteConfig> allRemotes = getAllRemoteConfigs(repository);
+ return getRemoteConfig(remoteName, allRemotes);
+ }
+
+ private static String getBranch(Repository repository) throws CoreException {
String branch = null;
try {
branch = repository.getBranch();
} catch (IOException e) {
- throwCoreException(e, "Could not get branch on repository \"{0}\"", repository.toString());
+ throw new CoreException(createStatus(e, "Could not get branch on repository \"{0}\"", repository.toString()));
}
-
- String remoteName = getRemoteName(repository, branch);
- List<RemoteConfig> allRemotes = getRemoteConfigs(repository);
- return getRemoteConfig(remoteName, allRemotes);
+ return branch;
}
/**
* Gets the remote config with the given name from the list of remote
- * repositories.
+ * repositories. Return the origin if none with the given name was found.
*
* @param remoteName
* the remote name
@@ -286,18 +290,20 @@
* @param repository
* the repository
* @return the remote configs
+ * @throws CoreException
*/
- private static List<RemoteConfig> getRemoteConfigs(Repository repository) {
- List<RemoteConfig> remoteConfigs = new ArrayList<RemoteConfig>();
+ public static List<RemoteConfig> getAllRemoteConfigs(Repository repository) throws CoreException {
try {
- remoteConfigs =
- RemoteConfig.getAllRemoteConfigs(repository.getConfig());
+ return RemoteConfig.getAllRemoteConfigs(repository.getConfig());
} catch (URISyntaxException e) {
- remoteConfigs = new ArrayList<RemoteConfig>();
+ throw new CoreException(createStatus(e, "Could not get all remote repositories for repository \"{0}\"", repository.toString()));
}
- return remoteConfigs;
}
+ public static boolean hasMultipleRemoteConfigs(Repository repository) throws CoreException {
+ return getAllRemoteConfigs(repository).size() > 1;
+ }
+
/**
* Gets the name of the remote repository for a given repository and branch.
*
@@ -319,13 +325,14 @@
return remoteName;
}
- private static void throwCoreException(Exception e, String message, String... arguments) throws CoreException {
+ private static IStatus createStatus(Exception e, String message, String... arguments) throws CoreException {
IStatus status = null;
if (e == null) {
new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID, NLS.bind(message, arguments));
} else {
new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID, NLS.bind(message, arguments), e);
}
- throw new CoreException(status);
+ return status;
}
+
}
14 years, 7 months
JBoss Tools SVN: r34161 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-22 21:20:32 -0400 (Mon, 22 Aug 2011)
New Revision: 34161
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
code cleanup, removed:
1. Commented code
2. Null checks for methods that never return null
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-08-23 01:11:20 UTC (rev 34160)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-08-23 01:20:32 UTC (rev 34161)
@@ -243,15 +243,6 @@
return domWindow.getDocument();
}
-// /**
-// * Function created to restore functionality of MozillaBrowser
-// *
-// * @return
-// */
-// public nsIDOMElement getLastSelectedElement() {
-// return getElementForNode(lastSelectedNode);
-// }
-
public List<nsIDOMNode> getSelectedNodes() {
if(selectedNodes==null){
selectedNodes=Collections.<nsIDOMNode>emptyList();
@@ -273,7 +264,7 @@
nsIDOMElement element = getSelectedElement();
if (element != null) {
repaint();
- scrollToElement(element);
+ scrollToElement(element);
}
redrawSelectionRectangle();
@@ -394,10 +385,9 @@
*
*/
public void showResizer() {
- if (xulRunnerVpeResizer != null && getSelectedElement() != null
- && lastResizerConstrains != 0) {
- xulRunnerVpeResizer.show(getSelectedElement(),
- lastResizerConstrains);
+ nsIDOMElement selectedElement = getSelectedElement();
+ if (xulRunnerVpeResizer != null && selectedElement != null && lastResizerConstrains != 0) {
+ xulRunnerVpeResizer.show(selectedElement, lastResizerConstrains);
}
}
@@ -411,25 +401,6 @@
}
public void redrawSelectionRectangle() {
-// nsIDOMElement element = get SelectedElement();
-// if (element != null) {
-// if (isVisible(element)) {
-// if (element.getAttribute(VPE_INVISIBLE_ELEMENT) == null
-// || (!element.getAttribute(VPE_INVISIBLE_ELEMENT)
-// .equals(Boolean.TRUE.toString()))) {
-// getFlasher().setColor(FLASHER_VISUAL_ELEMENT_COLOR);
-// } else {
-// getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
-// }
-// drawElementOutline(element);
-// } else {
-// getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
-// nsIDOMElement domElement = findVisibleParentElement(element);
-// if (domElement != null) {
-// drawElementOutline(domElement);
-// }
-// }
-// }
List<FlasherData> flasherDatas = new ArrayList<FlasherData>();
for (nsIDOMNode domNode : getSelectedNodes()) {
flasherDatas.add(prepareFlasherData(domNode));
@@ -501,23 +472,6 @@
getFlasher().drawElementOutline(flasherData);
}
- /**
- * Checks if node has select in parent node, if has it's cause crash on OSX
- * and xulrunner 1.8.1.3
- *
- * @param domElement
- * @return
- */
- // private boolean hasSelectInParenNodes(nsIDOMNode domNode){
- // if(domNode==null) {
- // return false;
- // }else if("select".equalsIgnoreCase(domNode.getNodeName())){ //$NON-NLS-1$
- // return true;
- // } else {
- // return hasSelectInParenNodes(domNode.getParentNode());
- // }
- // }
-
@Override
protected void onDispose() {
selectedNodes = new ArrayList<nsIDOMNode>();
@@ -541,8 +495,8 @@
*/
public nsIDOMElement getSelectedElement(){
nsIDOMElement resizeElement = null;
- if(getSelectedNodes()!=null&&getSelectedNodes().size()>0){
- resizeElement =getElementForNode(getSelectedNodes().get(0));
+ if(!getSelectedNodes().isEmpty()){
+ resizeElement = getElementForNode(getSelectedNodes().get(0));
}
return resizeElement;
}
14 years, 7 months
JBoss Tools SVN: r34160 - trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-22 21:11:20 -0400 (Mon, 22 Aug 2011)
New Revision: 34160
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java
Log:
code clean up:
1. Catch blocks removed around the code that does not throw exceptions
2. Double cycle sorting changed to one cycle
3. Localization warning fixed
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java 2011-08-23 01:02:47 UTC (rev 34159)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/info/ChainTextHover.java 2011-08-23 01:11:20 UTC (rev 34160)
@@ -69,19 +69,15 @@
// hoverList.add(new ProblemAnnotationHoverProcessor());
hoverList.add(new MarkerProblemAnnotationHoverProcessor());
-
+ int lastToolsIndex = hoverList.size();
for (int i = 0; i < fTagInfoHovers.length; i++) {
-// if (fTagInfoHovers[i] instanceof FaceletTagInfoHoverProcessor) {
- if (fTagInfoHovers[i].getClass().getName().startsWith("org.jboss.tools.")) {
+ if (fTagInfoHovers[i].getClass().getName().startsWith("org.jboss.tools.")) { //$NON-NLS-1$
+ hoverList.add(lastToolsIndex,fTagInfoHovers[i]);
+ lastToolsIndex++;
+ } else {
hoverList.add(fTagInfoHovers[i]);
}
}
- for (int i = 0; i < fTagInfoHovers.length; i++) {
-// if (!(fTagInfoHovers[i] instanceof FaceletTagInfoHoverProcessor)) {
- if (!(fTagInfoHovers[i].getClass().getName().startsWith("org.jboss.tools."))) {
- hoverList.add(fTagInfoHovers[i]);
- }
- }
hoverList.add(new AnnotationHoverProcessor());
return hoverList;
}
@@ -106,11 +102,7 @@
// already have a best match hover picked out from getHoverRegion call
if (fBestMatchHover != null) {
- try {
displayInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
- } catch (Exception e) {
- XmlEditorPlugin.getPluginLog().logError(InfoHoverMessages.InfoHoover_error_gettingInfo, e);
- }
}
// either had no best match hover or best match hover returned null
if (displayInfo == null) {
@@ -118,17 +110,13 @@
Iterator<ITextHover> i = getTextHovers().iterator();
while ((i.hasNext()) && (displayInfo == null)) {
ITextHover hover = (ITextHover) i.next();
- try {
- if(hover instanceof ITextHoverExtension2) {
- Object displayInfoObject = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
- if(displayInfoObject!=null) {
- displayInfo = displayInfoObject.toString();
- }
- } else {
- displayInfo = hover.getHoverInfo(viewer, hoverRegion);
+ if(hover instanceof ITextHoverExtension2) {
+ Object displayInfoObject = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
+ if(displayInfoObject!=null) {
+ displayInfo = displayInfoObject.toString();
}
- } catch (Exception e) {
- XmlEditorPlugin.getPluginLog().logError(InfoHoverMessages.InfoHoover_error_gettingInfo, e);
+ } else {
+ displayInfo = hover.getHoverInfo(viewer, hoverRegion);
}
}
}
@@ -140,33 +128,25 @@
// already have a best match hover picked out from getHoverRegion call
if (fBestMatchHover != null) {
- try {
- if (fBestMatchHover instanceof ITextHoverExtension2) {
- objectInfo = ((ITextHoverExtension2) fBestMatchHover).getHoverInfo2(viewer, hoverRegion);
- } else {
- objectInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
- }
- } catch (Exception e) {
- XmlEditorPlugin.getPluginLog().logError(InfoHoverMessages.InfoHoover_error_gettingInfo, e);
+ if (fBestMatchHover instanceof ITextHoverExtension2) {
+ objectInfo = ((ITextHoverExtension2) fBestMatchHover).getHoverInfo2(viewer, hoverRegion);
+ } else {
+ objectInfo = fBestMatchHover.getHoverInfo(viewer, hoverRegion);
}
}
- // either had no best match hover or best match hover returned null
if (objectInfo == null) {
// go through the list of text hovers and return first display string
Iterator<ITextHover> i = getTextHovers().iterator();
while ((i.hasNext()) && (objectInfo == null)) {
ITextHover hover = (ITextHover) i.next();
- try {
- if(hover instanceof ITextHoverExtension2) {
- objectInfo = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
- } else {
- objectInfo = hover.getHoverInfo(viewer, hoverRegion);
- }
- } catch (Exception e) {
- XmlEditorPlugin.getPluginLog().logError(InfoHoverMessages.InfoHoover_error_gettingInfo, e);
+ if(hover instanceof ITextHoverExtension2) {
+ objectInfo = ((ITextHoverExtension2)hover).getHoverInfo2(viewer, hoverRegion);
+ } else {
+ objectInfo = hover.getHoverInfo(viewer, hoverRegion);
}
}
}
+ // either had no best match hover or best match hover returned null
return objectInfo;
}
14 years, 7 months
JBoss Tools SVN: r34159 - trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-22 21:02:47 -0400 (Mon, 22 Aug 2011)
New Revision: 34159
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/pom.xml
Log:
fix for smooks tests execution from maven
Modified: trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/pom.xml
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/pom.xml 2011-08-23 00:34:00 UTC (rev 34158)
+++ trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/pom.xml 2011-08-23 01:02:47 UTC (rev 34159)
@@ -26,8 +26,9 @@
<configuration>
<useUIThread>false</useUIThread>
<skip>${swtbot.test.skip}</skip>
- <dependencies>
- <dependency combine.children="append">
+ <product>org.eclipse.platform.ide</product>
+ <dependencies combine.children="append">
+ <dependency>
<type>p2-installable-unit</type>
<artifactId>org.jboss.tools.smooks.feature.feature.group</artifactId>
<version>0.0.0</version>
14 years, 7 months
JBoss Tools SVN: r34158 - trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-22 20:34:00 -0400 (Mon, 22 Aug 2011)
New Revision: 34158
Modified:
trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/pom.xml
Log:
dependencies in pom.xml are fixed for smooks.ui.bot.test
Modified: trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/pom.xml
===================================================================
--- trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/pom.xml 2011-08-23 00:16:48 UTC (rev 34157)
+++ trunk/smooks/tests/org.jboss.tools.smooks.ui.bot.test/pom.xml 2011-08-23 00:34:00 UTC (rev 34158)
@@ -26,18 +26,12 @@
<configuration>
<useUIThread>false</useUIThread>
<skip>${swtbot.test.skip}</skip>
- <product>org.eclipse.sdk.ide</product>
<dependencies>
- <dependency>
+ <dependency combine.children="append">
<type>p2-installable-unit</type>
<artifactId>org.jboss.tools.smooks.feature.feature.group</artifactId>
<version>0.0.0</version>
</dependency>
- <dependency>
- <type>p2-installable-unit</type>
- <artifactId>org.eclipse.sdk.feature.group</artifactId>
- <version>0.0.0</version>
- </dependency>
</dependencies>
</configuration>
</plugin>
14 years, 7 months
JBoss Tools SVN: r34157 - trunk/common/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-22 20:16:48 -0400 (Mon, 22 Aug 2011)
New Revision: 34157
Modified:
trunk/common/tests/pom.xml
Log:
common.validation.test plugin excluded from aggregator pom until compilatio errors are fixed
Modified: trunk/common/tests/pom.xml
===================================================================
--- trunk/common/tests/pom.xml 2011-08-23 00:02:21 UTC (rev 34156)
+++ trunk/common/tests/pom.xml 2011-08-23 00:16:48 UTC (rev 34157)
@@ -15,7 +15,7 @@
<module>org.jboss.tools.common.model.test</module>
<module>org.jboss.tools.common.model.ui.test</module>
<module>org.jboss.tools.common.test</module>
- <module>org.jboss.tools.common.validation.test</module>
+ <!-- module>org.jboss.tools.common.validation.test</module -->
<module>org.jboss.tools.common.verification.test</module>
<module>org.jboss.tools.common.verification.ui.test</module>
</modules>
14 years, 7 months
JBoss Tools SVN: r34156 - trunk/common/plugins.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-08-22 20:02:21 -0400 (Mon, 22 Aug 2011)
New Revision: 34156
Modified:
trunk/common/plugins/pom.xml
Log:
o.j.t.common.validation plugin is added to common/plugins/pom.xml
Modified: trunk/common/plugins/pom.xml
===================================================================
--- trunk/common/plugins/pom.xml 2011-08-23 00:01:11 UTC (rev 34155)
+++ trunk/common/plugins/pom.xml 2011-08-23 00:02:21 UTC (rev 34156)
@@ -27,6 +27,7 @@
<module>org.jboss.tools.common.text.ext</module>
<module>org.jboss.tools.common.text.xml</module>
<module>org.jboss.tools.common.ui</module>
+ <module>org.jboss.tools.common.validation</module>
<module>org.jboss.tools.common.verification</module>
<module>org.jboss.tools.common.verification.ui</module>
<module>org.jboss.tools.common.jdt.debug</module>
14 years, 7 months