JBoss Tools SVN: r20169 - trunk/documentation/guides/JBDS_3.0_Release_Notes/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2010-02-07 23:12:35 -0500 (Sun, 07 Feb 2010)
New Revision: 20169
Modified:
trunk/documentation/guides/JBDS_3.0_Release_Notes/en-US/Fixed_Issues.xml
Log:
adding more JIRA to the Release Notes
Modified: trunk/documentation/guides/JBDS_3.0_Release_Notes/en-US/Fixed_Issues.xml
===================================================================
--- trunk/documentation/guides/JBDS_3.0_Release_Notes/en-US/Fixed_Issues.xml 2010-02-08 00:00:04 UTC (rev 20168)
+++ trunk/documentation/guides/JBDS_3.0_Release_Notes/en-US/Fixed_Issues.xml 2010-02-08 04:12:35 UTC (rev 20169)
@@ -74,6 +74,16 @@
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-5427">JBIDE-5427</ulink>: In the ESB Editor, the items that displayed when right clicking and going to <menuchoice><guimenuitem>Provider</guimenuitem><guimenuitem>New</guimenuitem></menuchoice> were presented in a different order to those of the <menuchoice><guimenuitem>Listner</guimenuitem><guimenuitem>New</guimenuitem></menuchoice> list. To ensure consistency the <guimenuitem>Provider</guimenuitem> list of items has been reordered to match the <guimenuitem>Listner</guimenuitem> menu.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5229">JBIDE-5229</ulink>: ESB 4.7 that is contained within <application>JBoss SOA Platform 5.0</application> is now offically supported in this version of the <application>JBoss Developer Studio</application>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5191">JBIDE-5191</ulink>: The Smooks, Drools, jPDL, XSLT and Groovy editors have been linked to the ESB Editor, providing an improved user experience. <guibutton>Browse</guibutton> buttons that allow for file association and use have been added to the <property>Smooks Transformer</property>, <property>GroovyActionProcessor</property>, <property>Rule Set</property> and <property>Rule Language</property> properties.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara>
@@ -123,6 +133,11 @@
</itemizedlist>
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5222">JBIDE-5222</ulink>: A new feature as been added that allows for support of <guilabel>filter configurations in closed porjects</guilabel> for console configuration. This option is available through <menuchoice><guimenuitem>Preferences</guimenuitem><guimenuitem>Run/Debug</guimenuitem><guimenuitem>Launching</guimenuitem><guimenuitem>Launch Configurations</guimenuitem></menuchoice>.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara>
@@ -155,6 +170,11 @@
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-5277">JBIDE-5277</ulink>: The options to Add and Remove JSF support have been added to the project menu.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5670">JBIDE-5237</ulink>: CSS Class Hyperlink for the <property>class</property> attribute of HTML tags would not search through CSS loaded using JSF tags (for example: <a:loadStyle />). This has now been fixed so that the searching of CSS classes returns the correct user expected results.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara>
@@ -179,10 +199,54 @@
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-5275">JBIDE-5275</ulink>: The <guimenuitem>Add Seam Support</guimenuitem> and <guimenuitem>Remove Seam Support</guimenuitem> items have been added to the Project menu.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5221">JBIDE-5221</ulink>: The <guilabel>JBoss Server View</guilabel> has now been replaced with the <guilabel>Server View</guilabel> in the Seam perspective. This has occured out of the <guilabel>JBoss Server View</guilabel> being depricated.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5192">JBIDE-5192</ulink>: The name of the editor when using the <guilabel>Diagram Viewer</guilabel> was a concatenation of the names of the diagram entities, leading to a long name in some cases. This issue has been corrected by modifying the <filename>OrmDiagram.java</filename> and <filename>DiagramViewer.java</filename> files to display a name from the following three options (based on the number of entities):
+ <itemizedlist>
+ <listitem>
+ <para>
+ Console name: Entity name
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Console name: First Entity name and Second Entity name
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Console name: First Entity name and <number of other entities> others
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5170">JBIDE-5170</ulink>: When changing, adding or removing a Seam runtime from within <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Preferences</guimenuitem><guimenuitem>JBoss Tools</guimenuitem><guimenuitem>Web</guimenuitem><guimenuitem>Seam</guimenuitem></menuchoice>, Seam projects would not be built or validated. The behavior has been changed to build and validate Seam projects upon changes in the <guimenuitem>Preferences</guimenuitem> section to ensure correct functioning of the project. The <filename>SeamRuntimeManager.java</filename> file was updated to correct this.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara>
<formalpara>
+ <title>Smooks</title>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5275">JBIDE-5259</ulink>: The Smooks configuration has received a test facility through the modification of the <guibutton>Run</guibutton> button to output a java result to the <guilabel>Console</guilabel>. This allows a user to test Smooks projects in a simplified way.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </formalpara>
+ <formalpara>
<title>Struts</title>
<para>
<itemizedlist>
@@ -195,6 +259,60 @@
</para>
</formalpara>
<formalpara>
+ <title>Visual Page Editor</title>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5184">JBIDE-5184</ulink>: A memory leak existed in the Visual Page Editor. To fix this leak, the following plug-ins have been modified:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <filename>org.jboss.tools.vpe</filename>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <filename>org.jboss.tools.vpe.xulrunner</filename>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <filename>org.jboss.tools.jst.jsp</filename>
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ The issues that caused the memory leak were:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>JSPMultiPageEditorSite</emphasis>: The constructor created the <classname>serviceLocator</classname> that wasn't disposed of after use.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <methodname>XulRunnerBrowser.dispose()</methodname> method would remove the <classname>progressListener</classname>, however this would only be done after all SWT objects and controls were already disposed. This meant the method had no effect. The dispose method is now called before the SWT objects and controls are disposed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <methodname>MozillaEditor.getEditor()</methodname> madethe Mozilla window editable using <methodname>nsIEditingSession.setupEditorOnWindow()</methodname>. To counteract this the objects created are now removed by using <methodname>nsIEditingSession.tearDownEditorOnWindow()</methodname>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The <methodname>createPartControl()</methodname> method in the <classname>MozillaEditor</classname> and <classname>MozillaPreview</classname> classes create <classname>XullRunnerEditor</classname> as an inner class. The issue was that the <classname>XullRunnerEditor</classname> class retained a reference to <classname>MozillaEditor(MozillaPreview)</classname> that caused it not to be released and instead retain references to WST and EMF classes. This has now been corrected so that classname>MozillaEditor(MozillaPreview)</classname> is now released after use and referecnes are not retained.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </formalpara>
+ <formalpara>
<title>XML Structured Editor</title>
<para>
<itemizedlist>
@@ -225,6 +343,16 @@
<ulink url="http://jira.jboss.com/jira/browse/JBIDE-5690">JBIDE-5690</ulink>: The <guibutton>Full-Publish</guibutton> hotkey would only accept the first module and re-deploy it to the first server the module is deployed on. For the user this meant that if the module was already deployed on several servers, using <guibutton>Full-Publish</guibutton> would only re-deploy it to the first server returned in the list. To solve this issue a user interface has been added for the <guibutton>Full-Publish</guibutton> hotkey that allows for the selection of the server to re-deploy to. During the implementation of this fix, the package has been renamed to XPL.
</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5743">JBIDE-5267</ulink>: The <application>JBoss Enterprise Application Platform</application> server would start correctly, however the <application>JBoss Developer Studio</application> would not acknowledge that it had started. To counteract this the <filename>JMXPoller.java</filename> timeout behaviour has been modified to always return that the server succeeded in starting instead of ignoring the timeout. This fix ensures that a user is not informed that the server did not start correctly when it did.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://jira.jboss.com/jira/browse/JBIDE-5153">JBIDE-5153</ulink>: A <guilabel>JavaMain</guilabel> tab has been added to the tab group to allow for customization of the main class of the server. The changes to the main class are verified to persist by server startup checks.
+ </para>
+ </listitem>
</itemizedlist>
</para>
</formalpara>
16 years, 2 months
JBoss Tools SVN: r20168 - trunk/examples/plugins/org.jboss.tools.project.examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-02-07 19:00:04 -0500 (Sun, 07 Feb 2010)
New Revision: 20168
Removed:
trunk/examples/plugins/org.jboss.tools.project.examples/projectExamples.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5700 Simplify project examples update process
Deleted: trunk/examples/plugins/org.jboss.tools.project.examples/projectExamples.xml
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/projectExamples.xml 2010-02-07 23:54:50 UTC (rev 20167)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/projectExamples.xml 2010-02-08 00:00:04 UTC (rev 20168)
@@ -1,46 +0,0 @@
-<projects>
- <project>
- <category>Seam</category>
- <name>dvdstore</name>
- <shortDescription>Seam DVD Store Example</shortDescription>
- <description>This example demonstrates the use of Seam with jBPM pageflow and business process management. It runs on JBoss AS and Tomcat.</description>
- <size>10000000</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
- </url>
- </project>
-
- <project>
- <category>Portlet</category>
- <name>TestJavaPortlet</name>
- <shortDescription>JBoss Java Portlet Example</shortDescription>
- <description>This example demonstrates the use of JBoss Java Portlet. It runs on JBoss Portal 2.7.0.</description>
- <size>10000</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...
- </url>
- </project>
-
- <project>
- <category>Portlet</category>
- <name>TestJSFPortlet</name>
- <shortDescription>JBoss JSF Portlet Example</shortDescription>
- <description>This example demonstrates the use of JBoss JSF Portlet. It runs on JBoss Portal 2.7.0.</description>
- <size>4000000</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...
- </url>
- </project>
-
- <project>
- <category>Portlet</category>
- <name>TestSeamPortlet</name>
- <shortDescription>JBoss Seam Portlet Example</shortDescription>
- <description>This example demonstrates the use of JBoss Seam Portlet. It runs on JBoss Portal 2.7.0.</description>
- <size>10000000</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...
- </url>
- </project>
-
-</projects>
\ No newline at end of file
16 years, 2 months
JBoss Tools SVN: r20167 - trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-02-07 18:54:50 -0500 (Sun, 07 Feb 2010)
New Revision: 20167
Added:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/ProjectExamplesFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
workspace/examples/project-examples-3.1.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5700 Simplify project examples update process
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF 2010-02-07 23:03:31 UTC (rev 20166)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/META-INF/MANIFEST.MF 2010-02-07 23:54:50 UTC (rev 20167)
@@ -21,7 +21,11 @@
org.eclipse.wst.validation,
org.eclipse.ui.views,
org.eclipse.ui.cheatsheets,
- org.eclipse.jdt.core
+ org.eclipse.jdt.core,
+ org.eclipse.wst.server.core,
+ org.jboss.tools.seam.core,
+ org.eclipse.wst.common.project.facet.core,
+ org.jboss.tools.common
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Export-Package: org.jboss.tools.project.examples,
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2010-02-07 23:03:31 UTC (rev 20166)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -11,7 +11,9 @@
package org.jboss.tools.project.examples;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
+import java.util.StringTokenizer;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
@@ -26,6 +28,7 @@
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.validation.internal.operations.ValidationBuilder;
import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
import org.osgi.framework.BundleContext;
/**
@@ -154,4 +157,33 @@
}
return markers;
}
+
+ public static IProject[] getEclipseProject(Project project,
+ ProjectFix fix) {
+ String pName = fix.getProperties().get(
+ ProjectFix.ECLIPSE_PROJECTS);
+ if (pName == null) {
+ List<String> projectNames = project.getIncludedProjects();
+ List<IProject> projects = new ArrayList<IProject>();
+ for (String projectName:projectNames) {
+ IProject eclipseProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (eclipseProject != null && eclipseProject.isOpen()) {
+ projects.add(eclipseProject);
+ }
+ }
+ return projects.toArray(new IProject[0]);
+ }
+ StringTokenizer tokenizer = new StringTokenizer(pName,","); //$NON-NLS-1$
+ List<IProject> projects = new ArrayList<IProject>();
+ while (tokenizer.hasMoreTokens()) {
+ String projectName = tokenizer.nextToken().trim();
+ if (projectName != null && projectName.length() > 0) {
+ IProject eclipseProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (eclipseProject != null && eclipseProject.isOpen()) {
+ projects.add(eclipseProject);
+ }
+ }
+ }
+ return projects.toArray(new IProject[0]);
+ }
}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -0,0 +1,161 @@
+package org.jboss.tools.project.examples.dialog;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
+
+public class FixDialog extends Dialog {
+
+ private TableViewer tableViewer;
+ private List<ProjectFix> fixes;
+
+ public FixDialog(Shell parentShell, IStructuredSelection selection) {
+ super(parentShell);
+ Iterator iterator = selection.iterator();
+ fixes = new ArrayList<ProjectFix>();
+ while (iterator.hasNext()) {
+ Object object = iterator.next();
+ if (object instanceof Project) {
+ Project project = (Project) object;
+ fixes.addAll(project.getUnsatisfiedFixes());
+ }
+
+ }
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite area = (Composite) super.createDialogArea(parent);
+ Composite contents = new Composite(area, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 300;
+ contents.setLayoutData(gd);
+ contents.setLayout(new GridLayout());
+ getShell().setText("Fixes");
+ applyDialogFont(contents);
+ initializeDialogUnits(area);
+
+ Label fixesLabel = new Label(contents, SWT.NULL);
+ fixesLabel.setText("Fixes:");
+ tableViewer = new TableViewer(contents, SWT.H_SCROLL | SWT.V_SCROLL
+ | SWT.BORDER | SWT.SINGLE);
+ Table table = tableViewer.getTable();
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 100;
+ table.setLayoutData(gd);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ String[] columnNames = new String[] { "Type", "Short description" };
+ int[] columnWidths = new int[] { 200, 350 };
+
+ for (int i = 0; i < columnNames.length; i++) {
+ TableColumn tc = new TableColumn(table, SWT.LEFT);
+ tc.setText(columnNames[i]);
+ tc.setWidth(columnWidths[i]);
+ }
+
+ tableViewer.setLabelProvider(new FixLabelProvider());
+ tableViewer.setContentProvider(new FixContentProvider(fixes));
+ tableViewer.setInput(fixes);
+
+ Label descriptionLabel = new Label(contents, SWT.NONE);
+ descriptionLabel.setText("Description:");
+ final Text description = new Text(contents, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
+ gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
+ gd.heightHint=50;
+ description.setLayoutData(gd);
+
+ tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ description.setText(""); //$NON-NLS-1$
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ Object fix = ((IStructuredSelection) selection).getFirstElement();
+ if (fix instanceof ProjectFix) {
+ description.setText(((ProjectFix) fix).getProperties().get(ProjectFix.DESCRIPTION));
+ }
+ }
+ }
+
+ });
+
+ return area;
+ }
+
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
+ true);
+ }
+
+ private class FixLabelProvider extends LabelProvider implements
+ ITableLabelProvider {
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof ProjectFix) {
+ ProjectFix fix = (ProjectFix) element;
+ if (columnIndex == 0) {
+ return fix.getType();
+ }
+ if (columnIndex == 1) {
+ return fix.getProperties().get(ProjectFix.SHORT_DESCRIPTION);
+ }
+ }
+ return null;
+ }
+ }
+
+ private class FixContentProvider implements IStructuredContentProvider {
+
+ private List<ProjectFix> fixes;
+
+ public FixContentProvider(List<ProjectFix> fixes) {
+ this.fixes = fixes;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return fixes.toArray();
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ }
+
+}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -0,0 +1,31 @@
+package org.jboss.tools.project.examples.fixes;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
+import org.osgi.framework.Bundle;
+
+public class PluginFix implements ProjectExamplesFix {
+
+ public boolean canFix(Project project, ProjectFix fix) {
+ if (!ProjectFix.PLUGIN_TYPE.equals(fix.getType())) {
+ return false;
+ }
+ String symbolicName = fix.getProperties().get(ProjectFix.ID);
+ if (symbolicName == null) {
+ ProjectExamplesActivator.log("Invalid plugin fix in " + project.getName() + ".");
+ return true;
+ }
+ Bundle bundle = Platform.getBundle(symbolicName);
+ return bundle != null;
+ }
+
+ public boolean fix(Project project, ProjectFix fix,
+ IProgressMonitor monitor) {
+ // can't be fixed
+ return false;
+ }
+
+}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/ProjectExamplesFix.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/ProjectExamplesFix.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/ProjectExamplesFix.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -0,0 +1,11 @@
+package org.jboss.tools.project.examples.fixes;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
+
+public interface ProjectExamplesFix {
+
+ boolean canFix(Project project, ProjectFix fix);
+ boolean fix(Project project, ProjectFix fix, IProgressMonitor monitor);
+}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -0,0 +1,100 @@
+package org.jboss.tools.project.examples.fixes;
+
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.osgi.service.prefs.BackingStoreException;
+
+public class SeamRuntimeFix implements ProjectExamplesFix {
+
+ public boolean canFix(Project project, ProjectFix fix) {
+ if (!ProjectFix.SEAM_RUNTIME.equals(fix.getType())) {
+ return false;
+ }
+ return getBestRuntime(project, fix) != null;
+ }
+
+ private SeamRuntime getBestRuntime(Project project, ProjectFix fix) {
+ String allowedVersions = fix.getProperties().get(ProjectFix.ALLOWED_VERSIONS);
+ if (allowedVersions == null) {
+ ProjectExamplesActivator.log("Invalid Seam runtime fix in " + project.getName() + ".");
+ return null;
+ }
+ StringTokenizer tokenizer = new StringTokenizer(allowedVersions,","); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens()) {
+ String allowedVersion = tokenizer.nextToken().trim();
+ if (allowedVersion.length() <= 0) {
+ continue;
+ }
+ SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+ if (seamRuntimes == null) {
+ return null;
+ }
+ if (seamRuntimes.length > 0 && ProjectFix.ANY.equals(allowedVersion)) {
+ return seamRuntimes[0];
+ }
+ for (int i = 0; i < seamRuntimes.length; i++) {
+ SeamRuntime seamRuntime = seamRuntimes[i];
+ if (seamRuntime.getVersion().toString().equals(allowedVersion.substring(0, 3))) {
+ return seamRuntime;
+ }
+ }
+ }
+ return null;
+ }
+
+ public boolean fix(Project project, ProjectFix fix,
+ IProgressMonitor monitor) {
+ if (!canFix(project, fix)) {
+ return false;
+ }
+ IProject[] eclipseProjects = ProjectExamplesActivator.getEclipseProject(project, fix);
+ if (eclipseProjects.length == 0) {
+ return false;
+ }
+ boolean ret = true;
+ for (int i = 0; i < eclipseProjects.length; i++) {
+ IProject eclipseProject = eclipseProjects[i];
+ if (!fix(project, fix, eclipseProject)) {
+ ret = false;
+ }
+ }
+ return ret;
+ }
+
+ private boolean fix(Project project, ProjectFix fix,
+ IProject eclipseProject) {
+ IEclipsePreferences prefs = SeamCorePlugin.getSeamPreferences(eclipseProject);
+ String seamRuntimeName = prefs.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, null);
+ SeamRuntime[] seamRuntimes = SeamRuntimeManager.getInstance().getRuntimes();
+ if (seamRuntimeName != null) {
+ for (int i1 = 0; i1 < seamRuntimes.length; i1++) {
+ if (seamRuntimeName.equals(seamRuntimes[i1])) {
+ return true;
+ }
+ }
+ }
+ SeamRuntime seamRuntime = getBestRuntime(project, fix);
+ if (seamRuntime != null) {
+ prefs.put(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, seamRuntime.getName());
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ ProjectExamplesActivator.log(e);
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -0,0 +1,110 @@
+package org.jboss.tools.project.examples.fixes;
+
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
+
+public class WTPRuntimeFix implements ProjectExamplesFix {
+
+ public boolean canFix(Project project, ProjectFix fix) {
+ if (!ProjectFix.WTP_RUNTIME.equals(fix.getType())) {
+ return false;
+ }
+ return getBestRuntime(project, fix) != null;
+ }
+
+ public boolean fix(Project project, ProjectFix fix,
+ IProgressMonitor monitor) {
+ if (!canFix(project, fix)) {
+ return false;
+ }
+ IProject[] eclipseProjects = ProjectExamplesActivator.getEclipseProject(project, fix);
+ if (eclipseProjects.length == 0) {
+ return false;
+ }
+ boolean ret = true;
+ for (int i = 0; i < eclipseProjects.length; i++) {
+ IProject eclipseProject = eclipseProjects[i];
+ try {
+ IFacetedProject facetedProject = ProjectFacetsManager.create(eclipseProject);
+ org.eclipse.wst.common.project.facet.core.runtime.IRuntime wtpRuntime = facetedProject.getPrimaryRuntime();
+ if (wtpRuntime != null) {
+ IRuntime runtime = getRuntime(wtpRuntime);
+ if (runtime == null) {
+ runtime = getBestRuntime(project, fix);
+ if (runtime != null) {
+ facetedProject.removeTargetedRuntime(wtpRuntime, monitor);
+ wtpRuntime = RuntimeManager.getRuntime(runtime.getId());
+ facetedProject.addTargetedRuntime(wtpRuntime, monitor);
+ facetedProject.setPrimaryRuntime(wtpRuntime, monitor);
+ }
+ }
+ }
+ } catch (CoreException e) {
+ ProjectExamplesActivator.log(e);
+ ret = false;
+ }
+ }
+ return ret;
+ }
+
+ private IRuntime getBestRuntime(Project project, ProjectFix fix) {
+ String allowedTypes = fix.getProperties().get(
+ ProjectFix.ALLOWED_TYPES);
+ if (allowedTypes == null) {
+ ProjectExamplesActivator.log("Invalid WTP runtime fix in "
+ + project.getName() + ".");
+ return null;
+ }
+ StringTokenizer tokenizer = new StringTokenizer(allowedTypes, ","); //$NON-NLS-1$
+ while (tokenizer.hasMoreTokens()) {
+ String allowedType = tokenizer.nextToken().trim();
+ if (allowedType.length() <= 0) {
+ continue;
+ }
+ IRuntime[] runtimes = ServerCore.getRuntimes();
+ if (runtimes.length > 0
+ && ProjectFix.ANY.equals(allowedType)) {
+ return runtimes[0];
+ }
+ for (int i = 0; i < runtimes.length; i++) {
+ IRuntime runtime = runtimes[i];
+ IRuntimeType runtimeType = runtime.getRuntimeType();
+ if (runtimeType.getId().equals(allowedType)) {
+ return runtime;
+ }
+ }
+ }
+ return null;
+ }
+
+ private static IRuntime getRuntime(
+ org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime) {
+ if (runtime == null)
+ throw new IllegalArgumentException();
+
+ String id = runtime.getProperty("id"); //$NON-NLS-1$
+ if (id == null)
+ return null;
+
+ IRuntime[] runtimes = ServerCore.getRuntimes();
+ for (IRuntime r : runtimes) {
+ if (id.equals(r.getId()))
+ return r;
+ }
+
+ return null;
+ }
+}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2010-02-07 23:03:31 UTC (rev 20166)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -11,6 +11,7 @@
package org.jboss.tools.project.examples.model;
import java.math.BigDecimal;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -30,7 +31,10 @@
private String type;
private String welcomeURL;
private String site;
+ private List<ProjectFix> fixes = new ArrayList<ProjectFix>();
+ private List<ProjectFix> unsatisfiedFixes;
+
public Project() {
name=""; //$NON-NLS-1$
shortDescription=""; //$NON-NLS-1$
@@ -151,4 +155,20 @@
public void setSite(String site) {
this.site = site;
}
+
+ public List<ProjectFix> getFixes() {
+ return fixes;
+ }
+
+ public void setFixes(List<ProjectFix> fixes) {
+ this.fixes = fixes;
+ }
+
+ public List<ProjectFix> getUnsatisfiedFixes() {
+ return unsatisfiedFixes;
+ }
+
+ public void setUnsatisfiedFixes(List<ProjectFix> unsatisfiedFixes) {
+ this.unsatisfiedFixes = unsatisfiedFixes;
+ }
}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -0,0 +1,37 @@
+package org.jboss.tools.project.examples.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ProjectFix {
+
+ public final static String WTP_RUNTIME = "wtpruntime"; //$NON-NLS-1$
+ public final static String SEAM_RUNTIME = "seam"; //$NON-NLS-1$
+ public final static String DROOLS_RUNTIME = "drools"; //$NON-NLS-1$
+ public final static String PLUGIN_TYPE = "plugin"; //$NON-NLS-1$
+ public final static String ALLOWED_VERSIONS = "allowed-versions"; //$NON-NLS-1$
+ public final static String ECLIPSE_PROJECTS = "eclipse-projects"; //$NON-NLS-1$
+ public final static String ALLOWED_TYPES = "allowed-types"; //$NON-NLS-1$
+ public final static String ID = "id"; //$NON-NLS-1$
+ public final static String VERSION = "VERSION"; //$NON-NLS-1$
+ public final static String DESCRIPTION = "description"; //$NON-NLS-1$
+ public final static String SHORT_DESCRIPTION = "short-description"; //$NON-NLS-1$
+ public final static String ANY = "any"; //$NON-NLS-1$
+
+ private String type;
+ private Map<String,String> properties = new HashMap<String,String>();
+
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+ public void setProperties(Map<String, String> properties) {
+ this.properties = properties;
+ }
+
+}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2010-02-07 23:03:31 UTC (rev 20166)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -242,6 +242,10 @@
if (cNode.getNodeType() == Node.ELEMENT_NODE) {
Element child = (Element) cNode;
String nodeName = child.getNodeName();
+ if (nodeName.equals("fixes")) { //$NON-NLS-1$
+ parseFixes(project, child);
+ }
+
if (nodeName.equals("category")) { //$NON-NLS-1$
String value = getContent(child);
boolean found = false;
@@ -334,9 +338,52 @@
return list;
}
+ private static void parseFixes(Project project, Element node) {
+ NodeList children = node.getChildNodes();
+ int cLen = children.getLength();
+ for (int i = 0; i < cLen; i++) {
+ Node cNode = children.item(i);
+ if (cNode.getNodeType() == Node.ELEMENT_NODE) {
+ Element child = (Element) cNode;
+ String nodeName = child.getNodeName();
+ if (nodeName.equals("fix")) { //$NON-NLS-1$
+ parseFix(project,child);
+ }
+ }
+ }
+ }
+
+ private static void parseFix(Project project, Element node) {
+ String type = node.getAttribute("type"); //$NON-NLS-1$
+ if (type == null || type.trim().length() <= 0) {
+ ProjectExamplesActivator.log("Invalid fix.");
+ return;
+ }
+ ProjectFix fix = new ProjectFix();
+ fix.setType(type);
+ NodeList children = node.getChildNodes();
+ int cLen = children.getLength();
+ for (int i = 0; i < cLen; i++) {
+ Node cNode = children.item(i);
+ if (cNode.getNodeType() == Node.ELEMENT_NODE) {
+ Element child = (Element) cNode;
+ String nodeName = child.getNodeName();
+ if (nodeName.equals("property")) { //$NON-NLS-1$
+ String name = child.getAttribute("name"); //$NON-NLS-1$
+ if (name == null || name.trim().length() <= 0) {
+ ProjectExamplesActivator.log("Invalid property.");
+ return;
+ }
+ String value = getContent(child);
+ fix.getProperties().put(name, value);
+ }
+ }
+ }
+ project.getFixes().add(fix);
+ }
+
private static String getProjectExamplesXml() {
- String projectXML = System
- .getProperty("org.jboss.tools.project.examples.xml"); //$NON-NLS-1$
+ String projectXML = System.getProperty("org.jboss.tools.project.examples.xml"); //$NON-NLS-1$
if (projectXML != null && projectXML.length() > 0) {
return projectXML;
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2010-02-07 23:03:31 UTC (rev 20166)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -73,7 +73,10 @@
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.dialog.MarkerDialog;
+import org.jboss.tools.project.examples.fixes.SeamRuntimeFix;
+import org.jboss.tools.project.examples.fixes.WTPRuntimeFix;
import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
import org.jboss.tools.project.examples.model.ProjectUtil;
public class NewProjectExamplesWizard extends Wizard implements INewWizard {
@@ -155,7 +158,9 @@
setName(Messages.NewProjectExamplesWizard_Importing);
for (Project project : projects) {
importProject(project, files.get(i++), monitor);
+ fix(project, monitor);
}
+
} catch (final Exception e) {
Display.getDefault().syncExec(new Runnable() {
@@ -305,6 +310,19 @@
});
}
+ public static void fix(Project project, IProgressMonitor monitor) {
+ List<ProjectFix> fixes = project.getFixes();
+ for (ProjectFix fix:fixes) {
+ if (ProjectFix.WTP_RUNTIME.equals(fix.getType())) {
+ new WTPRuntimeFix().fix(project, fix, monitor);
+ }
+ if (ProjectFix.SEAM_RUNTIME.equals(fix.getType())) {
+ new SeamRuntimeFix().fix(project, fix, monitor);
+ }
+ }
+ }
+
+
public static void importProject(Project projectDescription, File file,
IProgressMonitor monitor) throws Exception {
if (projectDescription.getIncludedProjects() == null) {
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2010-02-07 23:03:31 UTC (rev 20166)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2010-02-07 23:54:50 UTC (rev 20167)
@@ -11,12 +11,15 @@
package org.jboss.tools.project.examples.wizard;
-import java.util.HashSet;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import java.util.StringTokenizer;
import java.util.TreeSet;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -39,13 +42,24 @@
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.dialogs.FilteredTree;
-import org.eclipse.ui.internal.dialogs.WizardPatternFilter;
import org.eclipse.ui.model.AdaptableList;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.ServerCore;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.dialog.FixDialog;
+import org.jboss.tools.project.examples.fixes.PluginFix;
+import org.jboss.tools.project.examples.fixes.SeamRuntimeFix;
+import org.jboss.tools.project.examples.fixes.WTPRuntimeFix;
import org.jboss.tools.project.examples.model.Category;
import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectFix;
import org.jboss.tools.project.examples.model.ProjectUtil;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.osgi.framework.Bundle;
/**
* @author snjeza
@@ -56,6 +70,11 @@
private IStructuredSelection selection;
private Button showQuickFixButton;
private Combo siteCombo;
+ private Text noteText;
+ private Button details;
+ private PageBook notesPageBook;
+ private Composite noteEmptyComposite;
+ private Composite noteComposite;
public NewProjectExamplesWizardPage() {
super("org.jboss.tools.project.examples"); //$NON-NLS-1$
@@ -167,6 +186,27 @@
Object object = iterator.next();
if (object instanceof Project) {
canFinish=true;
+ Project project = (Project) object;
+ if (project.getUnsatisfiedFixes() == null) {
+ List<ProjectFix> fixes = project.getFixes();
+ List<ProjectFix> unsatisfiedFixes = new ArrayList<ProjectFix>();
+ project.setUnsatisfiedFixes(unsatisfiedFixes);
+ for (ProjectFix fix:fixes) {
+ if (!canFix(project, fix)) {
+ unsatisfiedFixes.add(fix);
+ }
+ }
+ }
+ if (project.getUnsatisfiedFixes().size() > 0) {
+ notesPageBook.showPage(noteComposite);
+ noteComposite.setVisible(true);
+ noteEmptyComposite.setVisible(false);
+ } else {
+ notesPageBook.showPage(noteEmptyComposite);
+ noteComposite.setVisible(false);
+ noteEmptyComposite.setVisible(true);
+ }
+
} else {
canFinish=false;
break;
@@ -177,6 +217,49 @@
});
+ notesPageBook = new PageBook( internal , SWT.NONE );
+ notesPageBook.setLayout(new GridLayout(1,false));
+ gd=new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan=2;
+ notesPageBook.setLayoutData( gd );
+
+ noteEmptyComposite = new Composite( notesPageBook, SWT.NONE );
+ noteEmptyComposite.setLayout( new GridLayout(1, false));
+ //notesEmptyComposite.setVisible( false );
+ gd=new GridData(GridData.FILL_HORIZONTAL);
+ noteEmptyComposite.setLayoutData(gd);
+
+ noteComposite = new Composite(notesPageBook, SWT.NONE);
+ noteComposite.setLayout(new GridLayout(2,false));
+ //notesComposite.setText("Note");
+ gd=new GridData(GridData.FILL_HORIZONTAL);
+ noteComposite.setLayoutData(gd);
+ noteComposite.setVisible(false);
+
+ notesPageBook.showPage(noteEmptyComposite);
+
+ Label noteLabel = new Label(noteComposite,SWT.NONE);
+ gd=new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ noteLabel.setText("Note:");
+ noteLabel.setLayoutData(gd);
+ noteText = new Text(noteComposite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.READ_ONLY);
+ noteText.setText(""); //$NON-NLS-1$
+ gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
+ gd.heightHint=50;
+ noteText.setLayoutData(gd);
+ noteText.setText("You could face a problem when importing this project example. For more details click the Details button.");
+
+ details = new Button(noteComposite, SWT.PUSH);
+ details.setText("Details...");
+ details.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Dialog dialog = new FixDialog(getShell(), getSelection());
+ dialog.open();
+ }
+ });
+
showQuickFixButton = new Button(internal,SWT.CHECK);
showQuickFixButton.setText(Messages.NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog);
showQuickFixButton.setSelection(true);
@@ -221,6 +304,23 @@
setControl(composite);
}
+ private boolean canFix(Project project,ProjectFix fix) {
+ String type = fix.getType();
+ if (ProjectFix.PLUGIN_TYPE.equals(type)) {
+ return new PluginFix().canFix(project, fix);
+ }
+
+ if (ProjectFix.WTP_RUNTIME.equals(type)) {
+ return new WTPRuntimeFix().canFix(project, fix);
+ }
+
+ if (ProjectFix.SEAM_RUNTIME.equals(type)) {
+ return new SeamRuntimeFix().canFix(project, fix);
+ }
+ ProjectExamplesActivator.log("Invalid fix in " + project.getName() + ".");
+ return true;
+ }
+
private void refresh(final TreeViewer viewer) {
AdaptableList input = new AdaptableList(getCategories());
viewer.setInput(input);
Modified: workspace/examples/project-examples-3.1.xml
===================================================================
--- workspace/examples/project-examples-3.1.xml 2010-02-07 23:03:31 UTC (rev 20166)
+++ workspace/examples/project-examples-3.1.xml 2010-02-07 23:54:50 UTC (rev 20167)
@@ -135,7 +135,6 @@
</fix>
<fix type="seam">
- <!-- support version ranges ? -->
<property name="allowed-versions">2.2.0</property>
<property name="short-description">Missing Seam Runtime</property>
<property name="eclipse-projects">booking22</property>
16 years, 2 months
JBoss Tools SVN: r20166 - workspace/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-02-07 18:03:31 -0500 (Sun, 07 Feb 2010)
New Revision: 20166
Modified:
workspace/examples/project-examples-3.1.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-1070 Clean up project examples locations
Modified: workspace/examples/project-examples-3.1.xml
===================================================================
--- workspace/examples/project-examples-3.1.xml 2010-02-07 22:28:17 UTC (rev 20165)
+++ workspace/examples/project-examples-3.1.xml 2010-02-07 23:03:31 UTC (rev 20166)
@@ -126,6 +126,28 @@
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
</url>
<welcome type="cheatsheets" url="/booking22/cheatsheets/booking.xml"/>
+ <fixes>
+ <fix type="wtpruntime">
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50</property>
+ <property name="short-description">Missing WTP Runtime</property>
+ <property name="eclipse-projects">booking22,booking22-ejb,booking22-ear</property>
+ <property name="description">This project example requires the JBoss EAP 5.0</property>
+ </fix>
+
+ <fix type="seam">
+ <!-- support version ranges ? -->
+ <property name="allowed-versions">2.2.0</property>
+ <property name="short-description">Missing Seam Runtime</property>
+ <property name="eclipse-projects">booking22</property>
+ <property name="description">This project example requires Seam version 2.2.0</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.testng.eclipse</property>
+ <property name="versions">5.8.0, 5.9.0</property>
+ <property name="short-description">Missing TestNG plugin</property>
+ <property name="description">The TestNG plugin is required if you want to run Seam tests. You can install it using the following update site: http://beust.com/eclipse</property>
+ </fix>
+ </fixes>
</project>
<project>
16 years, 2 months
JBoss Tools SVN: r20165 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-02-07 17:28:17 -0500 (Sun, 07 Feb 2010)
New Revision: 20165
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5218, testNoDefaultLocaleForSeveralFViews() was commented for further correction.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java 2010-02-07 21:26:51 UTC (rev 20164)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/TestFViewLocaleAttribute_JBIDE5218.java 2010-02-07 22:28:17 UTC (rev 20165)
@@ -184,7 +184,7 @@
closeEditors();
}
- public void testNoDefaultLocaleForSeveralFViews() throws Throwable {
+ public void _testNoDefaultLocaleForSeveralFViews() throws Throwable {
VpeController controller = openInVpe(
JsfAllTests.IMPORT_JSF_LOCALES_PROJECT_NAME, NO_DEFLOC_SEVERAL_FVIEWS_PAGE);
nsIDOMDocument doc = controller.getXulRunnerEditor().getDOMDocument();
@@ -203,7 +203,7 @@
localeText = doc.getElementById(LOCALE_TEXT3_ID);
localizedText = getLocalizedText(localeText);
- assertTrue("Text is '"+localizedText+"', but should be in 'default' locale", HELLO_EN.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Text is '"+localizedText+"', but should be in 'en_US' locale", HELLO_EN_US.equalsIgnoreCase(localizedText)); //$NON-NLS-1$ //$NON-NLS-2$
localeText = doc.getElementById(LOCALE_TEXT_ID);
localizedText = getLocalizedText(localeText);
16 years, 2 months
JBoss Tools SVN: r20164 - in trunk/jsf: tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-02-07 16:26:51 -0500 (Sun, 07 Feb 2010)
New Revision: 20164
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml.xml
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5768 rich:datatable template has been fixed, now it is processing footer
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2010-02-07 20:46:14 UTC (rev 20163)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2010-02-07 21:26:51 UTC (rev 20164)
@@ -91,7 +91,7 @@
}
// Encode Footer
- Element footer = ComponentUtil.getFacet(sourceElement, RichFaces.NAME_FACET_FOOTER);
+ Node footer = ComponentUtil.getFacet((Element)sourceElement, RichFaces.NAME_FACET_FOOTER,true);
final boolean hasColumnWithFooter = hasColumnWithFacet(columns, RichFaces.NAME_FACET_FOOTER);
if (footer != null || hasColumnWithFooter) {
nsIDOMElement tfoot = visualDocument.createElement(HTML.TAG_TFOOT);
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml 2010-02-07 21:26:51 UTC (rev 20164)
@@ -0,0 +1,17 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <html>
+ <head>
+ <title>header footer don't render</title>
+ </head>
+ <body>
+ <rich:dataTable id="footerIsMissing" border="1">
+ <f:facet name="header">HEADER</f:facet>
+ <f:facet name="footer">FOOTER</f:facet>
+ </rich:dataTable>
+ </body>
+ </html>
+</ui:composition>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/richDataTableFooterIsMissing.xhtml.xml 2010-02-07 21:26:51 UTC (rev 20164)
@@ -0,0 +1,49 @@
+<tests>
+<test id="footerIsMissing">
+<TABLE BORDER="1" ID="footerIsMissing" CLASS="dr-table rich-table "
+ TITLE="rich:dataTable
+id: footerIsMissing
+border: 1">
+ <COLGROUP SPAN="0" TITLE="rich:dataTable
+id: footerIsMissing
+border: 1">
+ </COLGROUP>
+ <THEAD TITLE="rich:dataTable
+id: footerIsMissing
+border: 1">
+ <TR CLASS="dr-table-header rich-table-header "
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/"
+ TITLE="rich:dataTable
+id: footerIsMissing
+border: 1">
+ <TD CLASS="dr-table-headercell rich-table-headercell " COLSPAN="100"
+ SCOPE="colgroup" TITLE="rich:dataTable
+id: footerIsMissing
+border: 1">
+ <SPAN CLASS="vpe-text">
+ HEADER
+</SPAN>
+ </TD>
+ </TR>
+ </THEAD>
+ <TFOOT TITLE="rich:dataTable
+id: footerIsMissing
+border: 1">
+ <TR CLASS="dr-table-footer rich-table-footer "
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/"
+ TITLE="rich:dataTable
+id: footerIsMissing
+border: 1">
+ <TD CLASS="dr-table-footercell rich-table-footercell " COLSPAN="100"
+ SCOPE="colgroup" TITLE="rich:dataTable
+id: footerIsMissing
+border: 1">
+ <SPAN CLASS="vpe-text">
+ FOOTER
+</SPAN>
+ </TD>
+ </TR>
+ </TFOOT>
+</TABLE>
+</test>
+</tests>
16 years, 2 months
JBoss Tools SVN: r20163 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE: 5768 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-02-07 15:46:14 -0500 (Sun, 07 Feb 2010)
New Revision: 20163
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test-footer.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test-header.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test.xhtml
Log:
Test pages for https://jira.jboss.org/jira/browse/JBIDE-5768
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test-footer.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test-footer.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test-footer.xhtml 2010-02-07 20:46:14 UTC (rev 20163)
@@ -0,0 +1,5 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <f:facet name="footer">FOOTER</f:facet>
+</ui:composition>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test-header.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test-header.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test-header.xhtml 2010-02-07 20:46:14 UTC (rev 20163)
@@ -0,0 +1,5 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
+ <f:facet name="header">HEADER</f:facet>
+</ui:composition>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/5768/test.xhtml 2010-02-07 20:46:14 UTC (rev 20163)
@@ -0,0 +1,16 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:f="http://java.sun.com/jsf/core">
+<html><head><title>header footer don't render</title></head><body>
+<rich:dataTable id="footerIsMissing" border="1">
+ <f:facet name="header">HEADER</f:facet>
+ <f:facet name="footer">FOOTER</f:facet>
+</rich:dataTable><br/>
+<rich:dataTable id="headermIsMissingAsWell" border="1">
+ <ui:include src="test-header.xhtml"/>
+ <ui:include src="test-footer.xhtml"/>
+</rich:dataTable>
+</body></html>
+</ui:composition>
16 years, 2 months
JBoss Tools SVN: r20162 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-02-05 20:23:46 -0500 (Fri, 05 Feb 2010)
New Revision: 20162
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
Log:
revert changes for commit http://fisheye.jboss.org/changelog/JBossTools/?cs=20152 to keep build running
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2010-02-05 21:08:34 UTC (rev 20161)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/utils/tests/DriverDeleteTest.java 2010-02-06 01:23:46 UTC (rev 20162)
@@ -19,41 +19,28 @@
import java.io.Writer;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
import java.net.URL;
import java.net.URLClassLoader;
import java.security.AccessController;
import java.sql.Driver;
import java.security.PrivilegedAction;
-import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
-import java.util.Locale;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
import java.util.Vector;
-import java.util.jar.JarFile;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.apt.core.internal.JarClassLoader;
-import org.hibernate.console.ConsoleConfigClassLoader;
import org.hibernate.console.execution.DefaultExecutionContext;
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.test.HibernateConsoleTestPlugin;
import org.hibernate.eclipse.console.test.utils.GarbageCollectionUtil;
import org.hibernate.util.ReflectHelper;
-import com.mysql.jdbc.Messages;
-
-//import sun.reflect.FieldAccessor;
-
import junit.framework.TestCase;
/**
@@ -72,7 +59,6 @@
public static final String PUT_PATH = "res"; //$NON-NLS-1$
private WeakReference<ExecutionContext> executionContext = null;
- private ClassLoader prevClassLoader = null;
protected ClassLoader getParentClassLoader() {
return Thread.currentThread().getContextClassLoader();
@@ -218,61 +204,6 @@
return urlClassLoader;
}
- public ConsoleConfigClassLoader createJarClassLoader2() {
- final URL[] customClassPathURLs = getCustomClassPathURLs();
- ConsoleConfigClassLoader urlClassLoader = AccessController.doPrivileged(new PrivilegedAction<ConsoleConfigClassLoader>() {
- public ConsoleConfigClassLoader run() {
- return new ConsoleConfigClassLoader(customClassPathURLs, getParentClassLoader()) {
- public InputStream getResourceAsStream(String name) {
- InputStream is = super.getResourceAsStream(name);
- return is;
- }
-
- public URL findResource(final String name) {
- URL res = super.findResource(name);
- return res;
- }
-
- public Enumeration<URL> findResources(final String name) throws IOException {
- Enumeration<URL> res = super.findResources(name);
- return res;
- }
-
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- Class<?> res = null;
- try {
- res = super.findClass(name);
- } catch (ClassNotFoundException cnfe) {
- throw cnfe;
- }
- return res;
- }
-
- protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
- Class<?> res = null;
- try {
- res = super.loadClass(name, resolve);
- } catch (ClassNotFoundException cnfe) {
- throw cnfe;
- }
- return res;
- }
-
- public Class<?> loadClass(String name) throws ClassNotFoundException {
- Class<?> res = null;
- try {
- res = super.loadClass(name);
- } catch (ClassNotFoundException cnfe) {
- throw cnfe;
- }
- return res;
- }
- };
- }
- });
- return urlClassLoader;
- }
-
public class StringWriter extends Writer {
public String res = new String();
@@ -315,20 +246,12 @@
drivers = null;
}
- static Object testStaticObj;
-
- @SuppressWarnings({"unchecked", "unused", "nls"})
+ @SuppressWarnings("unchecked")
public void initExecutionContext() {
/**/
//URLClassLoader urlClassLoader = createClassLoader();
- //JarClassLoader urlClassLoader = createJarClassLoader();
- final ConsoleConfigClassLoader urlClassLoader = createJarClassLoader2();
- /** /
- prevClassLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(urlClassLoader);
- ClassLoader prevClassLoader22 = Thread.currentThread().getContextClassLoader();
- //
- Class<Driver> driverClass22 = null;
+ JarClassLoader urlClassLoader = createJarClassLoader();
+ /**/
Class<Driver> driverClass = null;
try {
driverClass = (Class<Driver>)urlClassLoader.loadClass("com.mysql.jdbc.Driver"); //$NON-NLS-1$
@@ -338,36 +261,21 @@
assertNotNull(driverClass);
/**/
int numRedDrivers = 0;
- //StringWriter wr = new StringWriter();
- //PrintWriter pw = new PrintWriter(wr);
- //DriverManager.setLogWriter(pw);
+ StringWriter wr = new StringWriter();
+ PrintWriter pw = new PrintWriter(wr);
+ DriverManager.setLogWriter(pw);
Driver driver = null;
- /** /
- Connection connection = null;
- String test = ""; //$NON-NLS-1$
+ /**/
try {
driver = driverClass.newInstance();
- //DriverManager.registerDriver(driver);
- //driverClass = ReflectHelper.classForName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
- //driver = driverClass.newInstance();
- //DriverManager.registerDriver(driver);
+ DriverManager.registerDriver(driver);
//DriverManager.deregisterDriver(driver);
java.util.Enumeration<Driver> drEnum = DriverManager.getDrivers();
while (drEnum.hasMoreElements()) {
driver = drEnum.nextElement();
-// DriverManager.deregisterDriver(driver);
+ DriverManager.deregisterDriver(driver);
numRedDrivers++;
}
- java.util.Properties info = new java.util.Properties();
- info.put("user", "root");
- info.put("password", "p@ssw0rd2");
- connection = driver.connect("jdbc:mysql://localhost:3306/jpa", info);
- //connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/jpa", "root", "p@ssw0rd");
- test = connection.getCatalog();
- connection.close();
- DriverManager.deregisterDriver(driver);
- //} catch (ClassNotFoundException e) {
- // e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} catch (InstantiationException e) {
@@ -375,23 +283,18 @@
} catch (IllegalAccessException e) {
e.printStackTrace();
}
- System.out.print(test);
- System.out.print(numRedDrivers);
- /** /
- System.out.print(wr.res);
/**/
+ System.out.print(wr.res);
+ /** /
DefaultExecutionContext dec = new DefaultExecutionContext(getName(), urlClassLoader);
executionContext = new WeakReference<ExecutionContext>(dec);
- /**/
+ /** /
ExecutionContext.Command command = new ExecutionContext.Command() {
public Object execute() {
try {
Class<Driver> driverClass = null;
- //Class.forName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
//if (driverClass != null) {
- driverClass = ReflectHelper.classForName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
- Driver driver2 = driverClass.newInstance();
- //DriverManager.registerDriver(driver2);
+ //driverClass = ReflectHelper.classForName("com.mysql.jdbc.Driver"); //$NON-NLS-1$
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
if (contextClassLoader != null) {
driverClass = (Class<Driver>)contextClassLoader.loadClass("com.mysql.jdbc.Driver"); //$NON-NLS-1$
@@ -400,184 +303,13 @@
//driverClass.newInstance();
//DriverManager.registerDriver(driverClass.newInstance());
//}
- java.util.Properties info = new java.util.Properties();
- info.put("user", "root");
- info.put("password", "p@ssw0rd2");
-
- /** /
- try {
- Connection connection = driver2.connect("jdbc:mysql://localhost:3306/jpa", info);
- //Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/jpa", "root", "p@ssw0rd"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- //String test = connection.getCatalog();
-
- //System.out.println(test);
- //System.out.println(test);
- connection.close();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- /**/
-
- Object obj = null;
- Field f = null;
-
- /**/
- Class<com.mysql.jdbc.Connection> connClass = ReflectHelper.classForName("com.mysql.jdbc.Connection"); //$NON-NLS-1$
- f = connClass.getDeclaredField("cancelTimer");
- f.setAccessible(true);
- java.util.Timer timer = (java.util.Timer)f.get(null);
- if (timer != null) {
- timer.cancel();
- timer.purge();
- }
- f.set(null, null);
-
- Class<com.mysql.jdbc.LoadBalancingConnectionProxy> classLoadBalancingConnectionProxyClass = ReflectHelper.classForName("com.mysql.jdbc.LoadBalancingConnectionProxy"); //$NON-NLS-1$
- f = classLoadBalancingConnectionProxyClass.getDeclaredField("getLocalTimeMethod");
- f.setAccessible(true);
- obj = f.get(null);
- f.set(null, null);
-
- Class<com.mysql.jdbc.StandardSocketFactory> classStandardSocketFactory = ReflectHelper.classForName("com.mysql.jdbc.StandardSocketFactory"); //$NON-NLS-1$
- f = classStandardSocketFactory.getDeclaredField("setTraficClassMethod");
- f.setAccessible(true);
- obj = f.get(null);
- f.set(null, null);
-
- Class<com.mysql.jdbc.StringUtils> classStringUtils = ReflectHelper.classForName("com.mysql.jdbc.StringUtils"); //$NON-NLS-1$
- f = classStringUtils.getDeclaredField("toPlainStringMethod");
- f.setAccessible(true);
- obj = f.get(null);
- f.set(null, null);
- /**/
-
- Class<com.mysql.jdbc.Util> classUtil = ReflectHelper.classForName("com.mysql.jdbc.Util"); //$NON-NLS-1$
- f = classUtil.getDeclaredField("systemNanoTimeMethod");
- f.setAccessible(true);
- obj = f.get(null);
- f.set(null, null);
- /** /
- //
- f = classUtil.getDeclaredField("DEFAULT_TIMEZONE");
- f.setAccessible(true);
- obj = f.get(null);
- setStaticFinalField(f, null);
- //
- f = classUtil.getDeclaredField("enclosingInstance");
- f.setAccessible(true);
- obj = f.get(null);
- f.set(null, null);
- /** /
- testStaticObj = Locale.getDefault();
- /**/
- ResourceBundle temp = ResourceBundle.getBundle("com.mysql.jdbc.LocalizedErrorMessages", Locale.getDefault(),
- urlClassLoader);
- /**/
- final String resName = "com.mysql.jdbc.LocalizedErrorMessages".replace('.', '/') + ".properties";
- InputStream stream = (InputStream)java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public Object run() {
- if (urlClassLoader != null) {
- return urlClassLoader.getResourceAsStream(resName);
- } else {
- return ClassLoader.getSystemResourceAsStream(resName);
- }
- }
- }
- );
-
- if (stream != null) {
- // make sure it is buffered
- stream = new java.io.BufferedInputStream(stream);
- java.util.PropertyResourceBundle prb = new PropertyResourceBundle(stream);
- stream.close();
- }
- //
- /**/
- //
- Class<com.mysql.jdbc.Messages> classMessages = ReflectHelper.classForName("com.mysql.jdbc.Messages"); //$NON-NLS-1$
- f = classMessages.getDeclaredField("BUNDLE_NAME");
- f.setAccessible(true);
- obj = f.get(null);
- setStaticFinalField(f, null);
- //
- f = classMessages.getDeclaredField("RESOURCE_BUNDLE");
- f.setAccessible(true);
- obj = f.get(null);
- setStaticFinalField(f, null);
- /**/
- //Class<java.util.ResourceBundle> classResourceBundle = ReflectHelper.classForName("java.util.ResourceBundle"); //$NON-NLS-1$
- //Class<java.util.PropertyResourceBundle> classPropertyResourceBundle = (Class<java.util.PropertyResourceBundle>)obj.getClass();
- Class<java.util.PropertyResourceBundle> classPropertyResourceBundle = (Class<java.util.PropertyResourceBundle>)temp.getClass();
- Class<java.util.ResourceBundle> classResourceBundle = (Class<ResourceBundle>)classPropertyResourceBundle.getSuperclass(); //$NON-NLS-1$
- f = classResourceBundle.getDeclaredField("cacheKey");
- f.setAccessible(true);
- obj = f.get(null);
- setStaticFinalField(f, null);
- //
- f = classResourceBundle.getDeclaredField("underConstruction");
- f.setAccessible(true);
- obj = f.get(null);
- setStaticFinalField(f, null);
- //
- f = classResourceBundle.getDeclaredField("NOT_FOUND");
- f.setAccessible(true);
- obj = f.get(null);
- setStaticFinalField(f, null);
- //
- f = classResourceBundle.getDeclaredField("cacheList");
- f.setAccessible(true);
- obj = f.get(null);
- setStaticFinalField(f, null);
- //
- f = classResourceBundle.getDeclaredField("referenceQueue");
- f.setAccessible(true);
- obj = f.get(null);
- setStaticFinalField(f, null);
- /**/
-
- /**/
- //Class<sun.net.www.protocol.jar.JarURLConnection> classJarURLConnection = ReflectHelper.classForName("sun.net.www.protocol.jar.JarURLConnection"); //$NON-NLS-1$
- //f = classJarURLConnection.getDeclaredField("factory");
- //f.setAccessible(true);
- //obj = f.get(null);
- //f.set(null, null);
- //
- Class classJarFileFactory = obj.getClass();
- f = classJarFileFactory.getDeclaredField("fileCache");
- f.setAccessible(true);
- obj = f.get(null);
- HashMap fileCache = (HashMap)obj;
- f.set(null, null);
- //
- f = classJarFileFactory.getDeclaredField("urlCache");
- f.setAccessible(true);
- obj = f.get(null);
- HashMap urlCache = (HashMap)obj;
- f.set(null, null);
- //
- Iterator it = urlCache.keySet().iterator();
- while (it.hasNext()) {
- JarFile jarFile = (JarFile)it.next();
- if (jarFile.getName().equals(DRIVER_TEST_NAME)) {
- jarFile.close();
- }
- }
- /**/
- //DriverManager.deregisterDriver(driver2);
//}
//contextClassLoader = null;
//driverClass = null;
- } catch (IOException e) {
- e.printStackTrace();
- } catch (SecurityException e) {
- e.printStackTrace();
- } catch (NoSuchFieldException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
+ //} catch (InstantiationException e) {
+ // e.printStackTrace();
+ //} catch (IllegalAccessException e) {
+ // e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
//} catch (SQLException e) {
@@ -601,26 +333,7 @@
urlClassLoader.close();
}
- private static final String MODIFIERS_FIELD = "modifiers";
-
- public static void setStaticFinalField(Field field, Object value)
- throws NoSuchFieldException, IllegalAccessException {
- /** /
- field.setAccessible(true);
- Field modifiersField = Field.class.getDeclaredField(MODIFIERS_FIELD);
- modifiersField.setAccessible(true);
- int modifiers = modifiersField.getInt(field);
- modifiers &= ~Modifier.FINAL;
- modifiersField.setInt(field, modifiers);
- sun.reflect.ReflectionFactory reflection =
- sun.reflect.ReflectionFactory.getReflectionFactory();
- FieldAccessor fa = reflection.newFieldAccessor(field, false);
- fa.set(null, value);
- /**/
- }
-
public void cleanupExecutionContext() {
- /** /
if (executionContext != null && executionContext.get() != null) {
executionContext.get().execute(new ExecutionContext.Command() {
@@ -643,12 +356,7 @@
});
executionContext = null;
}
- /**/
//
- if (prevClassLoader != null) {
- Thread.currentThread().setContextClassLoader(prevClassLoader);
- }
- //
GarbageCollectionUtil.forceCollectGarbage();
}
16 years, 2 months
JBoss Tools SVN: r20161 - in trunk/tests/tests/org.jboss.tools.tests: src/org/jboss/tools/tests and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-02-05 16:08:34 -0500 (Fri, 05 Feb 2010)
New Revision: 20161
Modified:
trunk/tests/tests/org.jboss.tools.tests/META-INF/MANIFEST.MF
trunk/tests/tests/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708
Modified: trunk/tests/tests/org.jboss.tools.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/tests/org.jboss.tools.tests/META-INF/MANIFEST.MF 2010-02-05 21:00:17 UTC (rev 20160)
+++ trunk/tests/tests/org.jboss.tools.tests/META-INF/MANIFEST.MF 2010-02-05 21:08:34 UTC (rev 20161)
@@ -9,6 +9,7 @@
org.eclipse.core.resources,
org.junit,
org.eclipse.ui.ide,
+ org.jboss.tools.jst.web.kb,
org.apache.xerces;bundle-version="[2.9.0,3.0.0)"
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.test.util,
Modified: trunk/tests/tests/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-02-05 21:00:17 UTC (rev 20160)
+++ trunk/tests/tests/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-02-05 21:08:34 UTC (rev 20161)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.jst.web.kb.validation.IValidator;
import org.jboss.tools.test.util.JUnitUtils;
/**
@@ -26,6 +27,8 @@
*/
public class AbstractResourceMarkerTest extends TestCase {
+ public static final String MARKER_TYPE = "org.eclipse.wst.validation.problemmarker";
+
/**
*
*/
@@ -39,7 +42,7 @@
super(name);
}
- protected int findMarkerLine(IResource resource, String type, String pattern)
+ public static int findMarkerLine(IResource resource, String type, String pattern)
throws CoreException {
int number = -1;
IMarker[] markers = findMarkers(resource, type, pattern);
@@ -50,7 +53,7 @@
return number;
}
- protected IMarker[] findMarkers(IResource resource, String type, String pattern) throws CoreException {
+ public static IMarker[] findMarkers(IResource resource, String type, String pattern) throws CoreException {
List<IMarker> result = new ArrayList<IMarker>();
IMarker[] markers = resource.findMarkers(type, true, IResource.DEPTH_INFINITE);
for (int i = 0; i < markers.length; i++) {
@@ -62,12 +65,11 @@
return result.toArray(new IMarker[0]);
}
- protected void assertMarkerIsCreated(IResource resource, MarkerData markerData) throws CoreException {
+ public static void assertMarkerIsCreated(IResource resource, MarkerData markerData) throws CoreException {
assertMarkerIsCreated(resource, markerData.type, markerData.pattern, markerData.line);
-
}
- protected void assertMarkerIsCreated(IResource resource, String type, String pattern, int expectedLine)
+ public static void assertMarkerIsCreated(IResource resource, String type, String pattern, int expectedLine)
throws CoreException {
int line = findMarkerLine(
@@ -80,26 +82,26 @@
expectedLine,line);
}
- protected void assertMarkerIsNotCreated(IResource resource, String type, String pattern) throws CoreException {
+ public static void assertMarkerIsNotCreated(IResource resource, String type, String pattern) throws CoreException {
IMarker[] markers = findMarkers(resource, type, pattern);
assertFalse("Marker matches the '" + pattern + "' pattern was found", markers.length>0); //$NON-NLS-1$ //$NON-NLS-2$
}
- protected void assertMarkerIsNotCreated(IResource resource, String type, String pattern, int expectedLine) throws CoreException {
+ public static void assertMarkerIsNotCreated(IResource resource, String type, String pattern, int expectedLine) throws CoreException {
int line = findMarkerLine(resource, type, pattern);
assertFalse("Marker matches the '" + pattern + "' pattern was found", line != -1); //$NON-NLS-1$ //$NON-NLS-2$
}
- protected void assertMarkerIsCreated(IResource resource, String type, String pattern) throws CoreException {
+ public static void assertMarkerIsCreated(IResource resource, String type, String pattern) throws CoreException {
IMarker[] markers = findMarkers(resource, type, pattern);
assertTrue("Marker matches the '" + pattern + "' pattern wasn't found", //$NON-NLS-1$ //$NON-NLS-2$
markers.length>0);
}
- protected void assertMarkersIsCreated(IResource resource, MarkerData[] markersData) throws CoreException {
+ public static void assertMarkersIsCreated(IResource resource, MarkerData[] markersData) throws CoreException {
for (MarkerData markerData : markersData) {
assertMarkerIsCreated(resource, markerData);
}
@@ -168,6 +170,26 @@
return numbers.toArray(new Integer[0]);
}
+ public static int getMarkersNumberByGroupName(IResource resource, String messageGroup) {
+ try{
+ IMarker[] markers = resource.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
+// for(int i=0;i<markers.length;i++){
+// System.out.println("Marker - "+markers[i].getAttribute(IMarker.MESSAGE, ""));
+// }
+ int length = markers.length;
+ for (int i = 0; i < markers.length; i++) {
+ String groupName = markers[i].getAttribute("groupName", null);
+ if(groupName==null || (!groupName.equals(messageGroup) && !groupName.equals(IValidator.MARKED_RESOURCE_MESSAGE_GROUP))) {
+ length--;
+ }
+ }
+ return length;
+ }catch(CoreException ex){
+ JUnitUtils.fail("Can'r get problem markers", ex);
+ }
+ return -1;
+ }
+
/**
*
* @author eskimo
16 years, 2 months
JBoss Tools SVN: r20160 - in trunk: cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-02-05 16:00:17 -0500 (Fri, 05 Feb 2010)
New Revision: 20160
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/lookup/typesafe/resolution/PetShop.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2708
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java 2010-02-05 21:00:11 UTC (rev 20159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICorePlugin.java 2010-02-05 21:00:17 UTC (rev 20160)
@@ -74,6 +74,20 @@
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+ /**
+ * Returns CDI project.
+ * @param project
+ * @param resolve
+ * @return
+ */
+ public static ICDIProject getCDIProject(IProject project, boolean resolve) {
+ CDICoreNature nature = getCDI(project, resolve);
+ if(nature!=null) {
+ return nature.getDelegate();
+ }
+ return null;
+ }
+
public static CDICoreNature getCDI(IProject project, boolean resolve) {
if(project == null || !project.exists() || !project.isOpen()) return null;
try {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-02-05 21:00:11 UTC (rev 20159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-02-05 21:00:17 UTC (rev 20160)
@@ -124,10 +124,7 @@
@Override
public void init(IProject project, ContextValidationHelper validationHelper, org.eclipse.wst.validation.internal.provisional.core.IValidator manager, IReporter reporter) {
super.init(project, validationHelper, manager, reporter);
-
- CDICoreNature nature = CDICorePlugin.getCDI(project, false);
- cdiProject = nature != null ? nature.getDelegate() : null;
-
+ cdiProject = CDICorePlugin.getCDIProject(project, false);
projectName = project.getName();
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2010-02-05 21:00:11 UTC (rev 20159)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2010-02-05 21:00:17 UTC (rev 20160)
@@ -16,9 +16,12 @@
public class CDIValidationErrorManager extends ValidationErrorManager {
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getPreference(org.eclipse.core.resources.IProject, java.lang.String)
+ */
@Override
protected String getPreference(IProject project, String preferenceKey) {
return CDIPreferences.getInstance().getProjectPreference(project, preferenceKey);
}
-
-}
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/lookup/typesafe/resolution/PetShop.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/lookup/typesafe/resolution/PetShop.java 2010-02-05 21:00:11 UTC (rev 20159)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/lookup/typesafe/resolution/PetShop.java 2010-02-05 21:00:17 UTC (rev 20160)
@@ -5,6 +5,9 @@
public class PetShop
{
+ @Produces
+ @Typed(String.class)
+ private Dove brokenProducer = new Dove("charlie");
@Produces @Typed(Dove.class)
private Dove dove = new Dove("charlie");
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2010-02-05 21:00:11 UTC (rev 20159)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/CDICoreAllTests.java 2010-02-05 21:00:17 UTC (rev 20160)
@@ -14,6 +14,7 @@
import junit.framework.TestSuite;
import org.jboss.tools.cdi.core.test.tck.DefinitionTest;
+import org.jboss.tools.cdi.core.test.tck.ValidationTest;
import org.jboss.tools.tests.AbstractPluginsLoadTest;
/**
@@ -24,6 +25,7 @@
public static Test suite() {
TestSuite suite = new TestSuite("CDI Core Tests");
suite.addTestSuite(DefinitionTest.class);
+ suite.addTestSuite(ValidationTest.class);
return suite;
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-02-05 21:00:11 UTC (rev 20159)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/TCKTest.java 2010-02-05 21:00:17 UTC (rev 20160)
@@ -7,6 +7,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
@@ -17,6 +18,7 @@
public class TCKTest extends TestCase {
protected static String PLUGIN_ID = "org.jboss.tools.cdi.core.test";
+ protected static String PROJECT_NAME = "tck";
protected static String PROJECT_PATH = "/projects/tck";
protected static String JAVA_SOURCE_SUFFIX = "/JavaSource";
@@ -32,8 +34,10 @@
public IProject importPreparedProject(String packPath) throws Exception {
Bundle b = Platform.getBundle(PLUGIN_ID);
-
- IProject project = ResourcesUtils.importProject(b, PROJECT_PATH);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
+ if(project==null || !project.exists()) {
+ project = ResourcesUtils.importProject(b, PROJECT_PATH);
+ }
String projectPath = project.getLocation().toOSString();
String resourcePath = FileLocator.resolve(b.getEntry(TCK_RESOURCES_PREFIX)).getFile();
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-02-05 21:00:17 UTC (rev 20160)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.core.test.tck;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ValidationTest extends TCKTest {
+
+ public void testLegalTypesInTyped() throws Exception {
+ IProject p = importPreparedProject("/lookup/typesafe/resolution");
+ IFile petShopFile = p.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(petShopFile, AbstractResourceMarkerTest.MARKER_TYPE, "Bean class or producer method or field specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean", 9);
+ int markerNumbers = getMarkersNumber(petShopFile);
+ assertEquals("PetShop.java should has the only error marker.", markerNumbers, 1);
+ // TODO
+ cleanProject("/lookup/typesafe/resolution");
+ }
+
+ public static int getMarkersNumber(IResource resource) {
+ return AbstractResourceMarkerTest.getMarkersNumberByGroupName(resource, null);
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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 2010-02-05 21:00:11 UTC (rev 20159)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2010-02-05 21:00:17 UTC (rev 20160)
@@ -44,7 +44,6 @@
IProject project = null;
- public static final String MARKER_TYPE = "org.eclipse.wst.validation.problemmarker";
public static SeamMarkerFilter SEAM_MARKER_FILTER = new SeamMarkerFilter();
public SeamValidatorsTest() {
@@ -180,14 +179,14 @@
public void testVarAttributes() throws CoreException {
// Test for http://jira.jboss.com/jira/browse/JBIDE-999
IFile file = project.getFile("WebContent/varAttributes.xhtml");
- int number = getMarkersNumber(file);
+ int number = getMarkersNumberByGroupName(file, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
assertEquals("Problem marker was found in varAttributes.xhtml file. Validator did not recognize 'var' attribute.", 0, number);
}
public void testMessageBundles() throws CoreException {
// Test for https://jira.jboss.org/jira/browse/JBIDE-5089
IFile file = project.getFile("WebContent/messagesValidation.jsp");
- int number = getMarkersNumber(file);
+ int number = getMarkersNumberByGroupName(file, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
assertEquals("Problem marker was found in messagesValidation.jsp file. Validator did not recognize a message bundle.", 0, number);
}
@@ -202,7 +201,7 @@
copyContentsFile(superclassComponentFile, "src/action/org/domain/SeamWebWarTestProject/session/SuperclassTestComponent.withRemove");
refreshProject(project);
- int number = getMarkersNumber(subclassComponentFile);
+ int number = getMarkersNumberByGroupName(subclassComponentFile, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
assertTrue("We changed super class of component but it still don't see changes.", number == 0);
}
@@ -459,7 +458,7 @@
public void testDuplicateRemoveMethodInComponent_Validator() {
getSeamProject(project);
IFile componentFile = project.getFile("src/action/org/domain/SeamWebWarTestProject/session/UsualComponent.java");
- int number = getMarkersNumber(componentFile);
+ int number = getMarkersNumberByGroupName(componentFile, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
assertEquals("Problem marker was found in UsualComponent.java file", 0, number);
}
@@ -760,6 +759,10 @@
JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, SeamPreferences.IGNORE);
}
+ public static int getMarkersNumber(IResource resource) {
+ return getMarkersNumberByGroupName(resource, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
+ }
+
private static boolean findLine(Integer[] lines, int number) {
for (int i = 0; i < lines.length; i++) {
if(lines[i]==number) {
@@ -806,26 +809,6 @@
}
}
- public static int getMarkersNumber(IResource resource){
- try{
- IMarker[] markers = resource.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
-// for(int i=0;i<markers.length;i++){
-// System.out.println("Marker - "+markers[i].getAttribute(IMarker.MESSAGE, ""));
-// }
- int length = markers.length;
- for (int i = 0; i < markers.length; i++) {
- String groupName = markers[i].getAttribute("groupName", null);
- if(groupName==null || (!groupName.equals(SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP) && !groupName.equals(IValidator.MARKED_RESOURCE_MESSAGE_GROUP))) {
- length--;
- }
- }
- return length;
- }catch(CoreException ex){
- JUnitUtils.fail("Can'r get problem markers", ex);
- }
- return -1;
- }
-
public static class SeamMarkerFilter implements IMarkerFilter {
public boolean accept(IMarker marker) {
String groupName = marker.getAttribute("groupName", null);
16 years, 2 months