JBoss Tools SVN: r5978 - in trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test: ca and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-01-25 13:48:33 -0500 (Fri, 25 Jan 2008)
New Revision: 5978
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1645 Seam EL Content Assist suggests wrong proposals if we have an uncompleted EL in text.
JUnit TestCase is added for the issue
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 2008-01-25 18:44:56 UTC (rev 5977)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2008-01-25 18:48:33 UTC (rev 5978)
@@ -15,6 +15,7 @@
import junit.framework.TestSuite;
import org.jboss.tools.seam.ui.test.preferences.SeamPreferencesPageTest;
+import org.jboss.tools.seam.ui.test.ca.SeamELContentAssistJbide1645Test;
import org.jboss.tools.seam.ui.test.ca.SeamELContentAssistJbide1676Test;
import org.jboss.tools.seam.ui.test.ca.SeamELContentAssistTest;
import org.jboss.tools.seam.ui.test.hyperlink.SeamViewHyperlinkPartitionerTest;
@@ -39,6 +40,7 @@
suite.addTestSuite(SeamViewHyperlinkPartitionerTest.class);
suite.addTestSuite(SeamELContentAssistTest.class);
suite.addTestSuite(SeamELContentAssistJbide1676Test.class);
+ suite.addTestSuite(SeamELContentAssistJbide1645Test.class);
return suite;
}
}
Added: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2008-01-25 18:48:33 UTC (rev 5978)
@@ -0,0 +1,168 @@
+package org.jboss.tools.seam.ui.test.ca;
+
+import javax.crypto.SealedObject;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jst.jsp.contentassist.RedHatCustomCompletionProposal;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class SeamELContentAssistJbide1645Test extends TestCase {
+ TestProjectProvider provider = null;
+ IProject project = null;
+ boolean makeCopy = false;
+ private static final String PROJECT_NAME = "TestSeamELContentAssist";
+ private static final String PAGE_NAME = "/WebContent/home.xhtml";
+ private static final String PREFIX_STRING = "<h:commandButton action=\"#{actor\" value=\"\">";
+ private static final String POSTFIX_STRING = " </h:commandButton>";
+ private static final String INSERT_BEFORE_STRING = "<rich:panel";
+ private static final String INSERTION_STRING = PREFIX_STRING + POSTFIX_STRING;
+
+ public static Test suite() {
+ return new TestSuite(SeamELContentAssistJbide1645Test.class);
+ }
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.seam.ui.test", null, PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ Throwable exception = null;
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (Exception x) {
+ exception = x;
+ x.printStackTrace();
+ }
+ assertNull("An exception caught: " + (exception != null? exception.getMessage() : ""), exception);
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ public void testSeamELContentAssistJbide1645() {
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+
+ IFile jspFile = project.getFile(PAGE_NAME);
+
+ assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
+ assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
+
+ FileEditorInput editorInput = new FileEditorInput(jspFile);
+ Throwable exception = null;
+ IEditorPart editorPart = null;
+ try {
+ editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
+ } catch (PartInitException ex) {
+ exception = ex;
+ ex.printStackTrace();
+ assertTrue("The JSP Visual Editor couldn't be initialized.", false);
+ }
+
+ JSPMultiPageEditor jspEditor = null;
+
+ if (editorPart instanceof JSPMultiPageEditor)
+ jspEditor = (JSPMultiPageEditor)editorPart;
+
+ // Delay for 3 seconds so that
+ // the Favorites view can be seen.
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+ TestUtil.delay(3000);
+
+ JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
+ StructuredTextViewer viewer = jspTextEditor.getTextViewer();
+ IDocument document = viewer.getDocument();
+ SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
+ IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
+
+ assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
+
+ // Find start of <rich:panel> tag
+ String documentContent = document.get();
+ int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
+ int offsetToTest = start + PREFIX_STRING.length();
+
+ assertTrue("Cannot find the starting point in the test file \"" + PAGE_NAME + "\"", (start != -1));
+
+ String documentContentModified = documentContent.substring(0, start) +
+ INSERTION_STRING + documentContent.substring(start);
+
+ jspTextEditor.setText(documentContentModified);
+
+ ICompletionProposal[] result= null;
+ String errorMessage = null;
+
+ IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
+ if (p != null) {
+ try {
+ result= p.computeCompletionProposals(viewer, offsetToTest);
+ } catch (Throwable x) {
+ x.printStackTrace();
+ }
+ errorMessage= p.getErrorMessage();
+ }
+
+// if (errorMessage != null && errorMessage.trim().length() > 0) {
+// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
+// }
+
+ assertTrue("Content Assistant peturned no proposals", (result != null && result.length > 0));
+
+ for (int i = 0; i < result.length; i++) {
+ // There should not be a proposal of type SeamELProposalProcessor.Proposal in the result
+ assertFalse("Content Assistant peturned proposals of type (" + result[i].getClass().getName() + ").", (result[i] instanceof SeamELProposalProcessor.Proposal));
+// if (!(result[i] instanceof RedHatCustomCompletionProposal))
+// continue;
+// RedHatCustomCompletionProposal proposal = (RedHatCustomCompletionProposal)result[i];
+// String proposalString = proposal.getReplacementString();
+// int proposalReplacementOffset = proposal.getReplacementOffset();
+// int proposalReplacementLength = proposal.getReplacementLength();
+// try {
+// System.out.println("Result#" + i + " ==> Offs: " + offsetToTest + " RedHatCustomCompletionProposal[" + proposalString + "], Offs: " + proposalReplacementOffset + ", Len: " + proposalReplacementLength + ", Doc: [" + document.get(proposalReplacementOffset, proposalReplacementLength));
+// } catch (BadLocationException e) {
+// }
+ }
+
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .closeEditor(editorPart, false);
+ }
+}
Property changes on: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 12 months
JBoss Tools SVN: r5977 - trunk/vpe/plugins/org.jboss.tools.vpe/templates.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-01-25 13:44:56 -0500 (Fri, 25 Jan 2008)
New Revision: 5977
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1576
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml 2008-01-25 18:31:17 UTC (rev 5976)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-jsf.xml 2008-01-25 18:44:56 UTC (rev 5977)
@@ -22,7 +22,7 @@
<vpe:tag name="h:inputText" case-sensitive="yes">
<vpe:template children="no" modify="no">
- <input type="text" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}" size="{@size}"/>
+ <input type="text" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}" size="{@size}" />
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
@@ -66,7 +66,6 @@
</vpe:tag>
<vpe:tag name="h:inputTextarea" case-sensitive="yes">
- <vpe:if test="attrpresent('__vpe__fake__')"/>
<vpe:template children="yes" modify="no">
<textarea class="{@styleClass}" style="{@style}" rows="{@rows}" cols="{@cols}" title="{tagstring()}">
<vpe:value expr="{jsfvalue(@value)}"/>
@@ -106,7 +105,7 @@
<vpe:tag name="h:inputSecret" case-sensitive="yes">
<vpe:template children="no" modify="no">
- <input type="password" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
+ <input type="password" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}" size="{@size}" />
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
@@ -151,7 +150,7 @@
<vpe:tag name="h:inputHidden" case-sensitive="yes">
<vpe:template children="no" modify="no">
- <input type="text" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}border-style:dotted;display:none;" title="{tagstring()}"/>
+ <input type="text" value="{jsfvalue(@value)}" title="{tagstring()}"/>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
<vpe:drop container="yes">
@@ -187,8 +186,6 @@
</vpe:drop>
</vpe:dnd>
<vpe:textFormating>
- <vpe:format type="BlockFormat"
- handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler" />
<vpe:format type="UnderlineFormat">
<vpe:formatAttribute type="style"/>
</vpe:format>
@@ -300,15 +297,13 @@
<!-- Проблема с подстановкой значений вложенных параметров (26 of 4) -->
<vpe:tag name="h:outputFormat" case-sensitive="yes">
<vpe:template children="no" modify="yes">
- <span title="{tagstring()}" style="{@style}">
+ <span title="{tagstring()}" style="{@style}" class="{@styleClass}" >
<vpe:value expr="{jsfvalue(@value)}"/>
</span>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
</vpe:dnd>
<vpe:textFormating>
- <vpe:format type="BlockFormat" addChildren="deny"
- handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler" />
<vpe:format type="UnderlineFormat">
<vpe:formatAttribute type="style"/>
</vpe:format>
@@ -477,11 +472,6 @@
</vpe:drop>
</vpe:dnd>
<vpe:textFormating>
- <vpe:format type="BlockFormat"
- handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler" />
- <vpe:format type="UnderlineFormat" setDefault="true">
- <vpe:formatAttribute type="style"/>
- </vpe:format>
<vpe:format type="BoldFormat">
<vpe:formatAttribute type="style"/>
</vpe:format>
@@ -509,8 +499,6 @@
<vpe:template children="yes" modify="yes">
<a href="javascript:return false;" class="{@styleClass}" style="{@style}"/>
<vpe:textFormating>
- <vpe:format type="BlockFormat"
- handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler" />
<vpe:format type="UnderlineFormat" setDefault="true">
<vpe:formatAttribute type="style"/>
</vpe:format>
@@ -548,7 +536,6 @@
</vpe:drop>
</vpe:dnd>
<vpe:textFormating>
- <vpe:format type="BlockFormat" addChildren="deny" handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler" />
<vpe:format type="UnderlineFormat">
<vpe:formatAttribute type="style"/>
</vpe:format>
@@ -1061,12 +1048,32 @@
<vpe:tag name="h:form" case-sensitive="yes">
<vpe:template children="yes" modify="yes" haveVisualPreview="no">
- <div style="border:1px dotted #FF6600;padding: 5px;" title="{tagstring()}"/>
+ <div style="border:1px dotted #FF6600;padding: 5px;{@style}" class="{@styleClass}" title="{tagstring()}"/>
<vpe:dnd>
<vpe:drag start-enable="yes"/>
<vpe:drop container="yes"/>
</vpe:dnd>
- </vpe:template>
+ <vpe:textFormating>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
</vpe:tag>
<vpe:tag name="f:attribute" case-sensitive="yes">
@@ -1127,7 +1134,6 @@
<vpe:drop container="no"/>
</vpe:dnd>
<vpe:textFormating>
- <vpe:format type="BlockFormat" handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler"/>
<vpe:format type="UnderlineFormat">
<vpe:formatAttribute type="style"/>
</vpe:format>
@@ -1163,7 +1169,6 @@
<vpe:drop container="no"/>
</vpe:dnd>
<vpe:textFormating>
- <vpe:format type="BlockFormat" handler="org.jboss.tools.vpe.editor.toolbar.format.handler.BlockFormatHandler"/>
<vpe:format type="UnderlineFormat">
<vpe:formatAttribute type="style"/>
</vpe:format>
16 years, 12 months
JBoss Tools SVN: r5976 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-01-25 13:31:17 -0500 (Fri, 25 Jan 2008)
New Revision: 5976
Modified:
trunk/as/docs/reference/en/modules/modules.xml
trunk/as/docs/reference/en/modules/perspective.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-199 - making changes in the chapters according t o the task
Modified: trunk/as/docs/reference/en/modules/modules.xml
===================================================================
--- trunk/as/docs/reference/en/modules/modules.xml 2008-01-25 18:30:27 UTC (rev 5975)
+++ trunk/as/docs/reference/en/modules/modules.xml 2008-01-25 18:31:17 UTC (rev 5976)
@@ -35,7 +35,10 @@
</figure>
<para> For the JBoss AS Server Adapters, publishing using this method will force a default,
best-guess, packaging configuration for your project. This best-guess does not publish
- incrementally, but instead repackages your entire project into a .war, .jar, or .ear as
+ incrementally, but instead repackages your entire project into a <emphasis>
+ <property>.war</property></emphasis>, <emphasis>
+ <property>.jar</property></emphasis>, or <emphasis>
+ <property>.ear</property></emphasis> as
appropriate, and then copies that file into the proper deploy directory. For quicker
smarter deployment, you will need to create archives using the <link
linkend="Project_archivesView">Project Archives view</link> and customize packaging
@@ -51,8 +54,8 @@
we suggest two more ways to deploy resources onto the server.</para>
<section>
<title>Top part of JBoss Server View</title>
- <para>In the top part of the JBoss Servers View like in the Servers View you should right
- click on a server and select the <emphasis>
+ <para>In the top part of the <property>JBoss Servers View</property> like in the Servers View you should
+ right click on a server and select the <emphasis>
<property>Add and Remove Projects</property>
</emphasis> menu item. This will bring up a dialog allowing you to either publish
projects or modules to a server, or remove them from the server.</para>
@@ -73,12 +76,12 @@
view</link>, it will be published according to the rules of that module
type.</para>
</section>
-
+
<section>
<title>Bottom part of JBoss Server View</title>
<para>In the bottom part of <emphasis>
- <property>JBoss Server View</property>
- </emphasis> there is a category called <emphasis>
+ <property>JBoss Server View</property>
+ </emphasis> there is a category called <emphasis>
<property>Modules</property>
</emphasis> which should display all currently-published modules on the server.
Right-clicking on the desired module and selecting <emphasis>
@@ -92,15 +95,20 @@
</imageobject>
</mediaobject>
</figure>
+
+ <para>Here, <emphasis>
+ <property>Incremental Publish</property>
+ </emphasis> is meant to enable publishing of only those parts where changes have been made.</para>
</section>
</section>
<section>
<title>Deploying with Project Archives View</title>
- <para>In the Project Archives View you can right-click on any declared archive and select
+ <para>In the <property>Project Archives View</property> you can right-click on any declared archive and select
the <emphasis>
<property>Publish To Server</property>
- </emphasis> element, as described in the <link linkend="Project_archivesView">Project
- Archives view</link> section of the Perspective chapter.</para>
+ </emphasis> element. For more on this subject, see <link
+ linkend="PublishToServer">Publishing to Server</link> in the Project Archives
+ View section.</para>
<figure>
<title>Publish to Server</title>
<mediaobject>
@@ -111,10 +119,15 @@
</figure>
<para> The only way to ensure an <emphasis>
<property>Incremental Build</property>
- </emphasis>, such as changes to one jsp, html, or .class file, is to enable the builder
- for that project. This is done by either changing the global preferences for the
- <property>Archives View</property>, or by enabling project-specific preferences and
- ensuring the builder is on.</para>
+ </emphasis>, such as changes to one <emphasis>
+ <property>.jsp</property>
+ </emphasis>, <emphasis>
+ <property>.html</property>
+ </emphasis>, or <emphasis>
+ <property>.class</property>
+ </emphasis> file, is to enable the builder for that project. This is done by either
+ changing the global preferences for the <property>Archives View</property>, or by
+ enabling project-specific preferences and ensuring the builder is on.</para>
</section>
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2008-01-25 18:30:27 UTC (rev 5975)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2008-01-25 18:31:17 UTC (rev 5976)
@@ -32,8 +32,7 @@
<para>The <property>JBoss Server View</property> is based on the WTP view, Server View. The
top part of the <property>JBoss Servers View</property> essentially embeds the original
Server View directly into it, making slight changes to the context menu. A second part
- was added to provide additional information about the server selected in the top part.
- </para>
+ was added to provide additional information about the server selected in the top part. </para>
<figure>
<title>The JBoss Server View</title>
@@ -60,7 +59,7 @@
<para>In order to debug your applications or EJB's that are deployed to the server, you must
start the server in debug mode. By starting the server in debug mode, eclipse will allow
you to set breakpoints on code in your workspace and step through the code.</para>
-
+
<para>The publish icon on the extreme right will republish any modules where it has
determined the workspace is out of sync with the server. It will attempt to do an
incremental publish if it turns out that the module in question is capable of doing one.</para>
@@ -325,10 +324,10 @@
<para>The first view extension is <emphasis>
<property>Modules</property>
- </emphasis> section. It shows which modules are currently deployed to the server, and
- allows you to remove them from the server, or force a full republish upon them. It
- only shows which modules have been deployed through Eclipse, not any and all modules
- that happen to be in the deploy directory.</para>
+ </emphasis> section. It shows which modules are currently deployed to the server,
+ and allows you to remove them from the server, or force a full republish upon them.
+ It only shows which modules have been deployed through Eclipse, not any and all
+ modules that happen to be in the deploy directory.</para>
<figure>
<title>Modules Action</title>
@@ -372,11 +371,11 @@
<para>The <emphasis>
<property>XML Configuration</property>
</emphasis> category allows you to quickly browse to descriptor files in your
- server's deploy directory and check or change the values. Basically, <emphasis>
+ server's deploy directory and check or change the values. Its use requires the
+ <property>Properties view</property>. Basically, <emphasis>
<property>XML Configuration</property>
- </emphasis> includes XML XPaths where a XPath is a path used to access some specific
- part of an xml document. Besides, its use requires the <property>Properties
- view</property>. </para>
+ </emphasis> includes XML XPaths where a xpath is a path used to access some specific
+ part of an xml document. </para>
<figure>
<title>XML Configuration and Properties View</title>
@@ -387,12 +386,21 @@
</mediaobject>
</figure>
- <para>The category itself contains only a list of categories. By right-clicking on <emphasis>
+ <para>The <emphasis>
<property>XML Configuration</property>
- </emphasis>, you can create a new category. Ports are provided by default and is
- filled with many of the most commonly used ports in the <property>JBoss
- Server</property>.</para>
+ </emphasis> category itself contains only a list of categories. <emphasis>
+ <property>Ports</property>
+ </emphasis> are provided by default and is filled with many of the most commonly
+ used ports in the <property>JBoss Server</property>. In the <property>Properties
+ view</property> you can see an identifier and nested files underneath in which
+ that xpath can be found as well as its current value. The details of the xpath are
+ hidden as all you need to see is only which file you're referring to and
+ what its current value is.</para>
+ <para> By right-clicking on <emphasis>
+ <property>XML Configuration</property>
+ </emphasis>, you can create a new category. </para>
+
<figure>
<title>Adding New Category</title>
<mediaobject>
@@ -404,7 +412,9 @@
<para>By right-clicking on <emphasis>
<property>Ports</property>
- </emphasis>, you can create a new XPaths.</para>
+ </emphasis> or any other category in <emphasis>
+ <property>XML Configuration</property>
+ </emphasis>, you can create a new xpath.</para>
<figure>
<title>Adding New XPath</title>
@@ -426,16 +436,46 @@
</mediaobject>
</figure>
- <para>As you type, the fields autocomplete to help you locate exactly what XPath you're
- looking for. The goal here is to get an end result where the XPath matches up with
- an easily changed property. With that in mind, if the property you want to change is
- the text of an element, then the final field Attribute Name should be left blank and
- your XPath should end with port. If, on the other hand, your desired field is the
- port attribute of <fieldName port="35">, then your XPath will end with
- fieldName and your Attribute Name will be "port". When finished, you can click <emphasis>
- <property>Preview</property>
- </emphasis> to see how many matches you have for that particular XPath, as shown
- below.</para>
+ <!--para>As you can see on the figure above, when you type the fields autocomplete to help
+ you locate exactly what xpath you're looking for. </para-->
+
+ <para>The goal here is to get an end result where the XPath matches up with a necessary
+ property. With that in mind, let's look how it works. If the property you
+ want to reach is the text of an element, for example, number 35 for
+ <emphasis><port>35</port></emphasis> element, than
+ your <emphasis>
+ <property>XPath Patten</property>
+ </emphasis> should end with <emphasis> port </emphasis> and <emphasis>
+ <property>Attribute Name</property>
+ </emphasis> field should be left blank. If, on the other hand, your desired field is
+ the value of the port attribute in the element <emphasis><fieldName
+ port="35"></emphasis>, then your <emphasis>
+ <property>XPath Patten</property>
+ </emphasis> will end with <emphasis>
+ <property>fieldName</property>
+ </emphasis> and your <emphasis>
+ <property>Attribute Name</property>
+ </emphasis> should be <emphasis> port</emphasis>.</para>
+
+ <para>Thus, in our case let's reach the text of
+ <emphasis>description</emphasis> element on the patton bellow.</para>
+ <para>
+ <programlisting role="XML"><![CDATA[...
+<server>
+...
+<mbean code="org.jboss.ejb.EJBDeployer" name="jboss.ejb:service=EJBDeployer" xmbean-dd="">
+
+ <!-- Inline XMBean Descriptor BEGIN -->
+ <xmbean>
+ <description>The EJBDeployer responsible for ejb jar deployment</description>
+...
+]]></programlisting></para>
+
+
+ <para>So, in the <emphasis>
+ <property>XPath Patten</property>
+ </emphasis> field you should put the xpath like on the figure below.</para>
+
<figure>
<title>XPath Preview</title>
<mediaobject>
@@ -444,7 +484,11 @@
</imageobject>
</mediaobject>
</figure>
-
+
+ <para>When finished, click <emphasis>
+ <property>Preview</property>
+ </emphasis> to see how many matches you have for that particular XPath.</para>
+
<para>As part of the <property>JBoss Server View</property> there is a <emphasis>
<property>JMX Console</property>
</emphasis> section which allows you to browse and use the JMX exposed beans on the
@@ -465,25 +509,31 @@
<title>Project Archives View</title>
<para>Every application, whether Plain Old Java, J2EE, or some other language altogether,
needs to be packaged in some way. In Java-related projects, many people use ANT. JBoss
- Tools comes with our own archives tool with a bit easier and less-verbose XML and a
+ Tools comes with our own Archives tool with a bit easier and less-verbose XML and a
handy user interface.</para>
- <para>The Project Archives plugin consists primarily of a view to set up each packaging
- configuration. Each project can enable or disable its builder, or depend on the global
- setting.</para>
+ <para>The Project Archives plugin consists primarily of a view, that is <property>Project
+ Archives View</property>, to set up each packaging configuration. Each project can
+ enable or disable its own builder, or depend on the global setting.</para>
<para>The packaging configuration for each project is stored in that project's root folder,
- and is in a file named <property>.packages</property>, which has a fairly simple XML
- structure. Modifying the file by hand is neither required nor recommended, and using the
- UI is the official way of modifying your packaging structure.</para>
+ and is in a file named <emphasis>
+ <property>.packages</property>
+ </emphasis>, which has a fairly simple XML structure. Modifying the file by hand is
+ neither required nor recommended, and using the UI is the official way of modifying your
+ packaging structure.</para>
<para>Aside from the builder, the other preferences for the plugin are mostly cosmetic,
allowing you to show full or truncated paths, show the project at the root, etc. None of
these has any effect on the functionality of the packaging plugin.</para>
+ <para>Further, let's look through all the possibilities that the <property>Project
+ Archives View</property> provides.</para>
+
<section id="Creating an archive">
<title>Creating an Archive</title>
<para>When creating a new archive, you have some different options at your disposal. If
- the project has no <property>.packages</property> file, your options will be
- presented to you all at once to choose from (as above). Otherwise you will
- right-click inside the view and select <emphasis>
+ the project has no <emphasis>
+ <property>.packages</property>
+ </emphasis> file, your options will be presented to you all at once to choose from
+ (as above). Otherwise you will right-click inside the view and select <emphasis>
<property>New Archive</property>
</emphasis> to see your archive type options.</para>
<figure>
@@ -521,8 +571,10 @@
workspace, inside some other archive, or inside a folder declared inside an archive.
You can browse to workspace or filesystem destinations by clicking on their
respective buttons. To select a destination inside some other archive, you'll need
- to press the <property>Workspace...</property> button. At the bottom of the list,
- you'll see archives that have been declared in the workspace.</para>
+ to press the <emphasis>
+ <property>Workspace...</property>
+ </emphasis> button. At the bottom of the list, you'll see archives that have been
+ declared in the workspace.</para>
<section id="CreatingaFolder">
<title>Creating a Folder</title>
<para>Creating a folder is much easier. You simply right-click on an archive or
@@ -532,10 +584,12 @@
<section id="CreatingaFileSet">
<title>Creating a FileSet</title>
<para>To create a new fileset, you click on an available target location such as an
- archive, a nested archive, or a folder within an archive, and select New
- Fileset. The New Fileset Wizard requires a destination (where the files will
- go), and a root directory (or where the files are coming from). The source can
- be anywhere in the workspace or from the filesystem at large.</para>
+ archive, a nested archive, or a folder within an archive, and select <emphasis>
+ <property>New Fileset</property>
+ </emphasis>. The <property>New Fileset Wizard</property> requires a destination
+ (where the files will go), and a root directory (or where the files are coming
+ from). The source can be anywhere in the workspace or from the filesystem at
+ large.</para>
<para>Below that, the fileset requires only an includes pattern and an excludes
pattern. As you type in either of these fields, the preview viewer should update
itself with which files are matched.</para>
@@ -637,11 +691,14 @@
</imageobject>
</mediaobject>
</figure>
- <para>The dialog above appears after selecting <property>Publish To Server</property>.
- To simply publish once, you just select the server(s) that you want, and finish. If
- you want the Publish to Server action on that particular Archive to always publish
- to that set of servers, then check the appropriate checkbox. And finally, to enable
- automatic publishing upon build events, check the last checkbox.</para>
+ <para>The dialog above appears after selecting <emphasis>
+ <property>Publish To Server</property>
+ </emphasis>. To simply publish once, you just select the server(s) that you want,
+ and finish. If you want the <emphasis>
+ <property>Publish to Server</property>
+ </emphasis> action on that particular Archive to publish always to that set of
+ servers, then check the appropriate checkbox. And finally, to enable automatic
+ publishing upon build events, check the last checkbox.</para>
<para>The automatic publishing feature is nice if, for example, your package's
destination (where it is built) is a temporary folder and you want the archive
published to several servers. If you only really want your archive published to one
16 years, 12 months
JBoss Tools SVN: r5974 - in trunk/seam: plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-01-25 13:03:55 -0500 (Fri, 25 Jan 2008)
New Revision: 5974
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.1
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/UsualComponent.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.2
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1690 Fixed. Check duplicate @Remove methods only in stateful sessian bean components.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2008-01-25 17:10:32 UTC (rev 5973)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2008-01-25 18:03:55 UTC (rev 5974)
@@ -501,6 +501,7 @@
ISeamTextSourceReference location = getScopeLocation(component);
addError(STATEFUL_COMPONENT_WRONG_SCOPE_MESSAGE_ID, SeamPreferences.STATEFUL_COMPONENT_WRONG_SCOPE, new String[]{component.getName()}, location, javaDeclaration.getResource());
}
+ validateDuplicateComponentMethod(SeamComponentMethodType.REMOVE, component, REMOVE_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.DUPLICATE_REMOVE);
}
}
@@ -515,7 +516,6 @@
private void validateDuplicateComponentMethods(ISeamComponent component) {
validateDuplicateComponentMethod(SeamComponentMethodType.DESTROY, component, DESTROY_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.DUPLICATE_DESTROY);
- validateDuplicateComponentMethod(SeamComponentMethodType.REMOVE, component, REMOVE_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.DUPLICATE_REMOVE);
validateDuplicateComponentMethod(SeamComponentMethodType.CREATE, component, CREATE_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.DUPLICATE_CREATE);
validateDuplicateComponentMethod(SeamComponentMethodType.UNWRAP, component, UNWRAP_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.DUPLICATE_UNWRAP);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2008-01-25 17:10:32 UTC (rev 5973)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2008-01-25 18:03:55 UTC (rev 5974)
@@ -28,10 +28,10 @@
##Section Entities
SeamValidatorConfigurationBlock_section_entities=Entities
SeamValidatorConfigurationBlock_pb_entityComponentHasWrongScope_label=Entity component has wrong scope:
-SeamValidatorConfigurationBlock_pb_duplicateRemove_label=Duplicate @Remove method:
##Section Component life-cycle methods
SeamValidatorConfigurationBlock_section_lifecycle=Component life-cycle methods:
+SeamValidatorConfigurationBlock_pb_duplicateRemove_label=Duplicate @Remove method for stateful session bean:
SeamValidatorConfigurationBlock_pb_duplicateDestroy_label=Duplicate @Destroy method:
SeamValidatorConfigurationBlock_pb_duplicateCreate_label=Duplicate @Create method:
SeamValidatorConfigurationBlock_pb_duplicateUnwrap_label=Duplicate @Unwrap method:
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2008-01-25 17:10:32 UTC (rev 5973)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2008-01-25 18:03:55 UTC (rev 5974)
@@ -69,14 +69,14 @@
private static SectionDescription SECTION_ENTITY = new SectionDescription(
SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_entities,
new String[][]{
- {SeamPreferences.ENTITY_COMPONENT_WRONG_SCOPE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_entityComponentHasWrongScope_label},
- {SeamPreferences.DUPLICATE_REMOVE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateRemove_label},
+ {SeamPreferences.ENTITY_COMPONENT_WRONG_SCOPE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_entityComponentHasWrongScope_label}
}
);
private static SectionDescription SECTION_LIFECYCLE = new SectionDescription(
SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_lifecycle,
new String[][]{
+ {SeamPreferences.DUPLICATE_REMOVE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateRemove_label},
{SeamPreferences.DUPLICATE_DESTROY, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateDestroy_label},
{SeamPreferences.DUPLICATE_CREATE, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateCreate_label},
{SeamPreferences.DUPLICATE_UNWRAP, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateUnwrap_label},
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.2
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.2 2008-01-25 17:10:32 UTC (rev 5973)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.2 2008-01-25 18:03:55 UTC (rev 5974)
@@ -12,7 +12,7 @@
http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd
http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd">
- <component class="org.domain.SeamWebTestProject.session.StateComponent" name="statefulComponent" scope="application">
+ <component class="org.domain.SeamWebTestProject.session.StateComponent" name="stateComponent" scope="application">
<property name="abc">value1</property>
</component>
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.1
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.1 (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.1 2008-01-25 18:03:55 UTC (rev 5974)
@@ -0,0 +1,24 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Name;
+
+@Stateful
+@Name("statefulComponent")
+public class StatefulComponent {
+
+ @Destroy
+ public void destroyMethod(){
+ }
+
+ @Remove
+ public void removeMethod1(){
+ }
+
+ @Remove
+ public void removeMethod2(){
+ }
+}
\ No newline at end of file
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/UsualComponent.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/UsualComponent.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/UsualComponent.java 2008-01-25 18:03:55 UTC (rev 5974)
@@ -0,0 +1,14 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import org.jboss.seam.annotations.Name;
+import javax.ejb.Remove;
+
+@Name("usualComponent")
+public class UsualComponent {
+
+ @Remove
+ public void removeMethod1() {}
+
+ @Remove
+ public void removeMethod2() {}
+}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-01-25 17:10:32 UTC (rev 5973)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-01-25 18:03:55 UTC (rev 5974)
@@ -22,20 +22,13 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.internal.decorators.DecoratorManager;
-import org.eclipse.ui.progress.UIJob;
-import org.jboss.tools.common.model.XJob;
-import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
-import org.jboss.tools.seam.core.test.project.facet.TestUtils;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.test.util.xpl.EditorTestHelper;
public class SeamValidatorsTest extends TestCase {
@@ -61,8 +54,7 @@
assertNotNull("Seam project is null", seamProject);
return seamProject;
}
-
-
+
public void testComponentsValidator() {
ISeamProject seamProject = getSeamProject(project);
@@ -187,10 +179,10 @@
refreshProject(project);
number = getMarkersNumber(componentsFile);
- assertFalse("Problem marker 'Component class name cannot be resolved to a type' not found' not found' not found", number == 0);
+ assertFalse("Problem marker 'Component class name cannot be resolved to a type' was not found", number == 0);
messages = getMarkersMessage(componentsFile);
- assertTrue("Problem marker 'Component class name cannot be resolved to a type' not found", "\"org.domain.SeamWebTestProject.session.StateComponent\" cannot be resolved to a type".equals(messages[0]));
+ assertTrue("Problem marker 'Component class name cannot be resolved to a type' was not found", "\"org.domain.SeamWebTestProject.session.StateComponent\" cannot be resolved to a type".equals(messages[0]));
lineNumbers = getMarkersNumbersOfLine(componentsFile);
@@ -257,64 +249,29 @@
JUnitUtils.fail("Error in changing 'abcEntity.java' content to " +
"'abcEntity.2'", ex);
}
-
+
refreshProject(project);
-
+
number = getMarkersNumber(abcEntityFile);
assertFalse("Problem marker 'Entity component has wrong scope' not found' not found' not found", number == 0);
-
+
String[] messages = getMarkersMessage(abcEntityFile);
assertTrue("Problem marker 'Entity component has wrong scope' not found", "Entity component \"abcEntity\" should not have org.jboss.seam.ScopeType.STATELESS".equals(messages[0]));
int[] lineNumbers = getMarkersNumbersOfLine(abcEntityFile);
-
- assertTrue("Problem marker has wrong line number", lineNumbers[0] == 15);
-
- // Duplicate @Remove method
- System.out.println("Test - Duplicate @Remove method");
-
- IFile abcEntityFile3 = project.getFile("src/action/org/domain/SeamWebWarTestProject/entity/abcEntity.3");
- try{
- abcEntityFile.setContents(abcEntityFile3.getContents(), true, false, new NullProgressMonitor());
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'abcEntity.java' content to " +
- "'abcEntity.3'", ex);
- }
-
- refreshProject(project);
-
- number = getMarkersNumber(abcEntityFile);
- assertFalse("Problem marker 'Duplicate @Remove method' not found' not found' not found", number == 0);
-
- messages = getMarkersMessage(abcEntityFile);
- assertTrue("Problem marker 'Duplicate @Remove method' not found", messages[0].startsWith("Duplicate @Remove method \"removeMethod"));
- lineNumbers = getMarkersNumbersOfLine(abcEntityFile);
-
- assertTrue("Wrong number of problem markers", lineNumbers.length == messages.length && messages.length == 2);
-
- if(messages[1].indexOf("removeMethod2") >= 0){
- assertTrue("Problem marker has wrong line number", lineNumbers[0] == 42);
- assertTrue("Problem marker has wrong line number", lineNumbers[1] == 47);
- }else{
- assertTrue("Problem marker has wrong line number", lineNumbers[0] == 47);
- assertTrue("Problem marker has wrong line number", lineNumbers[1] == 42);
-
- }
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 15);
}
public void testComponentLifeCycleMethodsValidator() {
ISeamProject seamProject = getSeamProject(project);
IFile componentsFile = project.getFile("WebContent/WEB-INF/components.xml");
-
+
IFile statefulComponentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java");
-
- int number = getMarkersNumber(statefulComponentFile);
- assertTrue("Problem marker was found in StatefulComponent.java file", number == 0);
// Duplicate @Destroy method
System.out.println("Test - Duplicate @Destroy method");
-
+
IFile statefulComponentFile6 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.6");
try{
statefulComponentFile.setContents(statefulComponentFile6.getContents(), true, false, new NullProgressMonitor());
@@ -324,12 +281,12 @@
}
refreshProject(project);
+
+ int number = getMarkersNumber(statefulComponentFile);
+ assertFalse("Problem marker 'Duplicate @Destroy method' was not found", number == 0);
- number = getMarkersNumber(statefulComponentFile);
- assertFalse("Problem marker 'Duplicate @Destroy method' not found' not found' not found", number == 0);
-
String[] messages = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Destroy method' not found", messages[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
+ assertTrue("Problem marker 'Duplicate @Destroy method' was not found", messages[0].startsWith("Duplicate @Destroy method \"destroyMethod"));
int[] lineNumbers = getMarkersNumbersOfLine(statefulComponentFile);
@@ -358,10 +315,10 @@
refreshProject(project);
number = getMarkersNumber(statefulComponentFile);
- assertFalse("Problem marker 'Duplicate @Create method' not found' not found' not found", number == 0);
+ assertFalse("Problem marker 'Duplicate @Create method' was not found' not found' not found", number == 0);
messages = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Create method' not found", messages[0].startsWith("Duplicate @Create method \"createMethod"));
+ assertTrue("Problem marker 'Duplicate @Create method' was not found", messages[0].startsWith("Duplicate @Create method \"createMethod"));
lineNumbers = getMarkersNumbersOfLine(statefulComponentFile);
@@ -390,10 +347,10 @@
refreshProject(project);
number = getMarkersNumber(statefulComponentFile);
- assertFalse("Problem marker 'Duplicate @Unwrap method' not found' not found' not found", number == 0);
+ assertFalse("Problem marker 'Duplicate @Unwrap method' was not found' not found' not found", number == 0);
messages = getMarkersMessage(statefulComponentFile);
- assertTrue("Problem marker 'Duplicate @Unwrap method' not found", messages[0].startsWith("Duplicate @Unwrap method \"unwrapMethod"));
+ assertTrue("Problem marker 'Duplicate @Unwrap method' was not found", messages[0].startsWith("Duplicate @Unwrap method \"unwrapMethod"));
lineNumbers = getMarkersNumbersOfLine(statefulComponentFile);
@@ -507,8 +464,49 @@
lineNumbers = getMarkersNumbersOfLine(statefulComponentFile);
assertTrue("Problem marker has wrong line number", lineNumbers[0] == 23);
+
+ // Duplicate @Remove method
+
+ IFile statefulComponentFile1 = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.1");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile1.getContents(), true, false, new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to " +
+ "'StatefulComponent.1'", ex);
+ }
+
+ refreshProject(project);
+
+ number = getMarkersNumber(statefulComponentFile);
+ assertFalse("Problem marker 'Duplicate @Remove method' not found", number == 0);
+
+ messages = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Remove method' not found", messages[0].startsWith("Duplicate @Remove method \"removeMethod"));
+
+ lineNumbers = getMarkersNumbersOfLine(statefulComponentFile);
+
+ assertTrue("Wrong number of problem markers", lineNumbers.length == messages.length && messages.length == 2);
+
+ if(messages[1].indexOf("removeMethod2") >= 0){
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 17);
+ assertTrue("Problem marker has wrong line number", lineNumbers[1] == 21);
+ }else{
+ assertTrue("Problem marker has wrong line number", lineNumbers[0] == 21);
+ assertTrue("Problem marker has wrong line number", lineNumbers[1] == 17);
+ }
}
-
+
+ /**
+ * The validator should check duplicate @Remove methods only in stateful session bean component
+ * This method tests usual component (not stateful sessian bean) with two @Remove methods. It must not have error markers.
+ */
+ public void testDuplicateRemoveMethodInComponent() {
+ getSeamProject(project);
+ IFile componentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/UsualComponent.java");
+ int number = getMarkersNumber(componentFile);
+ assertTrue("Problem marker was found in UsualComponent.java file", number == 0);
+ }
+
public void testFactoriesValidator() {
ISeamProject seamProject = getSeamProject(project);
16 years, 12 months
JBoss Tools SVN: r5973 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-01-25 12:10:32 -0500 (Fri, 25 Jan 2008)
New Revision: 5973
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1586
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java 2008-01-25 15:52:18 UTC (rev 5972)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarGroupTemplate.java 2008-01-25 17:10:32 UTC (rev 5973)
@@ -141,13 +141,8 @@
if (!sourceNode.getParentNode().getNodeName().endsWith(":" + RichFacesToolBarTemplate.TAG_NAME)) {
visualNode = RichFacesToolBarTemplate.createExceptionNode(visualDocument, "Parent should be toolBar");
creationData = new VpeCreationData(visualNode);
- } else if (!RichFacesToolBarTemplate.isValidItemSeparatorName(itemSeparator)) {
- visualNode = RichFacesToolBarTemplate.createExceptionNode(visualDocument,
- "Unknown type of separator \"" + itemSeparator + "\"");
-
- creationData = new VpeCreationData(visualNode);
- } else {
-
+ } else {
+ itemSeparator = RichFacesToolBarTemplate.checkAndUpdateItemSeparatorName(itemSeparator);
SourceToolBarGroupItems sourceToolBarGroupItems = new SourceToolBarGroupItems(sourceNode,
ATTR_LOCATION_RIGHT_VALUE.equals(sourceElement.getAttribute(ATTR_LOCATION_NAME)),
itemSeparator);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java 2008-01-25 15:52:18 UTC (rev 5972)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesToolBarTemplate.java 2008-01-25 17:10:32 UTC (rev 5973)
@@ -58,11 +58,8 @@
Element sourceElement = (Element) sourceNode;
String itemSeparator = sourceElement.getAttribute(ITEMSEPARATOR_ATTR_NAME);
- if (!isValidItemSeparatorName(itemSeparator)) {
- visualNode = createExceptionNode(visualDocument,
- "Unknown type of separator \"" + itemSeparator + "\"");
- creationData = new VpeCreationData(visualNode);
- } else {
+
+ itemSeparator = checkAndUpdateItemSeparatorName(itemSeparator);
SourceToolBarItems sourceToolBarItems = new SourceToolBarItems(sourceNode, itemSeparator);
String itemSeparatorImageUrl = getSeparatorImageUrlString(sourceToolBarItems.getItemSeparator());
@@ -169,7 +166,6 @@
body.appendChild(row);
visualNode.appendChild(body);
- }
return creationData;
}
@@ -351,14 +347,18 @@
return separatorImageUrl;
}
- static boolean isValidItemSeparatorName(String itemSeparator) {
- return itemSeparator == null
- || (itemSeparator != null && itemSeparator.length() == 0)
- || ITEM_SEPARATOR_DISC.equals(itemSeparator)
- || ITEM_SEPARATOR_LINE.equals(itemSeparator)
- || ITEM_SEPARATOR_GRID.equals(itemSeparator)
- || ITEM_SEPARATOR_SQUARE.equals(itemSeparator)
- || ITEM_SEPARATOR_NONE.equals(itemSeparator);
+ static String checkAndUpdateItemSeparatorName(String itemSeparator) {
+ if (itemSeparator == null
+ || (itemSeparator != null && itemSeparator.length() == 0)) {
+ return ITEM_SEPARATOR_NONE;
+ } else if (ITEM_SEPARATOR_DISC.equals(itemSeparator)
+ || ITEM_SEPARATOR_LINE.equals(itemSeparator)
+ || ITEM_SEPARATOR_GRID.equals(itemSeparator)
+ || ITEM_SEPARATOR_SQUARE.equals(itemSeparator)
+ || ITEM_SEPARATOR_NONE.equals(itemSeparator)) {
+ return itemSeparator;
+ }
+ return ITEM_SEPARATOR_NONE;
}
private class SourceToolBarItem {
16 years, 12 months
JBoss Tools SVN: r5972 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-01-25 10:52:18 -0500 (Fri, 25 Jan 2008)
New Revision: 5972
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1119
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-01-25 15:14:37 UTC (rev 5971)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-01-25 15:52:18 UTC (rev 5972)
@@ -16,6 +16,7 @@
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -110,6 +111,9 @@
private nsIDOMNode headNode;
private List includeStack;
boolean rebuildFlag = false;
+
+ // Fix for JBIDE-1119
+ private Collection<nsIDOMHTMLInputElement> inputElements = new ArrayList<nsIDOMHTMLInputElement>();
/** faceletFile */
private boolean faceletFile = false;
@@ -194,6 +198,7 @@
public void rebuildDom(Document sourceDocument) {
cleanHead();
+ inputElements.clear();
domMapping.clear(visualContentArea);
pageContext.clearAll();
refreshExternalLinks();
@@ -223,7 +228,9 @@
if (visualNewNode != null) {
nsIDOMHTMLInputElement iDOMInputElement = (nsIDOMHTMLInputElement) visualNewNode
.queryInterface(nsIDOMHTMLInputElement.NS_IDOMHTMLINPUTELEMENT_IID);
- iDOMInputElement.setReadOnly(true);
+ // Fix for JBIDE-1119
+ inputElements.add(iDOMInputElement);
+ //iDOMInputElement.setReadOnly(true);
}
} catch (XPCOMException ex) {
// just ignore this exception
@@ -796,6 +803,11 @@
}
nsIDOMNode visualOldNode = domMapping.remove(sourceNode);
if (visualOldNode != null) {
+
+ if (inputElements.contains(visualOldNode)) {
+ inputElements.remove(visualOldNode);
+ }
+
if (elementMapping != null) {
nsIDOMElement border = elementMapping.getBorder();
if (border != null) {
@@ -816,7 +828,12 @@
}
public void removeNode(Node sourceNode) {
- domMapping.remove(sourceNode);
+ nsIDOMNode visualOldNode = domMapping.remove(sourceNode);
+ if (visualOldNode != null) {
+ if (inputElements.contains(visualOldNode)) {
+ inputElements.remove(visualOldNode);
+ }
+ }
}
private Node getParentTable(Node sourceNode, int depth) {
@@ -1231,6 +1248,11 @@
public void resize(nsIDOMElement element, int resizerConstrains, int top,
int left, int width, int height) {
+
+ for (nsIDOMHTMLInputElement inputElement : inputElements) {
+ inputElement.setReadOnly(true);
+ }
+
VpeElementMapping elementMapping = (VpeElementMapping) domMapping
.getNodeMapping(element);
if (elementMapping != null) {
@@ -1239,6 +1261,11 @@
element, elementMapping.getData(), resizerConstrains, top,
left, width, height);
}
+
+ for (nsIDOMHTMLInputElement inputElement : inputElements) {
+ inputElement.setReadOnly(false);
+ }
+
}
static boolean isAnonElement(nsIDOMNode visualNode) {
16 years, 12 months
JBoss Tools SVN: r5971 - in trunk/jst/tests/org.jboss.tools.jst.jsp.test: projects/JsfJbide1641Test and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-01-25 10:14:37 -0500 (Fri, 25 Jan 2008)
New Revision: 5971
Added:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.classpath
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.project
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/WebContent/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/WebContent/pages/
trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/WebContent/pages/greeting.xhtml
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1641 Problems with inserting atributes using CA on xhtml pages.
JUnit TestCase is added for the issue
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.classpath (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.classpath 2008-01-25 15:14:37 UTC (rev 5971)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_07"/>
+ <classpathentry kind="con" path="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer/JBoss 4.2 Runtime"/>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.project (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.project 2008-01-25 15:14:37 UTC (rev 5971)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JsfJbide1641Test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.common.verification.verifybuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/WebContent/pages/greeting.xhtml
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/WebContent/pages/greeting.xhtml (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/WebContent/pages/greeting.xhtml 2008-01-25 15:14:37 UTC (rev 5971)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <f:loadBundle basename="resources" var="msg" />
+
+ <ui:composition template="/templates/common.xhtml">
+ <ui:define name="pageTitle">Greeting to User</ui:define>
+ <ui:define name="pageHeader">Facelets Greeting Page</ui:define>
+ <ui:define name="body">
+ #{msg.greeting} #{person.name}!
+ </ui:define>
+ </ui:composition>
+</html>
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.jsp.test/projects/JsfJbide1641Test/WebContent/pages/greeting.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2008-01-25 15:07:07 UTC (rev 5970)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/JstJspAllTests.java 2008-01-25 15:14:37 UTC (rev 5971)
@@ -1,6 +1,7 @@
package org.jboss.tools.jst.jsp.test;
import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1585Test;
+import org.jboss.tools.jst.jsp.test.ca.JstJspJbide1641Test;
import org.jboss.tools.jst.jsp.test.ca.StrutsJspJbide1648Test;
import junit.framework.Test;
@@ -12,6 +13,7 @@
TestSuite suite = new TestSuite("Test for org.jboss.tools.jst.jsp.test");
suite.addTestSuite(JstJspJbide1585Test.class);
suite.addTestSuite(StrutsJspJbide1648Test.class);
+ suite.addTestSuite(JstJspJbide1641Test.class);
return suite;
}
Added: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-01-25 15:14:37 UTC (rev 5971)
@@ -0,0 +1,177 @@
+package org.jboss.tools.jst.jsp.test.ca;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jst.jsp.contentassist.RedHatCustomCompletionProposal;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class JstJspJbide1641Test extends TestCase {
+ TestProjectProvider provider = null;
+ IProject project = null;
+ boolean makeCopy = false;
+ private static final String PROJECT_NAME = "JsfJbide1641Test";
+ private static final String PAGE_NAME = "/WebContent/pages/greeting.xhtml";
+ private static final String PREFIX_STRING = "<h:commandButton a";
+ private static final String PROPOSAL_TO_APPLY_STRING = "action=\"\"";
+ private static final String ATTRIBUTE_TO_INSERT_STRING = "ction=\"\"";
+ private static final String POSTFIX_STRING = "></h:commandButton>";
+ private static final String INSERT_BEFORE_STRING = "<ui:composition";
+ private static final String INSERTION_STRING = PREFIX_STRING + POSTFIX_STRING;
+ private static final String COMPARE_STRING = PREFIX_STRING + ATTRIBUTE_TO_INSERT_STRING + POSTFIX_STRING;
+
+ public static Test suite() {
+ return new TestSuite(JstJspJbide1641Test.class);
+ }
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jst.jsp.test", null, PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ Throwable exception = null;
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (Exception x) {
+ exception = x;
+ x.printStackTrace();
+ }
+ assertNull("An exception caught: " + (exception != null? exception.getMessage() : ""), exception);
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ public void testJstJspJbide1641() {
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
+
+ IFile jspFile = project.getFile(PAGE_NAME);
+
+ assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile != null));
+ assertTrue("The file \"" + PAGE_NAME + "\" is not found", (jspFile.exists()));
+
+ FileEditorInput editorInput = new FileEditorInput(jspFile);
+ Throwable exception = null;
+ IEditorPart editorPart = null;
+ try {
+ editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, "org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor");
+ } catch (PartInitException ex) {
+ exception = ex;
+ ex.printStackTrace();
+ assertTrue("The JSP Visual Editor couldn't be initialized.", false);
+ }
+
+ JSPMultiPageEditor jspEditor = null;
+
+ if (editorPart instanceof JSPMultiPageEditor)
+ jspEditor = (JSPMultiPageEditor)editorPart;
+
+ // Delay for 3 seconds so that
+ // the Favorites view can be seen.
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+ TestUtil.delay(3000);
+
+ JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
+ StructuredTextViewer viewer = jspTextEditor.getTextViewer();
+ IDocument document = viewer.getDocument();
+ SourceViewerConfiguration config = TestUtil.getSourceViewerConfiguration(jspTextEditor);
+ IContentAssistant contentAssistant = (config == null ? null : config.getContentAssistant(viewer));
+
+ assertTrue("Cannot get the Content Assistant instance for the editor for page \"" + PAGE_NAME + "\"", (contentAssistant != null));
+
+ // Find start of <ui:composition> tag
+ String documentContent = document.get();
+ int start = (documentContent == null ? -1 : documentContent.indexOf(INSERT_BEFORE_STRING));
+ int offsetToTest = start + PREFIX_STRING.length();
+
+ assertTrue("Cannot find the starting point in the test file \"" + PAGE_NAME + "\"", (start != -1));
+
+ String documentContentModified = documentContent.substring(0, start) +
+ INSERTION_STRING + documentContent.substring(start);
+ String documentContentToCompare = documentContent.substring(0, start) +
+ COMPARE_STRING + documentContent.substring(start);
+
+ jspTextEditor.setText(documentContentModified);
+
+ ICompletionProposal[] result= null;
+ String errorMessage = null;
+
+ IContentAssistProcessor p= TestUtil.getProcessor(viewer, offsetToTest, contentAssistant);
+ if (p != null) {
+ try {
+ result= p.computeCompletionProposals(viewer, offsetToTest);
+ } catch (Throwable x) {
+ x.printStackTrace();
+ }
+ errorMessage= p.getErrorMessage();
+ }
+
+// if (errorMessage != null && errorMessage.trim().length() > 0) {
+// System.out.println("#" + offsetToTest + ": ERROR MESSAGE: " + errorMessage);
+// }
+
+ assertTrue("Content Assistant peturned no proposals", (result != null && result.length > 0));
+
+ boolean bPropoosalToApplyFound = false;
+ for (int i = 0; i < result.length; i++) {
+ if (!(result[i] instanceof RedHatCustomCompletionProposal))
+ continue;
+ RedHatCustomCompletionProposal proposal = (RedHatCustomCompletionProposal)result[i];
+ String proposalString = proposal.getReplacementString();
+// try {
+// System.out.println("Result#" + i + " ==> Offs: " + offsetToTest + " RedHatCustomCompletionProposal[" + proposalString + "], Offs: " + proposalReplacementOffset + ", Len: " + proposalReplacementLength + ", Doc: [" + document.get(proposalReplacementOffset, proposalReplacementLength));
+// } catch (BadLocationException e) {
+// }
+ if (PROPOSAL_TO_APPLY_STRING.equals(proposalString)) {
+ bPropoosalToApplyFound = true;
+ proposal.apply(document);
+ break;
+ }
+ }
+ assertTrue("The proposal to apply not found.", bPropoosalToApplyFound);
+
+ try {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue("Waiting for the jobs to complete has failed.", false);
+ }
+
+ String documentUpdatedContent = document.get();
+ assertTrue("The proposal replacement is failed.", documentContentToCompare.equals(documentUpdatedContent));
+
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .closeEditor(editorPart, false);
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 12 months
JBoss Tools SVN: r5970 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-01-25 10:07:07 -0500 (Fri, 25 Jan 2008)
New Revision: 5970
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java
Log:
JBIDE-1669
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java 2008-01-25 15:04:06 UTC (rev 5969)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java 2008-01-25 15:07:07 UTC (rev 5970)
@@ -352,7 +352,7 @@
}
if(project != null && project.exists() && !project.isOpen()) {
- setErrorMessage(WebUIMessages.PROJECT_EXISTS_IN_WORKSPACE + getProjectNameValue() + " exists in workspace and is closed. To use the project, please open it."); //$NON-NLS-2$
+ setErrorMessage(NLS.bind(WebUIMessages.PROJECT_EXISTS_IN_WORKSPACE, getProjectNameValue()) );
return false;
}
if(project == null || !project.exists()) {
16 years, 12 months
JBoss Tools SVN: r5969 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-25 10:04:06 -0500 (Fri, 25 Jan 2008)
New Revision: 5969
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1594
fixed error Open mapping file for composite properties
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2008-01-25 15:01:51 UTC (rev 5968)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2008-01-25 15:04:06 UTC (rev 5969)
@@ -64,13 +64,13 @@
openTest(persClass, consCFG);
props = new PersistentClassWorkbenchAdapter().getChildren(persClass);
for (int j = 0; j < props.length; j++) {
- if (props.getClass() != Property.class) continue;
+ if (props[j].getClass() != Property.class) continue;
openTest(props[j], consCFG);
Object[] compProperties = new PropertyWorkbenchAdapter().getChildren(props[j]);
for (int k = 0; k < compProperties.length; k++) {
//test Composite properties
if (compProperties[k].getClass() != Property.class) continue;
- openPropertyTest((Property) props[j], (Property)compProperties[k], consCFG);
+ openPropertyTest((Property)compProperties[k], (Property) props[j], consCFG);
}
}
}
@@ -84,7 +84,9 @@
try {
editor = OpenMappingAction.run(compositeProperty, parentProperty, consCFG);
boolean highlighted = ProjectUtil.checkHighlighting(editor);
- if (!highlighted) fail("Highlighted region for " + compositeProperty.getNodeName() + " is empty.");
+ if (!highlighted)
+ fail("Highlighted region for property" + compositeProperty.getNodeName() + " is empty. (package "
+ + HibernateAllMappingTests.getActivePackage().getElementName() + ")");
Object[] compProperties = new PropertyWorkbenchAdapter().getChildren(compositeProperty);
for (int k = 0; k < compProperties.length; k++) {
//test Composite properties
@@ -100,8 +102,8 @@
ex = e;
}
if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Mapping file for " + compositeProperty.getNodeName()
- + " not opened:\n" + ex.getMessage());
+ if (ex != null) fail("Mapping file for property" + compositeProperty.getNodeName() + " not opened: (package "
+ + HibernateAllMappingTests.getActivePackage().getElementName() + ")\n" + ex.getMessage());
}
private void openTest(Object selection, ConsoleConfiguration consCFG){
@@ -110,7 +112,9 @@
try {
editor = OpenMappingAction.run(selection, consCFG);
boolean highlighted = ProjectUtil.checkHighlighting(editor);
- if (!highlighted) fail("Highlighted region for " + selection + " is empty.");
+ if (!highlighted)
+ fail("Highlighted region for " + selection + " is empty. (package "
+ + HibernateAllMappingTests.getActivePackage().getElementName() + ")");
} catch (PartInitException e) {
ex = e;
} catch (JavaModelException e) {
@@ -119,8 +123,8 @@
ex = e;
}
if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Mapping file for " + selection/*.getClassName()*/
- + " not opened:\n" + ex.getMessage());
+ if (ex != null) fail("Mapping file for " + selection + " not opened (package "
+ + HibernateAllMappingTests.getActivePackage().getElementName() + ") :\n" + ex.getMessage());
}
16 years, 12 months