JBoss Tools SVN: r36294 - in trunk/seam: tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:32:12 -0500 (Thu, 10 Nov 2011)
New Revision: 36294
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10142 Seam 2 Tools: Extend JBoss Perspective
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2011-11-11 01:18:51 UTC (rev 36293)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2011-11-11 01:32:12 UTC (rev 36294)
@@ -172,6 +172,16 @@
</perspectiveExtension>
</extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.jboss.tools.common.ui.JBossPerspective">
+ <newWizardShortcut
+ id="org.jboss.tools.seam.ui.wizards.SeamProjectWizard">
+ </newWizardShortcut>
+ </perspectiveExtension>
+ </extension>
+
<extension point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding viewerId="org.jboss.tools.seam.ui.views.SeamComponentsNavigator">
<includes>
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java 2011-11-11 01:32:12 UTC (rev 36294)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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.tools.seam.ui.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.WorkbenchException;
+import org.jboss.tools.common.ui.JBossPerspectiveFactory;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JBossPerspectiveTest extends TestCase {
+
+ /**
+ * Tests JBoss perspective has Seam stuff
+ * See https://issues.jboss.org/browse/JBIDE-10142
+ * @throws WorkbenchException
+ */
+ public void testJBossPerspective() throws WorkbenchException {
+ IWorkbenchPage page = WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(JBossPerspectiveFactory.PERSPECTIVE_ID, null);
+ assertNotNull(page);
+ String[] shortcuts = page.getNewWizardShortcuts();
+ Set<String> shortcutSet = new HashSet<String>();
+ for (String shortcut : shortcuts) {
+ shortcutSet.add(shortcut);
+ }
+ assertTrue("Have not found org.jboss.tools.seam.ui.wizards.SeamProjectWizard in " + JBossPerspectiveFactory.PERSPECTIVE_ID, shortcutSet.contains("org.jboss.tools.seam.ui.wizards.SeamProjectWizard"));
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/JBossPerspectiveTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2011-11-11 01:18:51 UTC (rev 36293)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2011-11-11 01:32:12 UTC (rev 36294)
@@ -32,7 +32,6 @@
import org.jboss.tools.seam.ui.test.jbide.JBide3989Test;
import org.jboss.tools.seam.ui.test.marker.SeamMarkerResolutionTest;
import org.jboss.tools.seam.ui.test.preferences.SeamPreferencesPageTest;
-import org.jboss.tools.seam.ui.test.preferences.SeamSettingsPreferencesPageTest;
import org.jboss.tools.seam.ui.test.view.SeamComponentsViewAllTests;
import org.jboss.tools.seam.ui.test.wizard.OpenSeamComponentDialogTest;
import org.jboss.tools.seam.ui.test.wizard.PackageNamesTest;
@@ -54,7 +53,8 @@
public static Test suite() {
TestSuite suite = new TestSuite("Seam UI tests");
-
+
+ suite.addTestSuite(JBossPerspectiveTest.class);
suite.addTestSuite(ELExprPartitionerTest.class);
//suite.addTestSuite(ELReferencesQueryParticipantTest.class);
suite.addTest(new ProjectImportTestSetup(new TestSuite(ELReferencesQueryParticipantTest.class), "org.jboss.tools.seam.ui.test", new String[]{"projects/numberguess"}, new String[]{"numberguess"}));
13 years, 1 month
JBoss Tools SVN: r36293 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:18:51 -0500 (Thu, 10 Nov 2011)
New Revision: 36293
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10145
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 01:15:26 UTC (rev 36292)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 01:18:51 UTC (rev 36293)
@@ -37,10 +37,12 @@
assertNotNull(page);
IViewReference[] viewReferences = page.getViewReferences();
Set<String> viewIds = new HashSet<String>();
+ StringBuffer sb = new StringBuffer("[");
for (IViewReference viewReference : viewReferences) {
- System.out.println("View ID: " + viewReference.getId());
+ sb.append(viewReference.getId()).append(", ");
viewIds.add(viewReference.getId());
}
- assertTrue("Have not found " + PaletteView.ID + " in " + JBossPerspectiveFactory.PERSPECTIVE_ID + ".", viewIds.contains(PaletteView.ID));
+ sb.append("]");
+ assertTrue("Have not found " + PaletteView.ID + " in " + JBossPerspectiveFactory.PERSPECTIVE_ID + ". Found Views: " + sb.toString(), viewIds.contains(PaletteView.ID));
}
}
\ No newline at end of file
13 years, 1 month
JBoss Tools SVN: r36292 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:15:26 -0500 (Thu, 10 Nov 2011)
New Revision: 36292
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
Log:
https://issues.jboss.org/browse/JBIDE-10145
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-11-11 01:13:46 UTC (rev 36291)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-11-11 01:15:26 UTC (rev 36292)
@@ -39,6 +39,7 @@
org.jboss.tools.jst.jsp.base.test,
org.jboss.tools.common.el.ui,
org.eclipse.jdt.ui,
- org.jboss.tools.common.ui
+ org.jboss.tools.common.ui,
+ org.jboss.tools.common.gef
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
13 years, 1 month
JBoss Tools SVN: r36291 - trunk/jsf/plugins/org.jboss.tools.jsf.ui.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 20:13:46 -0500 (Thu, 10 Nov 2011)
New Revision: 36291
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-10140 JBoss Perspective
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2011-11-11 00:58:59 UTC (rev 36290)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2011-11-11 01:13:46 UTC (rev 36291)
@@ -414,8 +414,19 @@
</newWizardShortcut>
</perspectiveExtension>
</extension>
-
- <extension
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.jboss.tools.common.ui.JBossPerspective">
+ <view relative="org.eclipse.ui.views.ContentOutline"
+ relationship="stack"
+ id="org.eclipse.gef.ui.palette_view">
+ </view>
+ </perspectiveExtension>
+ </extension>
+
+ <extension
point="org.eclipse.ltk.core.refactoring.renameParticipants">
<renameParticipant
class="org.jboss.tools.jsf.ui.el.refactoring.RenameMethodParticipant"
13 years, 1 month
JBoss Tools SVN: r36290 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 19:58:59 -0500 (Thu, 10 Nov 2011)
New Revision: 36290
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10145
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 00:20:52 UTC (rev 36289)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 00:58:59 UTC (rev 36290)
@@ -15,7 +15,7 @@
import junit.framework.TestCase;
-import org.eclipse.ui.IViewPart;
+import org.eclipse.gef.ui.views.palette.PaletteView;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.WorkbenchException;
@@ -35,14 +35,12 @@
public void testJBossPerspective() throws WorkbenchException {
IWorkbenchPage page = WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(JBossPerspectiveFactory.PERSPECTIVE_ID, null);
assertNotNull(page);
- IViewPart[] views = page.getViews();
- System.out.println("Views number: " + views.length);
IViewReference[] viewReferences = page.getViewReferences();
Set<String> viewIds = new HashSet<String>();
for (IViewReference viewReference : viewReferences) {
System.out.println("View ID: " + viewReference.getId());
viewIds.add(viewReference.getId());
}
- assertTrue("Have not found org.eclipse.gef.ui.palette_view in org.eclipse.jst.j2ee.J2EEPerspective.", viewIds.contains("org.eclipse.gef.ui.palette_view"));
+ assertTrue("Have not found " + PaletteView.ID + " in " + JBossPerspectiveFactory.PERSPECTIVE_ID + ".", viewIds.contains(PaletteView.ID));
}
}
\ No newline at end of file
13 years, 1 month
JBoss Tools SVN: r36289 - in trunk/jsf/tests/org.jboss.tools.jsf.ui.test: src/org/jboss/tools/jsf/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 19:20:52 -0500 (Thu, 10 Nov 2011)
New Revision: 36289
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-10140 JBoss Perspective
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-11-10 23:57:53 UTC (rev 36288)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-11-11 00:20:52 UTC (rev 36289)
@@ -34,10 +34,11 @@
org.eclipse.gef,
org.eclipse.pde.ui,
org.eclipse.wst.validation,
- org.eclipse.wst.html.core;bundle-version="1.1.500",
- org.eclipse.wst.html.ui;bundle-version="1.0.600",
- org.jboss.tools.jst.jsp.base.test;bundle-version="3.3.0",
- org.jboss.tools.common.el.ui;bundle-version="3.3.0",
- org.eclipse.jdt.ui;bundle-version="3.7.0"
+ org.eclipse.wst.html.core,
+ org.eclipse.wst.html.ui,
+ org.jboss.tools.jst.jsp.base.test,
+ org.jboss.tools.common.el.ui,
+ org.eclipse.jdt.ui,
+ org.jboss.tools.common.ui
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java 2011-11-11 00:20:52 UTC (rev 36289)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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.tools.jsf.ui.test;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.WorkbenchException;
+import org.jboss.tools.common.ui.JBossPerspectiveFactory;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JBossPerspectiveTest extends TestCase {
+
+ /**
+ * Tests JBoss perspective has JSF stuff
+ * See https://issues.jboss.org/browse/JBIDE-10145
+ * @throws WorkbenchException
+ */
+ public void testJBossPerspective() throws WorkbenchException {
+ IWorkbenchPage page = WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow().openPage(JBossPerspectiveFactory.PERSPECTIVE_ID, null);
+ assertNotNull(page);
+ IViewPart[] views = page.getViews();
+ System.out.println("Views number: " + views.length);
+ IViewReference[] viewReferences = page.getViewReferences();
+ Set<String> viewIds = new HashSet<String>();
+ for (IViewReference viewReference : viewReferences) {
+ System.out.println("View ID: " + viewReference.getId());
+ viewIds.add(viewReference.getId());
+ }
+ assertTrue("Have not found org.eclipse.gef.ui.palette_view in org.eclipse.jst.j2ee.J2EEPerspective.", viewIds.contains("org.eclipse.gef.ui.palette_view"));
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JBossPerspectiveTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-11-10 23:57:53 UTC (rev 36288)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-11-11 00:20:52 UTC (rev 36289)
@@ -51,6 +51,7 @@
ValidationFramework.getDefault().suspendAllValidation(true);
+ suite.addTestSuite(JBossPerspectiveTest.class);
suite.addTestSuite(NewJSFProjectTest.class);
suite.addTestSuite(CAForUnclosedELTest.class);
suite.addTestSuite(CAForCompositeComponentTest.class);
13 years, 1 month
JBoss Tools SVN: r36288 - trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-10 18:57:53 -0500 (Thu, 10 Nov 2011)
New Revision: 36288
Modified:
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JBossPerspectiveFactory.java
Log:
https://issues.jboss.org/browse/JBIDE-10140 JBoss Perspective
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JBossPerspectiveFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JBossPerspectiveFactory.java 2011-11-10 22:14:58 UTC (rev 36287)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/JBossPerspectiveFactory.java 2011-11-10 23:57:53 UTC (rev 36288)
@@ -49,7 +49,7 @@
layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
-
+
// views - search
layout.addShowViewShortcut(ID_SEARCH_VIEW);
// views - debugging
13 years, 1 month
JBoss Tools SVN: r36287 - trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-11-10 17:14:58 -0500 (Thu, 10 Nov 2011)
New Revision: 36287
Modified:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
Log:
JBIDE-9910 Proposal info for message bundles in code completion for EL
Fix CA filtering for resource bundle property proposals in Java files
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2011-11-10 21:23:19 UTC (rev 36286)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2011-11-10 22:14:58 UTC (rev 36287)
@@ -96,6 +96,7 @@
private final int fOffset;
private int fNewPosition;
private String fDisplayString;
+ private String fAlternateMatch;
private String fAdditionalProposalInfo;
private IJavaElement[] fJavaElements;
private MessagesELTextProposal fPropertySource;
@@ -107,18 +108,18 @@
}
public Proposal(String string, String prefix, int offset, int newPosition) {
- this(string, prefix, prefix, offset, offset + string.length(), null, null, null, null, null);
+ this(string, prefix, prefix, offset, offset + string.length(), null, null, null, null, null, null);
}
- public Proposal(String string, String prefix, int offset, int newPosition, Image image, String displayString, String additionalProposalInfo, IJavaElement[] javaElements, MessagesELTextProposal propertySource) {
- this(string, prefix, prefix, offset, offset + string.length(), image, displayString, additionalProposalInfo, javaElements, propertySource);
+/**/ public Proposal(String string, String prefix, int offset, int newPosition, Image image, String displayString, String alternateMatch, String additionalProposalInfo, IJavaElement[] javaElements, MessagesELTextProposal propertySource) {
+ this(string, prefix, prefix, offset, offset + string.length(), image, displayString, alternateMatch, additionalProposalInfo, javaElements, propertySource);
}
public Proposal(String string, String prefix, String newPrefix, int offset, int newPosition) {
- this(string, prefix, newPrefix, offset, newPosition, null, null, null, null, null);
+ this(string, prefix, newPrefix, offset, newPosition, null, null, null, null, null, null);
}
- public Proposal(String string, String prefix, String newPrefix, int offset, int newPosition, Image image, String displayString, String additionalProposalInfo, IJavaElement[] javaElements, MessagesELTextProposal propertySource) {
+/**/ public Proposal(String string, String prefix, String newPrefix, int offset, int newPosition, Image image, String displayString, String alternateMatch, String additionalProposalInfo, IJavaElement[] javaElements, MessagesELTextProposal propertySource) {
fString = string;
fPrefix = prefix;
fNewPrefix = newPrefix;
@@ -126,6 +127,7 @@
fNewPosition = newPosition;
fImage = image;
fDisplayString = displayString;
+ fAlternateMatch = alternateMatch;
fAdditionalProposalInfo = additionalProposalInfo;
fJavaElements = javaElements;
if (fJavaElements != null && fJavaElements.length > 0)
@@ -405,7 +407,9 @@
public boolean validate(IDocument document, int offset, DocumentEvent event) {
try {
int prefixStart= fOffset - fPrefix.length();
- return offset >= fOffset && offset < fOffset + fString.length() && document.get(prefixStart, offset - (prefixStart)).equals((fPrefix + fString).substring(0, offset - prefixStart));
+ return offset >= fOffset &&
+ ((offset < fOffset + fString.length() && document.get(prefixStart, offset - (prefixStart)).equals((fPrefix + fString).substring(0, offset - prefixStart))) ||
+ (fAlternateMatch != null && offset < fOffset + fAlternateMatch.length() && document.get(prefixStart, offset - (prefixStart)).equals((fPrefix + fAlternateMatch).substring(0, offset - prefixStart))));
} catch (BadLocationException x) {
return false;
}
@@ -453,6 +457,14 @@
return TextProposal.R_JSP_JSF_EL_VARIABLE_ATTRIBUTE_VALUE+10;
}
+ public String getfAlternateMatch() {
+ return fAlternateMatch;
+ }
+
+ public void setfAlternateMatch(String fAlternateMatch) {
+ this.fAlternateMatch = fAlternateMatch;
+ }
+
}
/**
@@ -612,7 +624,7 @@
string += proposalSufix;
resultList.add(new Proposal(string, prefix, newPrefix, offset, offset - (prefix.length() - newPrefix.length()) + string.length() - proposalSufix.length(), image,
- kbProposal.getLabel(), additionalProposalInfo, javaElements, source));
+ kbProposal.getLabel(), kbProposal.getAlternateMatch(), additionalProposalInfo, javaElements, source));
} else {
if (string.indexOf('\'') != -1 && restOfEL.indexOf('\'') != -1) // Exclude last quote if this char already exists
string = string.substring(0, string.lastIndexOf('\''));
@@ -622,7 +634,7 @@
string += proposalSufix;
resultList.add(new Proposal(string, prefix, offset, offset + string.length() - proposalSufix.length(), image,
- kbProposal.getLabel(), additionalProposalInfo, javaElements, source));
+ kbProposal.getLabel(), kbProposal.getAlternateMatch(), additionalProposalInfo, javaElements, source));
}
}
}
13 years, 1 month
JBoss Tools SVN: r36286 - in trunk: common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-11-10 16:23:19 -0500 (Thu, 10 Nov 2011)
New Revision: 36286
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
JBIDE-9910 Proposal info for message bundles in code completion for EL
Fix CA for resource bundle properties in Java files and Validation Issues over resource bundle properties
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-11-10 21:00:49 UTC (rev 36285)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-11-10 21:23:19 UTC (rev 36286)
@@ -424,21 +424,18 @@
}
}
} else if(expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION) {
-// Set<String> proposalsToFilter = new TreeSet<String>();
-// boolean isMessages = false;
String filter = expr.getMemberName() == null ? "" : expr.getMemberName();
boolean b = filter.startsWith("'") || filter.startsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean e = filter.length() > 1 && filter.endsWith("'") || filter.endsWith("\"");//$NON-NLS-1$ //$NON-NLS-2$
filter = StringUtil.trimQuotes(filter);
for (Variable mbr : members) {
- if (!b && filter.length() > 0) {
+ if ((!b && filter.length() > 0) || (b && e && filter.length() == 0)) {
//Value is set as expression itself, we cannot compute it
resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
return;
}
-// isMessages = true;
-// filterSingularMember(mbr, proposalsToFilter);
Collection<String> keys = mbr.getKeys();
for (String key : keys) {
if(returnEqualedVariablesOnly) {
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2011-11-10 21:00:49 UTC (rev 36285)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ca/ELProposalProcessor.java 2011-11-10 21:23:19 UTC (rev 36286)
@@ -562,8 +562,18 @@
String proposalSufix = ""; //$NON-NLS-1$
String elStartChar = "#"; //$NON-NLS-1$
String documentContent = ref.getELModel().getSource();
- // Is '}'-bracket exists? If not - add the
- if(getELEndPosition(offset - ref.getStartPosition(), documentContent) == -1) {
+ // Is '#{', or '${', or '}'-bracket exists? If not - add the
+ int elEndPosition = documentContent.indexOf("#{", offset - ref.getStartPosition()); //$NON-NLS-1$
+ int limit = documentContent.indexOf("${", offset - ref.getStartPosition()); //$NON-NLS-1$
+ if (limit != -1 && elEndPosition != -1 && limit < elEndPosition) {
+ elEndPosition = limit;
+ }
+ limit = documentContent.indexOf('}', offset - ref.getStartPosition());
+ if (limit != -1 && elEndPosition != -1 && limit < elEndPosition) {
+ elEndPosition = limit+1;
+ }
+ String restOfEL = elEndPosition == -1 ? "" : documentContent.substring(offset - ref.getStartPosition(), elEndPosition); //$NON-NLS-1$
+ if(restOfEL.indexOf('}') == -1) {
proposalSufix = "}"; //$NON-NLS-1$
}
@@ -578,7 +588,7 @@
Image image = kbProposal.hasImage() ? kbProposal.getImage()
: getImage();
if (string.length() >= 0) {
- string = proposalPrefix + string + proposalSufix;
+ string = proposalPrefix + string;
if (string.length() > 0 && ('#' == string.charAt(0) || '$' == string.charAt(0)))
string = elStartChar + string.substring(1);
@@ -592,11 +602,25 @@
source = (MessagesELTextProposal)kbProposal;
}
- if (string.startsWith("['") && string.endsWith("']") && prefix != null && prefix.endsWith(".")) { //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- String newPrefix = prefix.substring(0, prefix.length() - 1);
- resultList.add(new Proposal(string, prefix, newPrefix, offset, offset - 1 + string.length() - proposalSufix.length(), image,
+ if (string.startsWith("[") && prefix != null && prefix.indexOf('.') != -1) { //$NON-NLS-1$
+ String newPrefix = prefix.substring(0, prefix.lastIndexOf('.'));
+ if (string.indexOf('\'') != -1 && restOfEL.indexOf('\'') != -1) // Exclude last quote if this char already exists
+ string = string.substring(0, string.lastIndexOf('\''));
+
+ if (string.indexOf(']') == -1 && restOfEL.indexOf(']') == -1) // Add closing square bracket if needed
+ string += ']';
+
+ string += proposalSufix;
+ resultList.add(new Proposal(string, prefix, newPrefix, offset, offset - (prefix.length() - newPrefix.length()) + string.length() - proposalSufix.length(), image,
kbProposal.getLabel(), additionalProposalInfo, javaElements, source));
} else {
+ if (string.indexOf('\'') != -1 && restOfEL.indexOf('\'') != -1) // Exclude last quote if this char already exists
+ string = string.substring(0, string.lastIndexOf('\''));
+
+ if (string.indexOf(']') == -1 && restOfEL.indexOf(']') == -1) // Add closing square bracket if needed
+ string += ']';
+
+ string += proposalSufix;
resultList.add(new Proposal(string, prefix, offset, offset + string.length() - proposalSufix.length(), image,
kbProposal.getLabel(), additionalProposalInfo, javaElements, source));
}
@@ -622,13 +646,49 @@
}
/*
+ * @return non-paired quote char if exists, otherwise 0
+ */
+ private char getPreceedingQuoteChar(int initialOffset, String restOfCurrentValue) {
+ int offset = initialOffset;
+
+ char inQuotesChar = 0;
+ while (--offset >= 0) {
+ if ('"' == restOfCurrentValue.charAt(offset) ||
+ '\'' == restOfCurrentValue.charAt(offset) &&
+ (inQuotesChar == 0 || inQuotesChar == restOfCurrentValue.charAt(offset))) {
+ if (initialOffset + offset > 0 && restOfCurrentValue.charAt(offset - 1) == '\\') {
+ int backslashCount = 1;
+ while ((offset - backslashCount) >= 0 &&
+ restOfCurrentValue.charAt(offset - backslashCount) == '\\') {
+ backslashCount++;
+ }
+
+ if (backslashCount % 2 == 1) {
+ inQuotesChar = inQuotesChar == 0 ? restOfCurrentValue.charAt(offset) : 0;
+ offset -= backslashCount;
+ }
+ } else {
+ inQuotesChar = inQuotesChar == 0 ? restOfCurrentValue.charAt(offset) : 0;
+ }
+ } else if ('{' == restOfCurrentValue.charAt(offset)) {
+ if (offset > 0 &&
+ ('#' == restOfCurrentValue.charAt(offset -1) ||
+ '$' == restOfCurrentValue.charAt(offset -1))) {
+ return inQuotesChar;
+ }
+ }
+ }
+ return inQuotesChar;
+ }
+
+ /*
* Checks if the EL operand ending character is present
* @return
*/
private int getELEndPosition(int initialOffset, String restOfCurrentValue) {
int offset = -1;
- char inQuotesChar = 0;
+ char inQuotesChar = getPreceedingQuoteChar(initialOffset, restOfCurrentValue);
while (++offset < restOfCurrentValue.length() - initialOffset) {
if (inQuotesChar == 0) {
if ('}' == restOfCurrentValue.charAt(initialOffset + offset))
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-11-10 21:00:49 UTC (rev 36285)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-11-10 21:23:19 UTC (rev 36286)
@@ -454,10 +454,11 @@
} else if(expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION) {
String filter = expr.getMemberName() == null ? "" : expr.getMemberName();
boolean b = filter.startsWith("'") || filter.startsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean e = filter.length() > 1 && filter.endsWith("'") || filter.endsWith("\"");//$NON-NLS-1$ //$NON-NLS-2$
filter = StringUtil.trimQuotes(filter);
-
+
for (Variable mbr : members) {
- if (!b && filter.length() > 0) {
+ if ((!b && filter.length() > 0) || (b && e && filter.length() == 0)) {
//Value is set as expression itself, we cannot compute it
resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-11-10 21:00:49 UTC (rev 36285)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-11-10 21:23:19 UTC (rev 36286)
@@ -273,10 +273,11 @@
} else if(expr.getType() == ELObjectType.EL_ARGUMENT_INVOCATION) {
String filter = expr.getMemberName() == null ? "" : expr.getMemberName();
boolean b = filter.startsWith("'") || filter.startsWith("\""); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean e = filter.length() > 1 && filter.endsWith("'") || filter.endsWith("\"");//$NON-NLS-1$ //$NON-NLS-2$
filter = StringUtil.trimQuotes(filter);
for (TypeInfoCollector.MemberInfo mbr : members) {
- if (!b && filter.length() > 0) {
+ if ((!b && filter.length() > 0) || (b && e && filter.length() == 0)) {
//Value is set as expression itself, we cannot compute it
resolution.setMapOrCollectionOrBundleAmoungTheTokens(true);
return true;
@@ -302,7 +303,9 @@
replacement = '\'' + key + '\'';
label = "['" + key + "']";
}
- replacement = replacement.substring(existingString.length());
+ replacement = replacement.startsWith(existingString) ?
+ replacement.substring(existingString.length()) :
+ replacement;
kbProposal.setReplacementString(replacement);
kbProposal.setLabel(label);
13 years, 1 month
JBoss Tools SVN: r36285 - in trunk/cdi/tests: org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1 and 13 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-11-10 16:00:49 -0500 (Thu, 10 Nov 2011)
New Revision: 36285
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Base1.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/BaseDecoratedInterface.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Bean1.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Base2.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Bean2.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/TestBean.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Base3.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Bean3.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Base4.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Bean4.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Base5.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Bean5.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsTestSetup.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
Log:
CDI Searcher doesn't look for beans in dependent projects https://issues.jboss.org/browse/JBIDE-9801
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Base1.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Base1.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Base1.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,13 @@
+package cdi.test.search1;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+
+public class Base1 implements BaseDecoratedInterface{
+
+ public Base1() {
+ }
+
+ @Inject
+ Event<Base1> event1;
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Base1.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/BaseDecoratedInterface.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/BaseDecoratedInterface.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/BaseDecoratedInterface.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,5 @@
+package cdi.test.search1;
+
+public interface BaseDecoratedInterface {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/BaseDecoratedInterface.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Bean1.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Bean1.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Bean1.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,19 @@
+package cdi.test.search1;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+public class Bean1 {
+ @Inject
+ @Any
+ private BaseDecoratedInterface field1;
+
+ public void method1(@Observes BaseDecoratedInterface event) {
+
+ }
+
+ @Inject public void method_1(BaseDecoratedInterface param1){
+
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest1/src/cdi/test/search1/Bean1.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Base2.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Base2.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Base2.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,11 @@
+package cdi.test.search2;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+
+import cdi.test.search1.Base1;
+
+public class Base2 extends Base1 {
+ @Inject
+ Event<Base1> event2;
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Base2.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Bean2.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Bean2.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Bean2.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,23 @@
+package cdi.test.search2;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+import cdi.test.search1.BaseDecoratedInterface;
+
+
+public class Bean2 {
+ @Inject
+ @Any
+ private BaseDecoratedInterface field2;
+
+ public void method2(@Observes BaseDecoratedInterface event) {
+
+ }
+
+ @Inject public void method_2(BaseDecoratedInterface param2){
+
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/Bean2.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/TestBean.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/TestBean.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/TestBean.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,5 @@
+package cdi.test.search2;
+
+public class TestBean {
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest2/src/cdi/test/search2/TestBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Base3.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Base3.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Base3.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,12 @@
+package cdi.test.search3;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+
+import cdi.test.search1.Base1;
+import cdi.test.search2.Base2;
+
+public class Base3 extends Base2 {
+ @Inject
+ Event<Base1> event3;
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Base3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Bean3.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Bean3.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Bean3.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,22 @@
+package cdi.test.search3;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+import cdi.test.search1.BaseDecoratedInterface;
+
+
+public class Bean3 {
+ @Inject
+ @Any
+ private BaseDecoratedInterface field3;
+
+ public void method3(@Observes BaseDecoratedInterface event) {
+
+ }
+
+ @Inject public void method_3(BaseDecoratedInterface param3){
+
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest3/src/cdi/test/search3/Bean3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Base4.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Base4.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Base4.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,12 @@
+package cdi.test.search4;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+
+import cdi.test.search1.Base1;
+import cdi.test.search2.Base2;
+
+public class Base4 extends Base2 {
+ @Inject
+ Event<Base1> event4;
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Base4.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Bean4.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Bean4.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Bean4.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,22 @@
+package cdi.test.search4;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+import cdi.test.search1.BaseDecoratedInterface;
+
+public class Bean4 {
+ @Inject
+ @Any
+ private BaseDecoratedInterface field4;
+
+ public void method4(@Observes BaseDecoratedInterface event) {
+
+ }
+
+ @Inject public void method_4(BaseDecoratedInterface param4){
+
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest4/src/cdi/test/search4/Bean4.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Base5.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Base5.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Base5.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,14 @@
+package cdi.test.search5;
+
+import javax.enterprise.event.Event;
+import javax.inject.Inject;
+
+import cdi.test.search1.Base1;
+import cdi.test.search4.Base4;
+import javax.inject.Named;
+
+@Named("abcd")
+public class Base5 extends Base4 {
+ @Inject
+ Event<Base1> event5;
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Base5.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Bean5.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Bean5.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Bean5.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,22 @@
+package cdi.test.search5;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+import cdi.test.search1.BaseDecoratedInterface;
+import javax.inject.Named;
+
+public class Bean5 {
+ @Inject
+ @Any
+ private BaseDecoratedInterface field5;
+
+ public void method5(@Observes BaseDecoratedInterface event) {
+
+ }
+
+ @Inject public void method_5(BaseDecoratedInterface param5){
+
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/CDITest5/src/cdi/test/search5/Bean5.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-11-10 20:47:37 UTC (rev 36284)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CDIUIAllTests.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -22,6 +22,8 @@
import org.jboss.tools.cdi.ui.test.preferences.CDIPreferencePageTest;
import org.jboss.tools.cdi.ui.test.search.CDISearchParticipantTest;
import org.jboss.tools.cdi.ui.test.search.ELReferencesQueryParticipantTest;
+import org.jboss.tools.cdi.ui.test.search.FiveDependentProjectsSearchParticipantTest;
+import org.jboss.tools.cdi.ui.test.search.FiveDependentProjectsTestSetup;
import org.jboss.tools.cdi.ui.test.wizard.AddQualifiersToBeanWizardTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIClassWizardFactoryTest;
import org.jboss.tools.cdi.ui.test.wizard.NewCDIWebProjectWizardTest;
@@ -65,6 +67,11 @@
suiteAll.addTestSuite(AddQualifiersToBeanWizardTest.class);
suiteAll.addTestSuite(CDIRefactoringTest.class);
+
+ TestSuite dependentSuite = new TestSuite("Dependent Projects Tests");
+ dependentSuite.addTestSuite(FiveDependentProjectsSearchParticipantTest.class);
+ FiveDependentProjectsTestSetup dependent = new FiveDependentProjectsTestSetup(dependentSuite);
+ suiteAll.addTest(dependent);
return suiteAll;
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,272 @@
+package org.jboss.tools.cdi.ui.test.search;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory;
+import org.eclipse.jdt.ui.search.ElementQuerySpecification;
+import org.eclipse.jdt.ui.search.IQueryParticipant;
+import org.eclipse.jdt.ui.search.ISearchRequestor;
+import org.eclipse.jdt.ui.search.QuerySpecification;
+import org.eclipse.search.ui.text.Match;
+import org.jboss.tools.cdi.core.CDIUtil;
+import org.jboss.tools.cdi.core.ICDIElement;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.cdi.internal.core.impl.ClassBean;
+import org.jboss.tools.cdi.internal.core.impl.EventBean;
+import org.jboss.tools.cdi.internal.core.impl.InjectionPointField;
+import org.jboss.tools.cdi.internal.core.impl.InjectionPointParameter;
+import org.jboss.tools.cdi.internal.core.impl.ObserverMethod;
+import org.jboss.tools.cdi.ui.search.CDIBeanQueryParticipant;
+import org.jboss.tools.cdi.ui.search.CDIMatch;
+import org.jboss.tools.cdi.ui.search.InjectionPointQueryParticipant;
+import org.jboss.tools.common.EclipseUtil;
+
+public class FiveDependentProjectsSearchParticipantTest extends TestCase {
+ IProject project1 = null;
+ IProject project2 = null;
+ IProject project3 = null;
+ IProject project4 = null;
+ IProject project5 = null;
+
+ @Override
+ protected void setUp() throws Exception {
+ project1 = ResourcesPlugin.getWorkspace().getRoot().getProject("CDITest1");
+ project2 = ResourcesPlugin.getWorkspace().getRoot().getProject("CDITest2");
+ project3 = ResourcesPlugin.getWorkspace().getRoot().getProject("CDITest3");
+ project4 = ResourcesPlugin.getWorkspace().getRoot().getProject("CDITest4");
+ project5 = ResourcesPlugin.getWorkspace().getRoot().getProject("CDITest5");
+ }
+ private static final int FIELD_SEARCH = 1;
+ private static final int METHOD_SEARCH = 2;
+ private static final int TYPE_SEARCH = 3;
+ private static final int PARAMETER_SEARCH = 4;
+
+ private void testSearchParticipant(IProject project, String fileName, int searchType, String elementName, String parameterName, IQueryParticipant participant, List<MatchStructure> matches){
+ IFile file = project.getFile(fileName);
+ assertNotNull("File - "+fileName+" not found", file);
+ try{
+ ICompilationUnit compilationUnit = EclipseUtil.getCompilationUnit(file);
+ IJavaElement element = null;
+
+ IType type = compilationUnit.findPrimaryType();
+
+ if(searchType == FIELD_SEARCH){
+ element = type.getField(elementName);
+ }else if(searchType == METHOD_SEARCH){
+ element = getMethod(type, elementName);
+ }else if(searchType == TYPE_SEARCH){
+ element = type;
+ }else if(searchType == PARAMETER_SEARCH){
+ IMethod method = getMethod(type, elementName);
+ element = CDIUtil.getParameter(method, parameterName);
+ }
+
+ if(element != null){
+ CDISearchRequestor requestor = new CDISearchRequestor();
+
+ JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
+ IJavaSearchScope scope= factory.createWorkspaceScope(true);
+ String description= factory.getWorkspaceScopeDescription(true);
+ QuerySpecification specification = new ElementQuerySpecification(element, IJavaSearchConstants.REFERENCES, scope, description);
+
+ participant.search(requestor, specification, new NullProgressMonitor());
+
+ List<Match> matchesForCheck = requestor.getMatches();
+
+ checkMatches(matchesForCheck, matches);
+ }else
+ fail("Java Element not found");
+ }catch(CoreException ex){
+ fail("Core exception");
+ }
+ }
+
+ private IMethod getMethod(IType type, String name) throws JavaModelException{
+ IMethod[] methods = type.getMethods();
+ for(IMethod method : methods){
+ if(method.getElementName().equals(name))
+ return method;
+ }
+ return null;
+ }
+
+ private void checkMatches(List<Match> matchesForCheck, List<MatchStructure> matchList) throws CoreException {
+// for(Match match : matchesForCheck){
+// System.out.println(("Match found (class - "+((CDIMatch)match).getCDIElement().getClass()+" name - "+((CDIMatch)match).getLabel()+")"));
+// }
+
+ for(Match match : matchesForCheck){
+ assertTrue("Match must be CDIMatch", match instanceof CDIMatch);
+ MatchStructure ms = findMatch(matchList, (CDIMatch)match);
+ assertNotNull("Unexpected match found (class - "+((CDIMatch)match).getCDIElement().getClass()+" name - "+((CDIMatch)match).getLabel()+")", ms);
+ ms.checked = true;
+ }
+
+ for(MatchStructure ms : matchList){
+ assertTrue("Match not found (class - "+ms.type+" name - "+ms.name, ms.checked);
+ }
+ }
+
+ protected MatchStructure findMatch(List<MatchStructure> matchList, CDIMatch match){
+ for(MatchStructure ms : matchList){
+ if(!ms.checked && ms.type.equals(match.getCDIElement().getClass()) && ms.name.equals(match.getLabel()))
+ return ms;
+ }
+ return null;
+ }
+
+
+ class CDISearchRequestor implements ISearchRequestor{
+ ArrayList<Match> matches = new ArrayList<Match>();
+
+ public void reportMatch(Match match){
+ matches.add(match);
+ }
+
+ public List<Match> getMatches(){
+ return matches;
+ }
+ }
+
+ class MatchStructure{
+ Class<? extends ICDIElement> type;
+ String name; // label
+ boolean checked;
+
+ public MatchStructure(Class<? extends ICDIElement> type, String name){
+ this.type = type;
+ this.name = name;
+ checked = false;
+ }
+ }
+
+ public void testInjectionPointQueryParticipantInProject1(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(ClassBean.class, "Base1"));
+
+ testSearchParticipant(project1, "src/cdi/test/search1/Bean1.java", FIELD_SEARCH, "field1", "", new InjectionPointQueryParticipant(), matches);
+ }
+
+ public void testInjectionPointQueryParticipantInProject2(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(ClassBean.class, "Base1"));
+ matches.add(new MatchStructure(ClassBean.class, "Base2"));
+
+ testSearchParticipant(project2, "src/cdi/test/search2/Bean2.java", FIELD_SEARCH, "field2", "", new InjectionPointQueryParticipant(), matches);
+ }
+
+ public void testInjectionPointQueryParticipantInProject3(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(ClassBean.class, "Base1"));
+ matches.add(new MatchStructure(ClassBean.class, "Base2"));
+ matches.add(new MatchStructure(ClassBean.class, "Base3"));
+
+ testSearchParticipant(project3, "src/cdi/test/search3/Bean3.java", FIELD_SEARCH, "field3", "", new InjectionPointQueryParticipant(), matches);
+ }
+
+ public void testInjectionPointQueryParticipantInProject4(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(ClassBean.class, "Base1"));
+ matches.add(new MatchStructure(ClassBean.class, "Base2"));
+ matches.add(new MatchStructure(ClassBean.class, "Base4"));
+
+ testSearchParticipant(project4, "src/cdi/test/search4/Bean4.java", FIELD_SEARCH, "field4", "", new InjectionPointQueryParticipant(), matches);
+ }
+
+ public void testInjectionPointQueryParticipantInProject5(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(ClassBean.class, "Base1"));
+ matches.add(new MatchStructure(ClassBean.class, "Base2"));
+ matches.add(new MatchStructure(ClassBean.class, "Base4"));
+ matches.add(new MatchStructure(ClassBean.class, "Base5"));
+
+ testSearchParticipant(project5, "src/cdi/test/search5/Bean5.java", FIELD_SEARCH, "field5", "", new InjectionPointQueryParticipant(), matches);
+ }
+
+ public void testCDIBeanQueryParticipantInProject1(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean1.field1"));
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean2.field2"));
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean3.field3"));
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean4.field4"));
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean5.field5"));
+
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean1.method_1(BaseDecoratedInterface param1)"));
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean2.method_2(BaseDecoratedInterface param2)"));
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean3.method_3(BaseDecoratedInterface param3)"));
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean4.method_4(BaseDecoratedInterface param4)"));
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean5.method_5(BaseDecoratedInterface param5)"));
+
+ testSearchParticipant(project1, "src/cdi/test/search1/Base1.java", TYPE_SEARCH, "Base1", "", new CDIBeanQueryParticipant(), matches);
+ }
+
+ public void testCDIBeanQueryParticipantInProject2(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean2.field2"));
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean3.field3"));
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean4.field4"));
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean5.field5"));
+
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean2.method_2(BaseDecoratedInterface param2)"));
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean3.method_3(BaseDecoratedInterface param3)"));
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean4.method_4(BaseDecoratedInterface param4)"));
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean5.method_5(BaseDecoratedInterface param5)"));
+
+ testSearchParticipant(project2, "src/cdi/test/search2/Base2.java", TYPE_SEARCH, "Base2", "", new CDIBeanQueryParticipant(), matches);
+ }
+
+ public void testCDIBeanQueryParticipantInProject3(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean3.field3"));
+
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean3.method_3(BaseDecoratedInterface param3)"));
+
+ testSearchParticipant(project3, "src/cdi/test/search3/Base3.java", TYPE_SEARCH, "Base3", "", new CDIBeanQueryParticipant(), matches);
+ }
+
+ public void testCDIBeanQueryParticipantInProject4(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean4.field4"));
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean5.field5"));
+
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean4.method_4(BaseDecoratedInterface param4)"));
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean5.method_5(BaseDecoratedInterface param5)"));
+
+ testSearchParticipant(project4, "src/cdi/test/search4/Base4.java", TYPE_SEARCH, "Base4", "", new CDIBeanQueryParticipant(), matches);
+ }
+
+ public void testCDIBeanQueryParticipantInProject5(){
+ ArrayList<MatchStructure> matches = new ArrayList<MatchStructure>();
+
+ matches.add(new MatchStructure(InjectionPointField.class, "Bean5.field5"));
+
+ matches.add(new MatchStructure(InjectionPointParameter.class, "Bean5.method_5(BaseDecoratedInterface param5)"));
+
+ testSearchParticipant(project5, "src/cdi/test/search5/Base5.java", TYPE_SEARCH, "Base5", "", new CDIBeanQueryParticipant(), matches);
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsTestSetup.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsTestSetup.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsTestSetup.java 2011-11-10 21:00:49 UTC (rev 36285)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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.tools.cdi.ui.test.search;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class FiveDependentProjectsTestSetup extends TestSetup {
+ protected static String PLUGIN_ID = "org.jboss.tools.cdi.core.test";
+ IProject project1 = null;
+ IProject project2 = null;
+ IProject project3 = null;
+ IProject project4 = null;
+ IProject project5 = null;
+
+ public FiveDependentProjectsTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ project1 = getTestProject("/projects/CDITest1", "CDITest1");
+ project2 = getTestProject("/projects/CDITest2", "CDITest2");
+ project3 = getTestProject("/projects/CDITest3", "CDITest3");
+ project4 = getTestProject("/projects/CDITest4", "CDITest4");
+ project5 = getTestProject("/projects/CDITest5", "CDITest5");
+ }
+
+ private static IProject getTestProject(String projectPath, String projectName) throws IOException, CoreException, InvocationTargetException, InterruptedException {
+ IProject project = ResourcesUtils.importProject(PLUGIN_ID, projectPath);
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+ return project;
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ project1.delete(true, true, null);
+ project2.delete(true, true, null);
+ project3.delete(true, true, null);
+ project4.delete(true, true, null);
+ project5.delete(true, true, null);
+ JobUtils.waitForIdle();
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsTestSetup.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 1 month