JBoss Tools SVN: r8844 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-19 02:04:51 -0400 (Thu, 19 Jun 2008)
New Revision: 8844
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java
Log:
remove template variable
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java 2008-06-19 06:04:26 UTC (rev 8843)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ModelNature.java 2008-06-19 06:04:51 UTC (rev 8844)
@@ -79,7 +79,6 @@
}
private void createProject() {
-//@S_CHECK@
ClassLoaderUtil.init();
model = (XModel)models.get(project);
if(model != null) {
17 years, 10 months
JBoss Tools SVN: r8843 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-19 02:04:26 -0400 (Thu, 19 Jun 2008)
New Revision: 8843
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java
Log:
Exceptionn changed from Exception to IllegalArgumentException
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java 2008-06-19 06:03:18 UTC (rev 8842)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java 2008-06-19 06:04:26 UTC (rev 8843)
@@ -170,7 +170,7 @@
public void initialize(Object model) {
this.xmo = (XModelObject)model;
if(xmo == null) {
- ModelUIPlugin.getPluginLog().logInfo( "Error to create form "+formData.getHeader()+". Model object cannot be null.", new Exception());
+ ModelUIPlugin.getPluginLog().logInfo( "Error to create form "+formData.getHeader()+". Model object cannot be null.", new IllegalArgumentException("Parameter cannot be null"));
return;
}
this.model = xmo.getModel();
17 years, 10 months
JBoss Tools SVN: r8842 - in trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model: pv and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-19 02:03:18 -0400 (Thu, 19 Jun 2008)
New Revision: 8842
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFBeanSearcher.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFConstants.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectBeans.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java
Log:
coding style improved
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java 2008-06-19 05:59:11 UTC (rev 8841)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/FacesConfigLoader.java 2008-06-19 06:03:18 UTC (rev 8842)
@@ -210,7 +210,15 @@
class SFUtil extends XModelObjectLoaderUtil {
- static String[] folders = new String[]{"Components", "Converters", "Managed Beans", "Navigation Rules", "Referenced Beans", "Render Kits", "Validators", "Extensions"};
+ static String[] folders = new String[]{
+ JSFConstants.FOLDER_COMPONENTS,
+ JSFConstants.FOLDER_CONVERTERS,
+ JSFConstants.FOLDER_MANAGED_BEANS,
+ JSFConstants.FOLDER_NAVIGATION_RULES,
+ JSFConstants.FOLDER_REFENCED_BEANS,
+ JSFConstants.FOLDER_RENDER_KITS,
+ JSFConstants.FOLDER_VALIDATORS,
+ JSFConstants.FOLDER_EXTENSIONS};
protected Set<String> getAllowedChildren(XModelEntity entity) {
Set<String> children = super.getAllowedChildren(entity);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFConstants.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFConstants.java 2008-06-19 05:59:11 UTC (rev 8841)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFConstants.java 2008-06-19 06:03:18 UTC (rev 8842)
@@ -32,7 +32,14 @@
public static final String ENT_PROCESS_ITEM_OUTPUT = "JSFProcessItemOutput";
public static final String FOLDER_NAVIGATION_RULES = "Navigation Rules";
-
+ public static final String FOLDER_MANAGED_BEANS = "Managed Beans";
+ public static final String FOLDER_REFENCED_BEANS = "Referenced Beans";
+ public static final String FOLDER_COMPONENTS = "Components";
+ public static final String FOLDER_CONVERTERS = "Converters";
+ public static final String FOLDER_RENDER_KITS = "Render Kits";
+ public static final String FOLDER_VALIDATORS = "Validators";
+ public static final String FOLDER_EXTENSIONS = "Extensions";
+
public static final String ATT_ID = "id";
public static final String ATT_NAME = "name";
public static final String ATT_PATH = "path";
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFBeanSearcher.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFBeanSearcher.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFBeanSearcher.java 2008-06-19 06:03:18 UTC (rev 8842)
@@ -0,0 +1,76 @@
+package org.jboss.tools.jsf.model.pv;
+
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.jst.web.model.pv.WebProjectNode;
+
+public class JSFBeanSearcher {
+ WebProjectNode beans;
+ WebProjectNode conf;
+
+ XModelObject bean;
+ JSFProjectBean beanClass;
+ String property;
+
+ public JSFBeanSearcher(XModel model) {
+ WebProjectNode root = JSFProjectsTree.getProjectsRoot(model);
+ if(root == null) return;
+ beans = (WebProjectNode)root.getChildByPath("Beans");
+ conf = (WebProjectNode)root.getChildByPath("Configuration");
+ }
+
+ public void parse(String path) {
+ String[] a = toArray(path);
+ if(a.length == 0) return;
+ bean = JSFPromptingProvider.findBean(conf, a[0]);
+ beanClass = (JSFProjectBean)JSFPromptingProvider.findBeanClass(beans, bean);
+ if(bean == null || a.length < 2) return;
+ property = a[1];
+ for (int i = 1; i < a.length - 1; i++) {
+ if(!next()) return;
+ property = a[i + 1];
+ }
+ }
+
+ String[] toArray(String path) {
+ ArrayList<String> l = new ArrayList<String>();
+ StringTokenizer st = new StringTokenizer(path, ".");
+ while(st.hasMoreElements()) l.add(st.nextToken());
+ return l.toArray(new String[0]);
+ }
+
+ private boolean next() {
+ if(bean == null || beanClass == null || property == null) return false;
+ XModelObject p = beanClass.getChildByPath(property);
+ if(p == null) return false;
+ String cls = p.getAttributeValue("class name");
+ XModelObject b = JSFPromptingProvider.findBeanClassByClassName(beans, cls);
+ if(!(b instanceof JSFProjectBean)) {
+ b = JSFPromptingProvider.buildBean(p.getModel(), cls);
+ if(!(b instanceof JSFProjectBean)) return false;
+ }
+ beanClass = (JSFProjectBean)b;
+ XModelObject[] beanList = beanClass.getBeanList();
+ if(beanList.length > 0) {
+ bean = beanList[0];
+ }
+ //bean = beanList.length == 0 ? null : beanList[0];
+ return true;
+ }
+
+ public XModelObject getBean() {
+ return bean;
+ }
+
+ public XModelObject getBeanClass() {
+ return beanClass;
+ }
+
+ public String getProperty() {
+ return property;
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFBeanSearcher.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectBeans.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectBeans.java 2008-06-19 05:59:11 UTC (rev 8841)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFProjectBeans.java 2008-06-19 06:03:18 UTC (rev 8842)
@@ -23,6 +23,7 @@
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.impl.RegularObjectImpl;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.model.JSFConstants;
import org.jboss.tools.jst.web.model.pv.WebProjectNode;
public class JSFProjectBeans extends RegularObjectImpl implements WebProjectNode {
@@ -168,8 +169,8 @@
}
class BeanConstants {
- static BeanConstants MANAGED_BEAN_CONSTANTS = new BeanConstants("Managed Beans", "managed-bean-name", "managed-bean-class");
- static BeanConstants REFERENCED_BEAN_CONSTANTS = new BeanConstants("Referenced Beans", "referenced-bean-name", "referenced-bean-class");
+ static final BeanConstants MANAGED_BEAN_CONSTANTS = new BeanConstants(JSFConstants.FOLDER_MANAGED_BEANS, "managed-bean-name", "managed-bean-class");
+ static final BeanConstants REFERENCED_BEAN_CONSTANTS = new BeanConstants(JSFConstants.FOLDER_REFENCED_BEANS, "referenced-bean-name", "referenced-bean-class");
String folder;
String nameAttribute;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java 2008-06-19 05:59:11 UTC (rev 8841)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/pv/JSFPromptingProvider.java 2008-06-19 06:03:18 UTC (rev 8842)
@@ -34,9 +34,11 @@
import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
public class JSFPromptingProvider implements IWebPromptingProvider {
+
+ public final String PROVIDER_ID = "jsf";
public boolean isSupporting(String id) {
- return id != null && id.startsWith("jsf");
+ return id != null && id.startsWith(PROVIDER_ID);
}
public List<Object> getList(XModel model, String id, String prefix, Properties properties) {
@@ -298,7 +300,7 @@
JSFProjectsRoot root = JSFProjectsTree.getProjectsRoot(model);
if(root == null) return false;
- BeanSearcher s = new BeanSearcher(model);
+ JSFBeanSearcher s = new JSFBeanSearcher(model);
s.parse(prefix);
XModelObject bean = s.getBeanClass();
String property = s.getProperty();
@@ -409,71 +411,3 @@
}
}
-
-class BeanSearcher {
- WebProjectNode beans;
- WebProjectNode conf;
-
- XModelObject bean;
- JSFProjectBean beanClass;
- String property;
-
- public BeanSearcher(XModel model) {
- WebProjectNode root = JSFProjectsTree.getProjectsRoot(model);
- if(root == null) return;
- beans = (WebProjectNode)root.getChildByPath("Beans");
- conf = (WebProjectNode)root.getChildByPath("Configuration");
- }
-
- public void parse(String path) {
- String[] a = toArray(path);
- if(a.length == 0) return;
- bean = JSFPromptingProvider.findBean(conf, a[0]);
- beanClass = (JSFProjectBean)JSFPromptingProvider.findBeanClass(beans, bean);
- if(bean == null || a.length < 2) return;
- property = a[1];
- for (int i = 1; i < a.length - 1; i++) {
- if(!next()) return;
- property = a[i + 1];
- }
- }
-
- String[] toArray(String path) {
- ArrayList<String> l = new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(path, ".");
- while(st.hasMoreElements()) l.add(st.nextToken());
- return l.toArray(new String[0]);
- }
-
- private boolean next() {
- if(bean == null || beanClass == null || property == null) return false;
- XModelObject p = beanClass.getChildByPath(property);
- if(p == null) return false;
- String cls = p.getAttributeValue("class name");
- XModelObject b = JSFPromptingProvider.findBeanClassByClassName(beans, cls);
- if(!(b instanceof JSFProjectBean)) {
- b = JSFPromptingProvider.buildBean(p.getModel(), cls);
- if(!(b instanceof JSFProjectBean)) return false;
- }
- beanClass = (JSFProjectBean)b;
- XModelObject[] beanList = beanClass.getBeanList();
- if(beanList.length > 0) {
- bean = beanList[0];
- }
- //bean = beanList.length == 0 ? null : beanList[0];
- return true;
- }
-
- public XModelObject getBean() {
- return bean;
- }
-
- public XModelObject getBeanClass() {
- return beanClass;
- }
-
- public String getProperty() {
- return property;
- }
-
-}
17 years, 10 months
JBoss Tools SVN: r8841 - in trunk/vpe/tests/org.jboss.tools.vpe.test: src/org/jboss/tools/vpe/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-19 01:59:11 -0400 (Thu, 19 Jun 2008)
New Revision: 8841
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplatesExpressionParsingTest.java
trunk/vpe/tests/org.jboss.tools.vpe.test/testFailure-plugin.xml
trunk/vpe/tests/org.jboss.tools.vpe.test/testOk-plugin.xml
Log:
fix NullPointerException in test
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplatesExpressionParsingTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplatesExpressionParsingTest.java 2008-06-19 05:57:16 UTC (rev 8840)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/TemplatesExpressionParsingTest.java 2008-06-19 05:59:11 UTC (rev 8841)
@@ -93,6 +93,20 @@
}
/**
+ * Creates test template and testing possible(without errors) variants
+ *
+ * @throws Exception
+ */
+ public void testCorrectTemplates() throws Exception {
+ createTemplatesForTesting(PLUGIN_OK_NAME);
+ vpeTemplateManager = VpeTemplateManager.getInstance();
+ vpeTemplateManager.reload();
+ assertNull("Can not parse template from ReDHat DevStudio" + iStatus, iStatus);
+ assertEquals("There exist some errors", 0, errorNumber);
+ return;
+ }
+
+ /**
* Creates test template and testing that extensions with errors have errors
* variants
*
@@ -109,19 +123,6 @@
return;
}
- /**
- * Creates test template and testing possible(without errors) variants
- *
- * @throws Exception
- */
- public void testCorrectTemplates() throws Exception {
- createTemplatesForTesting(PLUGIN_OK_NAME);
- vpeTemplateManager = VpeTemplateManager.getInstance();
- vpeTemplateManager.reload();
- assertNull("Can not parse template from ReDHat DevStudio" + iStatus, iStatus);
- assertEquals("There exist some errors", 0, errorNumber);
- return;
- }
/**
* Tests passible template
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/testFailure-plugin.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/testFailure-plugin.xml 2008-06-19 05:57:16 UTC (rev 8840)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/testFailure-plugin.xml 2008-06-19 05:59:11 UTC (rev 8841)
@@ -2,7 +2,7 @@
<?eclipse version="3.2"?>
<!-- This plugin contains test templates for which test must failed -->
<plugin>
- <extension id="org.jboss.tools.vpe.tests.failureExtensions"
+ <extension
point="org.jboss.tools.vpe.templates">
<templates
name="Test1"
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/testOk-plugin.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/testOk-plugin.xml 2008-06-19 05:57:16 UTC (rev 8840)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/testOk-plugin.xml 2008-06-19 05:59:11 UTC (rev 8841)
@@ -2,7 +2,7 @@
<?eclipse version="3.2"?>
<!-- This plugin contains test for which test must be successful -->
<plugin>
- <extension id="org.jboss.tools.vpe.tests.okExtensions"
+ <extension
point="org.jboss.tools.vpe.templates">
<templates
name="Test3"
17 years, 10 months
JBoss Tools SVN: r8840 - in trunk/seam/tests/org.jboss.tools.seam.core.test: projects/Test1/.settings and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-19 01:57:16 -0400 (Thu, 19 Jun 2008)
New Revision: 8840
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.classpath
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.settings/org.eclipse.jst.common.project.facet.core.prefs
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
Log:
fix seam 2.0.0 related errors
base classes were adjusted
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.classpath
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.classpath 2008-06-19 05:53:36 UTC (rev 8839)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.classpath 2008-06-19 05:57:16 UTC (rev 8840)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.5.0_06"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.settings/org.eclipse.jst.common.project.facet.core.prefs 2008-06-19 05:53:36 UTC (rev 8839)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/.settings/org.eclipse.jst.common.project.facet.core.prefs 2008-06-19 05:57:16 UTC (rev 8840)
@@ -1,3 +1,3 @@
#Tue Aug 28 17:17:16 MSD 2007
-classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:jre1.5.0_06/owners=jst.java\:5.0
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER/owners=jst.java\:5.0
eclipse.preferences.version=1
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2008-06-19 05:53:36 UTC (rev 8839)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2008-06-19 05:57:16 UTC (rev 8840)
@@ -39,7 +39,13 @@
protected static final IWorkspace ws = ResourcesPlugin.getWorkspace();
private SeamRuntime seamRuntime;
+
protected static final String SEAM_1_2_0 = "Seam 1.2.0";
+ protected static final String SEAM_2_0_0 = "Seam 2.0.0";
+
+ protected static final String SEAM_1_2_HOME = "jbosstools.test.seam.1.2.1.eap.home";
+ protected static final String SEAM_2_0_HOME = "jbosstools.test.seam.2.0.1.GA.home";
+
protected static final IProjectFacetVersion seamFacetVersion;
protected static final IProjectFacetVersion dynamicWebVersion;
protected static final IProjectFacetVersion javaVersion;
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2008-06-19 05:53:36 UTC (rev 8839)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2008-06-19 05:57:16 UTC (rev 8840)
@@ -38,8 +38,6 @@
IFacetedProject warProject;
IFacetedProject earProject;
-
-
private IProjectFacet seam2Facet;
private IProjectFacetVersion seam2FacetVersion;
@@ -47,7 +45,6 @@
super(name);
}
-
@Override
protected void setUp() throws Exception {
assertSeamHomeAvailable();
@@ -73,7 +70,7 @@
@Override
protected File getSeamHomeFolder() {
- return new File(System.getProperty("jbosstools.test.seam.2.0.0.home", "/home/max/work/products/jboss-seam-2.0.0.GA"));
+ return new File(System.getProperty("jbosstools.test.seam.2.0.1.GA.home"));
}
@Override
17 years, 10 months
JBoss Tools SVN: r8839 - in trunk/seam/tests/org.jboss.tools.seam.ui.test: src/org/jboss/tools/seam/ui/test and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-19 01:53:36 -0400 (Thu, 19 Jun 2008)
New Revision: 8839
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
Log:
fix seam 2.0.0 related errors
duplicated code removed, now all tests uses base classes ffrom seam.core.test plugin
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/META-INF/MANIFEST.MF 2008-06-19 05:53:36 UTC (rev 8839)
@@ -39,6 +39,10 @@
org.eclipse.jdt.ui,
org.jboss.tools.vpe.ui.test;bundle-version="1.0.0"
Export-Package: org.jboss.tools.seam.ui.test,
+ org.jboss.tools.seam.ui.test.ca,
+ org.jboss.tools.seam.ui.test.hyperlink,
+ org.jboss.tools.seam.ui.test.jbide,
+ org.jboss.tools.seam.ui.test.preferences,
org.jboss.tools.seam.ui.test.view,
org.jboss.tools.seam.ui.test.wizard
Bundle-ClassPath: seam-ui.jar
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -14,7 +14,6 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.tools.seam.core.test.refactoring.SeamPropertyRefactoringTest;
import org.jboss.tools.seam.ui.test.ca.SeamELContentAssistJbide1645Test;
import org.jboss.tools.seam.ui.test.ca.SeamELContentAssistJbide1676Test;
import org.jboss.tools.seam.ui.test.ca.SeamELContentAssistTest;
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -10,6 +10,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@@ -42,17 +43,10 @@
return new TestSuite(SeamELContentAssistTest.class);
}
- public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.seam.ui.test", null, PROJECT_NAME, makeCopy);
+ public void setUp() throws CoreException {
+ provider = new TestProjectProvider("org.jboss.tools.seam.ui.test", null, PROJECT_NAME, makeCopy);
project = provider.getProject();
- Throwable exception = null;
- try {
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (Exception x) {
- exception = x;
- x.printStackTrace();
- }
- assertNull("An exception caught: " + (exception != null? exception.getMessage() : ""), exception);
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
}
protected void tearDown() throws Exception {
@@ -65,11 +59,6 @@
* Test for http://jira.jboss.com/jira/browse/JBIDE-1258
*/
public void testMessages() {
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- JUnitUtils.fail(e.getMessage(), e);;
- }
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
checkProposals("/WebContent/messages.xhtml", 494, new String[]{"messages.Text1", "messages.Text2"}, true);
}
@@ -79,11 +68,6 @@
* http://jira.jboss.com/jira/browse/JBIDE-2007
*/
public void testVarAttributes() {
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- }
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
IFile component = project.getFile("src/action/demo/TestComponentForVarAttributes.java");
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -11,8 +11,10 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension3;
import org.eclipse.jface.text.ITypedRegion;
@@ -55,13 +57,10 @@
}
}
- public void testSeamViewPartitioner() {
- try {
- EditorTestHelper.joinBackgroundActivities();
- } catch (Exception e) {
- e.printStackTrace();
- fail("Waiting for the jobs to complete has failed.");
- }
+ public void testSeamViewPartitioner() throws CoreException {
+
+ EditorTestHelper.joinBackgroundActivities();
+
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
IFile jspFile = project.getFile(PAGE_NAME);
@@ -73,40 +72,23 @@
IDocumentProvider documentProvider = null;
Throwable exception = null;
- try {
- documentProvider = DocumentProviderRegistry.getDefault().getDocumentProvider(editorInput);
- } catch (Exception x) {
- exception = x;
- x.printStackTrace();
-
- }
- assertNull("An exception caught: " + (exception != null? exception.getMessage() : ""), exception);
- assertTrue("The document provider for the file \"" + PAGE_NAME + "\" is not loaded", (documentProvider != null));
+ documentProvider = DocumentProviderRegistry.getDefault().getDocumentProvider(editorInput);
+ assertNotNull("The document provider for the file \"" + PAGE_NAME + "\" is not loaded", documentProvider);
- try {
- documentProvider.connect(editorInput);
- } catch (Exception x) {
- exception = x;
- x.printStackTrace();
- assertTrue("The document provider is not able to be initialized with the editor input", false);
- }
- assertNull("An exception caught: " + (exception != null? exception.getMessage() : ""), exception);
+
+ documentProvider.connect(editorInput);
IDocument document = documentProvider.getDocument(editorInput);
assertTrue("The document for the file \"" + PAGE_NAME + "\" is not loaded", (document != null));
- IStructuredModel model = null;
- if (document instanceof IStructuredDocument) {
- // corresponding releaseFromEdit occurs in
- // dispose()
- model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) document);
- EditorModelUtil.addFactoriesTo(model);
- }
-
+ assertTrue("Document should be instance of IStructuredDocument",document instanceof IStructuredDocument);
+ IStructuredModel model = StructuredModelManager.getModelManager().getModelForEdit((IStructuredDocument) document);
assertTrue("The document model for the file \"" + PAGE_NAME + "\" is not loaded", (model != null));
-
+
+ EditorModelUtil.addFactoriesTo(model);
+
SeamViewHyperlinkPartitioner seamViewPartitioner = new SeamViewHyperlinkPartitioner();
TestHyperlinkDetector detector = new TestHyperlinkDetector();
@@ -125,7 +107,7 @@
boolean recognized = false;
if (partitionTypes != null && partitionTypes.length > 0) {
- recognized = ("org.jboss.tools.seam.text.ext.SEAM_VIEW_LINK".equals(partitionTypes[0]));
+ recognized = ("org.eclipse.jst.jsp.core.jspsource".equals(partitionTypes[0]));
}
if (recognized) {
@@ -134,8 +116,8 @@
if (recognized) {
String childPartitionType = seamViewPartitioner.getChildPartitionType(testData.document, testData.getHyperlinkRegion());
-// if (childPartitionType != null)
-// System.out.println("position #" + i + " partitionType: " + childPartitionType);
+ if (childPartitionType != null)
+ System.out.println("position #" + i + " partitionType: " + childPartitionType);
if (childPartitionType != null) {
ArrayList test = (ArrayList)recognitionTest.get(childPartitionType);
@@ -169,15 +151,15 @@
r = (Region)regions.next();
if (r.getOffset() <= testData.offset && testData.offset < (r.getOffset() + r.getLength()))
testResult = true;
+ System.out.println(testData.getHyperlinkRegion().toString());
}
}
assertTrue("Wrong recognition for the region: " + testData.getHyperlinkRegion().toString()
- + " matches the wrong region [" + r.getOffset() + "-" + (r.getOffset() + r.getLength()) + "]" , (testResult == false));
+ + " matches the wrong region [" + r.getOffset() + "-" + (r.getOffset() + r.getLength()) + "] in file \"" + PAGE_NAME + "\"" , (testResult == false));
}
}
- assertTrue("Wrong recognized region count: " + counter
- + " (must be 24)" , (counter == 24));
+ assertEquals("Wrong recognized region count", 24 , counter);
model.releaseFromEdit();
@@ -209,7 +191,9 @@
region = (document instanceof IDocumentExtension3 ?
((IDocumentExtension3)document).getDocumentPartitioner("org.eclipse.wst.sse.core.default_structured_text_partitioning").getPartition(offset) :
document.getDocumentPartitioner().getPartition(offset));
- } catch (Exception x) {}
+ } catch (Exception x) {
+ x.printStackTrace();
+ }
return region;
}
@@ -235,7 +219,13 @@
return region.getOffset();
}
public String toString() {
- return "[" + getOffset() + "-" + (getOffset() + getLength() - 1) + ":" + getType() + ":" + getContentType() + "]";
+ try {
+ return document.get(getOffset(), getLength()) + " [" + getOffset() + "-" + (getOffset() + getLength() - 1) + ":" + getType() + ":" + getContentType() + "]";
+ } catch (BadLocationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return "";
}
};
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -103,7 +103,7 @@
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
assertNotNull("Can't load seam project. It seems seam nature was not added to rpoject by seam settings page.", seamProject);
-
+
IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(project);
assertEquals("Seam settings version 1.1 property is not set", pref.get(ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION, ""), ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION_1_1);
assertEquals("Seam runtime property is not set", pref.get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, ""), RUNTIME_NAME);
@@ -117,5 +117,7 @@
assertEquals("Test package name property is not set", pref.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, ""), TEST_PACKAGE_NAME);
assertEquals("Test source folder property is not set", pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, ""), "/" + PROJECT_NAME + "/src");
assertEquals("View folder property is not set", pref.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, ""), "/" + PROJECT_NAME);
+
+ assertTrue("Seam Nature was not enabled for project \"" + project.getName() + "\"",project.hasNature(ISeamProject.NATURE_ID));
}
}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -142,7 +142,7 @@
seamPackage = findSeamPackage(tree, "myPackage");
assertTrue("Expected package 'myPackage' was not found it tree",
seamPackage!=null);
-
+ EditorTestHelper.runEventQueue(1000);
component = findSeamComponent(seamPackage, "myPackage.myTextComponent");
assertTrue("Expected component 'myPackage.myTextComponent' not found " +
"after renaming",component!=null);
@@ -534,6 +534,7 @@
count++;
if(count > NUMBER_OF_REFRESHES) break;
}
+ EditorTestHelper.runEventQueue(1000);
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -52,6 +52,7 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.jboss.tools.seam.core.test.project.facet.AbstractSeamFacetTest;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
@@ -66,16 +67,11 @@
import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.osgi.service.prefs.BackingStoreException;
-abstract public class AbstractSeamNewOperationTest extends TestCase {
+abstract public class AbstractSeamNewOperationTest extends AbstractSeamFacetTest {
+
protected static final IWorkspace ws = ResourcesPlugin.getWorkspace();
protected static final IWorkbench wb = PlatformUI.getWorkbench();
- protected static final String SEAM_1_2 = "Seam 1.2.0";
- protected static final String SEAM_2_0 = "Seam 2.0.0";
-
- protected static final String SEAM_1_2_HOME = "jbosstools.test.seam.1.2.1.eap.home";
- protected static final String SEAM_2_0_HOME = "jbosstools.test.seam.2.0.1.GA.home";
-
private static final String SEAM_ACTION_COMPONENT_NAME = "TestAction";
private static final String SEAM_FORM_COMPONENT_NAME = "TestForm";
private static final String SEAM_CONVERSATION_COMPONENT_NAME = "TestConversation";
@@ -88,52 +84,27 @@
protected final Set<IResource> resourcesToCleanup = new HashSet<IResource>();
- protected static final IProjectFacetVersion dynamicWebVersion;
- protected static final IProjectFacetVersion javaVersion;
- protected static final IProjectFacetVersion javaFacesVersion;
private static final IProjectFacet seamFacet;
static {
- javaVersion = ProjectFacetsManager.getProjectFacet("jst.java").getVersion("5.0");
- dynamicWebVersion = ProjectFacetsManager.getProjectFacet("jst.web").getVersion("2.5");
- javaFacesVersion = ProjectFacetsManager.getProjectFacet("jst.jsf").getVersion("1.2");
seamFacet = ProjectFacetsManager.getProjectFacet("jst.seam");
}
-
- public AbstractSeamNewOperationTest() {
+
+ protected AbstractSeamNewOperationTest(String name) {
+ super(name);
+ // TODO Auto-generated constructor stub
}
protected void setUp() throws Exception {
super.setUp();
- try { EditorTestHelper.joinBackgroundActivities(); }
- catch (Exception e) { JUnitUtils.fail(e.getMessage(), e); }
+ try {
+ EditorTestHelper.joinBackgroundActivities(); }
+ catch (Exception e) {
+ JUnitUtils.fail(e.getMessage(), e);
+ }
EditorTestHelper.runEventQueue(3000);
}
- protected void tearDown() throws Exception {
- // Wait until all jobs is finished to avoid delete project problems
- EditorTestHelper.joinBackgroundActivities();
- EditorTestHelper.runEventQueue(3000);
- Exception last = null;
- for (IResource r : this.resourcesToCleanup) {
- try {
- System.out.println("Deleting " + r);
- ((IProject)r).close(null);
- r.delete(true, null);
- } catch(Exception e) {
- System.out.println("Error deleting " + r);
- e.printStackTrace();
- last = e;
- }
- }
-
- if(last!=null) throw last;
-
- resourcesToCleanup.clear();
-
- super.tearDown();
- }
-
abstract protected IProject getProject();
abstract void setUpSeamProjects();
@@ -180,103 +151,24 @@
JUnitUtils.fail(e.getMessage(), e);
}
}
-
- protected IFacetedProject createSeamWarProject(String name) throws CoreException {
- final IFacetedProject fproj = createSeamProject(name, createSeamDataModel("war"));
- final IProject proj = fproj.getProject();
-
- assertNotNull(proj);
- assertTrue(proj.exists());
-
- assertTrue(proj.getWorkspace().getRoot().getProject(proj.getName() + "-test").exists());
- IProject testProject = proj.getWorkspace().getRoot().getProject(proj.getName() + "-test");
- this.addResourceToCleanup(testProject);
- this.addResourceToCleanup(proj);
-
- return fproj;
- }
-
- protected IDataModel createSeamDataModel(String deployType) {
- IDataModel config = (IDataModel) new SeamFacetInstallDataModelProvider().create();
- config.setStringProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, getSeamRTName());
- config.setBooleanProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS, true);
- config.setBooleanProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY, false);
- config.setStringProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, deployType);
- config.setStringProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "org.session.beans");
- config.setStringProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.entity.beans");
- config.setStringProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.test.beans");
- config.setStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, "noop-connection");
- config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH, new String[] { "noop-driver.jar" });
- return config;
- }
-
- protected IFacetedProject createSeamProject(String baseProjectName, IDataModel config) throws CoreException {
- final IFacetedProject fproj = ProjectFacetsManager.create(baseProjectName, null,
- null);
-
- installDependentFacets(fproj);
-// new SeamFacetPreInstallDelegate().execute(fproj.getProject(), getSeamFacetVersion(), config, null);
- fproj.installProjectFacet(getSeamFacetVersion(getSeamRTName()), config, null);
-
- SeamProjectsSet seamProjectsSet = new SeamProjectsSet(fproj.getProject());
- assertTrue(seamProjectsSet.getActionFolder().exists());
- assertTrue(seamProjectsSet.getModelFolder().exists());
-
- return fproj;
- }
-
- protected void installDependentFacets(final IFacetedProject fproj) throws CoreException {
- fproj.installProjectFacet(javaVersion, null, null);
- fproj.installProjectFacet(dynamicWebVersion, null, null);
- fproj.installProjectFacet(javaFacesVersion, null, null);
- }
-
protected IProjectFacetVersion getSeamFacetVersion(String seamRTName) {
assertTrue("Wrong SEAM run-time name is specified: " + seamRTName,
- (SEAM_1_2.equals(seamRTName) || SEAM_2_0.equals(seamRTName)));
- if (SEAM_1_2.equals(seamRTName)) {
+ (AbstractSeamFacetTest.SEAM_1_2_0.equals(seamRTName) || AbstractSeamFacetTest.SEAM_2_0_0.equals(seamRTName)));
+ if (AbstractSeamFacetTest.SEAM_1_2_0.equals(seamRTName)) {
return seamFacet.getVersion("1.2");
- } else if (SEAM_2_0.equals(seamRTName)) {
+ } else if (AbstractSeamFacetTest.SEAM_1_2_0.equals(seamRTName)) {
return seamFacet.getVersion("2.0");
}
return null;
}
- protected final void addResourceToCleanup(final IResource resource) {
- this.resourcesToCleanup.add(resource);
- }
-
- protected IFacetedProject createSeamEarProject(String name) throws CoreException {
- final IFacetedProject fproj = createSeamProject(name, createSeamDataModel("ear"));
-
- final IProject proj = fproj.getProject();
- assertNotNull(proj);
-
- IProject testProject = proj.getWorkspace().getRoot().getProject(proj.getName() + "-test");
- IProject ejbProject = proj.getWorkspace().getRoot().getProject(proj.getName() + "-ejb");
- IProject earProject = proj.getWorkspace().getRoot().getProject(proj.getName() + "-ear");
-
- this.resourcesToCleanup.add(proj);
- this.resourcesToCleanup.add(testProject);
- this.resourcesToCleanup.add(ejbProject);
- this.resourcesToCleanup.add(earProject);
-
- assertTrue(proj.exists());
- assertTrue(testProject.exists());
- assertTrue(ejbProject.exists());
- assertTrue(earProject.exists());
-
- return fproj;
- }
-
-
protected File getSeamHomeFolder(String seamRTName) {
File seamHome = null;
- if (SEAM_1_2.equals(seamRTName)) {
+ if (AbstractSeamFacetTest.SEAM_1_2_0.equals(seamRTName)) {
seamHome = new File(System.getProperty(SEAM_1_2_HOME));
- } else if (SEAM_2_0.equals(seamRTName)) {
+ } else if (AbstractSeamFacetTest.SEAM_2_0_0.equals(seamRTName)) {
seamHome = new File(System.getProperty(SEAM_2_0_HOME));
}
@@ -284,9 +176,9 @@
}
protected SeamVersion getSeamRTVersion(String seamRTName) {
- if (SEAM_1_2.equals(seamRTName)) {
+ if (AbstractSeamFacetTest.SEAM_1_2_0.equals(seamRTName)) {
return SeamVersion.SEAM_1_2;
- } else if (SEAM_2_0.equals(seamRTName)) {
+ } else if (AbstractSeamFacetTest.SEAM_2_0_0.equals(seamRTName)) {
return SeamVersion.SEAM_2_0;
}
return null;
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -27,6 +27,7 @@
import org.jboss.tools.test.util.xpl.EditorTestHelper;
public class Seam12EARNewOperationTest extends AbstractSeamNewOperationTest {
+
private static final String SEAM_EAR_PROJECTNAME = "seam_ear";
private static final String SEAM_EAR_EJB_PROJECTNAME = "seam_ear-ejb";
private static final String SEAM_EAR_EAR_PROJECTNAME = "seam_ear-ear";
@@ -39,11 +40,11 @@
private ISeamProject seamEarEjbProject = null;
private ISeamProject seamTestProject = null;
+ public Seam12EARNewOperationTest(String name) {
+ super(name);
+ // TODO Auto-generated constructor stub
+ }
- public Seam12EARNewOperationTest() {
- super();
- }
-
protected void setUp() throws Exception {
super.setUp();
@@ -312,6 +313,6 @@
@Override
protected String getSeamRTName() {
- return AbstractSeamNewOperationTest.SEAM_1_2;
+ return AbstractSeamNewOperationTest.SEAM_1_2_0;
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -37,8 +37,8 @@
private ISeamProject seamTestProject = null;
- public Seam12WARNewOperationTest() {
- super();
+ public Seam12WARNewOperationTest(String name) {
+ super(name);
}
protected void setUp() throws Exception {
@@ -91,7 +91,7 @@
}
protected String getSeamRTName() {
- return AbstractSeamNewOperationTest.SEAM_1_2;
+ return AbstractSeamNewOperationTest.SEAM_1_2_0;
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20EARNewOperationTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -11,6 +11,12 @@
package org.jboss.tools.seam.ui.test.wizard;
public class Seam20EARNewOperationTest extends Seam12EARNewOperationTest {
+
+ public Seam20EARNewOperationTest(String name) {
+ super(name);
+ // TODO Auto-generated constructor stub
+ }
+
@Override
void setUpSeamProjects() {
setUpSeamProject(earProject);
@@ -18,6 +24,6 @@
@Override
protected String getSeamRTName() {
- return AbstractSeamNewOperationTest.SEAM_2_0;
+ return AbstractSeamNewOperationTest.SEAM_2_0_0;
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20WARNewOperationTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -11,6 +11,11 @@
package org.jboss.tools.seam.ui.test.wizard;
public class Seam20WARNewOperationTest extends Seam12WARNewOperationTest {
+ public Seam20WARNewOperationTest(String name) {
+ super(name);
+ // TODO Auto-generated constructor stub
+ }
+
@Override
void setUpSeamProjects() {
setUpSeamProject(warProject);
@@ -18,6 +23,6 @@
@Override
protected String getSeamRTName() {
- return AbstractSeamNewOperationTest.SEAM_2_0;
+ return AbstractSeamNewOperationTest.SEAM_2_0_0;
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2008-06-19 05:49:51 UTC (rev 8838)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNewWizardTest.java 2008-06-19 05:53:36 UTC (rev 8839)
@@ -77,9 +77,7 @@
*
*/
public void testSeamProjectNewWizardInstanceIsCreated() {
- IWizardPage projectFacetsWizPg = wizard.getNextPage(startSeamPrjWzPg);
- assertNotNull("Cannot create select facets wizard page",projectFacetsWizPg);
- IWizardPage webModuleWizPg = wizard.getNextPage(projectFacetsWizPg);
+ IWizardPage webModuleWizPg = wizard.getNextPage(startSeamPrjWzPg);
assertNotNull("Cannot create dynamic web project wizard page",webModuleWizPg);
IWizardPage jsfCapabilitiesWizPg = wizard.getNextPage(webModuleWizPg);
assertNotNull("Cannot create JSF capabilities wizard page",jsfCapabilitiesWizPg);
17 years, 10 months
JBoss Tools SVN: r8838 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-19 01:49:51 -0400 (Thu, 19 Jun 2008)
New Revision: 8838
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/DataModelValidatorDelegate.java
Log:
JBIDE-1111: fix testJiraJbide1111 test error
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/DataModelValidatorDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/DataModelValidatorDelegate.java 2008-06-19 05:48:40 UTC (rev 8837)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/DataModelValidatorDelegate.java 2008-06-19 05:49:51 UTC (rev 8838)
@@ -73,11 +73,7 @@
*
*/
public void propertyChanged(DataModelEvent event) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- validateUntillError();
- }
- });
+ validateUntillError();
}
/**
17 years, 10 months
JBoss Tools SVN: r8837 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-19 01:48:40 -0400 (Thu, 19 Jun 2008)
New Revision: 8837
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
fix for tests compilation error
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-06-18 22:21:12 UTC (rev 8836)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-06-19 05:48:40 UTC (rev 8837)
@@ -71,6 +71,9 @@
private static final ICompletionProposal[] NO_PROPOSALS= new ICompletionProposal[0];
private static final IContextInformation[] NO_CONTEXTS= new IContextInformation[0];
+ public static final String EL_END_EXPRESSION = "}";
+ public static final String EL_START_EXPRESSION = "#{";
+
public static final class Proposal implements ICompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3, ICompletionProposalExtension4 {
private final String fString;
17 years, 10 months
JBoss Tools SVN: r8836 - in trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core: src/org/jboss/ide/eclipse/as/classpath/core/jee and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-18 18:21:12 -0400 (Wed, 18 Jun 2008)
New Revision: 8836
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/AbstractClasspathContainer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/AbstractClasspathContainerInitializer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE13ClasspathContainerInitializer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE14ClasspathContainerInitializer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE50ClasspathContainerInitializer.java
Log:
JBIDE-2368
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml 2008-06-18 19:30:00 UTC (rev 8835)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/plugin.xml 2008-06-18 22:21:12 UTC (rev 8836)
@@ -69,21 +69,31 @@
<!-- J2EE Libraries -->
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
- <classpathContainerInitializer
- class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE13ClasspathContainerInitializer"
- id="org.jboss.ide.eclipse.as.classpath.core.j2ee-1.3">
- </classpathContainerInitializer>
- <classpathContainerInitializer
- class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE14ClasspathContainerInitializer"
- id="org.jboss.ide.eclipse.as.classpath.core.j2ee-1.4">
- </classpathContainerInitializer>
- <classpathContainerInitializer
- class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE50ClasspathContainerInitializer"
- id="org.jboss.ide.eclipse.as.classpath.core.javaee-5.0">
- </classpathContainerInitializer>
+ <classpathContainerInitializer
+ class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE13ClasspathContainerInitializer"
+ id="org.jboss.ide.eclipse.as.classpath.core.j2ee-1.3">
+ </classpathContainerInitializer>
+ <classpathContainerInitializer
+ class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE14ClasspathContainerInitializer"
+ id="org.jboss.ide.eclipse.as.classpath.core.j2ee-1.4">
+ </classpathContainerInitializer>
+ <classpathContainerInitializer
+ class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE50ClasspathContainerInitializer"
+ id="org.jboss.ide.eclipse.as.classpath.core.javaee-5.0">
+ </classpathContainerInitializer>
+
+ <!-- Legacy ID's -->
+ <classpathContainerInitializer
+ class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE13ClasspathContainerInitializer"
+ id="org.jboss.ide.eclipse.jdt.core.classpath.j2ee-1.3">
+ </classpathContainerInitializer>
+ <classpathContainerInitializer
+ class="org.jboss.ide.eclipse.as.classpath.core.jee.J2EE14ClasspathContainerInitializer"
+ id="org.jboss.ide.eclipse.jdt.core.classpath.j2ee-1.4">
+ </classpathContainerInitializer>
</extension>
+
<!--
-
Cannot be enabled before resource change listening is implemented.(max)
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/AbstractClasspathContainer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/AbstractClasspathContainer.java 2008-06-18 19:30:00 UTC (rev 8835)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/AbstractClasspathContainer.java 2008-06-18 22:21:12 UTC (rev 8836)
@@ -27,7 +27,6 @@
import java.net.URL;
import java.util.ArrayList;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
@@ -91,7 +90,7 @@
}
protected IClasspathEntry[] computeEntries() {
- ArrayList entries = new ArrayList();
+ ArrayList<IClasspathEntry> entries = new ArrayList<IClasspathEntry>();
String baseDir = getBaseDir();
if (baseDir == null)
@@ -124,28 +123,24 @@
= decorations.getDecorations( getDecorationManagerKey(getPath().toString()), entryPath.toString() );
- IClasspathAttribute[] attrs = {};
- if( dec != null )
- {
- sourceAttachementPath = dec.getSourceAttachmentPath();
- sourceAttachementRootPath = dec.getSourceAttachmentRootPath();
- attrs = dec.getExtraAttributes();
- } else if (jarSrcFile.exists()) {
- sourceAttachementPath = new Path(jarSrcFile.toString());
- sourceAttachementRootPath = new Path("/");//$NON-NLS-1$
+ IClasspathAttribute[] attrs = {};
+ if( dec != null ) {
+ sourceAttachementPath = dec.getSourceAttachmentPath();
+ sourceAttachementRootPath = dec.getSourceAttachmentRootPath();
+ attrs = dec.getExtraAttributes();
+ } else if (jarSrcFile.exists()) {
+ sourceAttachementPath = new Path(jarSrcFile.toString());
+ sourceAttachementRootPath = new Path("/");//$NON-NLS-1$
+ }
+
+ IAccessRule[] access = {};
+ IClasspathEntry entry = JavaCore.newLibraryEntry( entryPath, sourceAttachementPath,
+ sourceAttachementRootPath, access, attrs, false );
+ entries.add(entry);
}
-
- IAccessRule[] access = {};
- IClasspathEntry entry = JavaCore.newLibraryEntry( entryPath, sourceAttachementPath, sourceAttachementRootPath, access, attrs,
- false );
- // IClasspathEntry entry = JavaCore.newLibraryEntry(entryPath,
- // sourceAttachementPath, sourceAttachementRootPath, true);
- entries.add(entry);
- }
}
- return (IClasspathEntry[]) entries.toArray(new IClasspathEntry[entries
- .size()]);
+ return entries.toArray(new IClasspathEntry[entries.size()]);
}
protected String getLibFolder() {
@@ -169,8 +164,7 @@
return container;
}
- static ClasspathDecorationsManager getDecorationsManager()
- {
+ static ClasspathDecorationsManager getDecorationsManager() {
return decorations;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/AbstractClasspathContainerInitializer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/AbstractClasspathContainerInitializer.java 2008-06-18 19:30:00 UTC (rev 8835)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/AbstractClasspathContainerInitializer.java 2008-06-18 22:21:12 UTC (rev 8836)
@@ -57,13 +57,10 @@
throws CoreException {
int size = containerPath.segmentCount();
if (size > 0) {
- if (containerPath.segment(0).equals(this.getClasspathContainerID())) {
- AbstractClasspathContainer container = this
- .createClasspathContainer(containerPath);
- JavaCore.setClasspathContainer(containerPath,
- new IJavaProject[] { project },
- new IClasspathContainer[] { container }, null);
- }
+ AbstractClasspathContainer container = createClasspathContainer(containerPath);
+ JavaCore.setClasspathContainer(containerPath,
+ new IJavaProject[] { project },
+ new IClasspathContainer[] { container }, null);
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE13ClasspathContainerInitializer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE13ClasspathContainerInitializer.java 2008-06-18 19:30:00 UTC (rev 8835)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE13ClasspathContainerInitializer.java 2008-06-18 22:21:12 UTC (rev 8836)
@@ -48,7 +48,7 @@
public final static String SUFFIX = "j2ee-1.3";//$NON-NLS-1$
public final static String CLASSPATH_CONTAINER = CLASSPATH_CONTAINER_PREFIX
+ "." + J2EE13ClasspathContainer.SUFFIX;//$NON-NLS-1$
- public final static String DESCRIPTION = "J2EE 1.3 Libraries (JBoss-IDE)";
+ public final static String DESCRIPTION = "J2EE 1.3 Libraries (JBoss Tools)";
public J2EE13ClasspathContainer(IPath path) {
super(path, DESCRIPTION, SUFFIX);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE14ClasspathContainerInitializer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE14ClasspathContainerInitializer.java 2008-06-18 19:30:00 UTC (rev 8835)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE14ClasspathContainerInitializer.java 2008-06-18 22:21:12 UTC (rev 8836)
@@ -27,7 +27,7 @@
public final static String SUFFIX = "j2ee-1.4";//$NON-NLS-1$
public final static String CLASSPATH_CONTAINER = CLASSPATH_CONTAINER_PREFIX
+ "." + J2EE14ClasspathContainer.SUFFIX;//$NON-NLS-1$
- public final static String DESCRIPTION = "J2EE 1.4 Libraries (JBoss-IDE)";
+ public final static String DESCRIPTION = "J2EE 1.4 Libraries (JBoss Tools)";
public J2EE14ClasspathContainer(IPath path) {
super(path, DESCRIPTION, SUFFIX);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE50ClasspathContainerInitializer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE50ClasspathContainerInitializer.java 2008-06-18 19:30:00 UTC (rev 8835)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/jee/J2EE50ClasspathContainerInitializer.java 2008-06-18 22:21:12 UTC (rev 8836)
@@ -48,7 +48,7 @@
public final static String SUFFIX = "javaee-5.0";//$NON-NLS-1$
public final static String CLASSPATH_CONTAINER = CLASSPATH_CONTAINER_PREFIX
+ "." + J2EE50ClasspathContainer.SUFFIX;//$NON-NLS-1$
- public final static String DESCRIPTION = "J2EE 5.0 Libraries (JBoss-IDE)";
+ public final static String DESCRIPTION = "J2EE 5.0 Libraries (JBoss Tools)";
public J2EE50ClasspathContainer(IPath path) {
super(path, DESCRIPTION, SUFFIX);
17 years, 10 months
JBoss Tools SVN: r8835 - trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-06-18 15:30:00 -0400 (Wed, 18 Jun 2008)
New Revision: 8835
Added:
trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/AbstractOdaFactory.java
Log:
JBIDE-2220 JBoss BIRT Integration
Added: trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/AbstractOdaFactory.java
===================================================================
--- trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/AbstractOdaFactory.java (rev 0)
+++ trunk/birt/plugins/org.jboss.tools.birt.oda/src/org/jboss/tools/birt/oda/impl/AbstractOdaFactory.java 2008-06-18 19:30:00 UTC (rev 8835)
@@ -0,0 +1,209 @@
+package org.jboss.tools.birt.oda.impl;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.eclipse.datatools.connectivity.oda.IResultSetMetaData;
+import org.eclipse.datatools.connectivity.oda.OdaException;
+import org.hibernate.EntityMode;
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.metadata.ClassMetadata;
+import org.hibernate.type.Type;
+import org.jboss.tools.birt.oda.IOdaFactory;
+
+public abstract class AbstractOdaFactory implements IOdaFactory {
+
+ protected SessionFactory sessionFactory;
+ private int maxRows;
+ private List result;
+ private Iterator iterator;
+ private Type[] queryReturnTypes;
+ private Object currentRow;
+ private HibernateOdaQuery query;
+ private Session session;
+ private String queryText;
+
+ public void close() {
+ sessionFactory = null;
+ if (session != null) {
+ session.close();
+ session = null;
+ }
+ }
+
+ public SessionFactory getSessionFactory() {
+ return sessionFactory;
+ }
+
+ public HibernateResultSetMetaData prepare(String queryText) throws OdaException {
+ this.queryText = queryText;
+ List arColsType = new ArrayList();
+ List arCols = new ArrayList();
+ List arColClass = new ArrayList();
+ String[] props = null;
+ Session session = null;
+ try {
+ session = getSessionFactory().openSession();
+ Query query = session.createQuery(queryText);
+ int maxRows = getMaxRows();
+ if (maxRows > 0) {
+ query.setFirstResult(0);
+ query.setMaxResults(maxRows);
+ }
+ this.maxRows = maxRows;
+ Type[] qryReturnTypes = query.getReturnTypes();
+ if (qryReturnTypes.length > 0 && qryReturnTypes[0].isEntityType()) {
+ for (int j = 0; j < qryReturnTypes.length; j++) {
+ String clsName = qryReturnTypes[j].getName();
+ props = getHibernateProp(clsName);
+ for (int x = 0; x < props.length; x++) {
+ String propType = getHibernatePropTypes(clsName,
+ props[x]);
+ if (DataTypes.isValidType(propType)) {
+ arColsType.add(propType);
+ arCols.add(props[x]);
+ arColClass.add(clsName);
+ } else {
+ //throw new OdaException("Data Type is Not Valid");
+ arColsType.add(DataTypes.UNKNOWN);
+ arCols.add(props[x]);
+ arColClass.add("java.lang.String");
+ }
+ }
+ }
+ } else {
+ props = extractColumns(query.getQueryString());
+ for (int t = 0; t < qryReturnTypes.length; t++) {
+ if (DataTypes.isValidType(qryReturnTypes[t].getName())) {
+ arColsType.add(qryReturnTypes[t].getName());
+ arCols.add(props[t]);
+ } else {
+ throw new OdaException("'"
+ + qryReturnTypes[t].getName()
+ + "' is not a valid type.");
+ }
+ }
+
+ }
+ String[] arLabels = (String[]) arCols.toArray(new String[arCols
+ .size()]);
+ for (int j = 0; j < arLabels.length; j++) {
+ arLabels[j] = arLabels[j].replace('.', ':');
+ }
+
+ return new HibernateResultSetMetaData(arLabels,
+ (String[]) arColsType
+ .toArray(new String[arColsType.size()]), arLabels,
+ (String[]) arColClass
+ .toArray(new String[arColClass.size()]));
+ } catch (Exception e) {
+ throw new OdaException(e.getLocalizedMessage());
+ } finally {
+ if (session != null) {
+ session.close();
+ }
+ }
+ }
+
+ private static String[] extractColumns(final String query) {
+ int fromPosition = query.toLowerCase().indexOf("from");
+ int selectPosition = query.toLowerCase().indexOf("select");
+ if (selectPosition >= 0) {
+ String columns = query.substring(selectPosition + 6, fromPosition);
+ StringTokenizer st = new StringTokenizer(columns, ",");
+ List columnList = new ArrayList();
+ while (st.hasMoreTokens()) {
+ columnList.add(st.nextToken().trim());
+ }
+ return (String[]) columnList.toArray(new String[0]);
+ } else {
+ return null;
+ }
+ }
+
+ private String[] getHibernateProp(String className) {
+ SessionFactory sf = getSessionFactory();
+ String[] properties = sf.getClassMetadata(className).getPropertyNames();
+ return( properties);
+ }
+
+ private String getHibernatePropTypes(String className, String property) {
+ SessionFactory sf = getSessionFactory();
+ Type hibClassProps = sf.getClassMetadata(className).getPropertyType(property);
+ return(hibClassProps.getName());
+
+ }
+
+ public int getMaxRows() {
+ return maxRows;
+ }
+
+ public void setMaxRows(int maxRows) {
+ this.maxRows = maxRows;
+ }
+
+ public void executeQuery(HibernateOdaQuery query) throws OdaException {
+ this.query = query;
+ try {
+ session = getSessionFactory().openSession();
+ Query q = session.createQuery(queryText);
+ result = q.list();
+ iterator = result.iterator();
+ this.queryReturnTypes = q.getReturnTypes();
+ } catch (HibernateException e) {
+ throw new OdaException(e.getLocalizedMessage());
+ }
+ }
+
+ public Iterator getIterator() {
+ return iterator;
+ }
+
+ public List getResult() {
+ return result;
+ }
+
+ public Object getResult(int rstcol) throws OdaException {
+ Object obj = this.currentRow;
+ Object value = null;
+ try {
+ if (queryReturnTypes.length > 0
+ && queryReturnTypes[0].isEntityType()) {
+ String checkClass = ((HibernateResultSetMetaData) getMetaData())
+ .getColumnClass(rstcol);
+ SessionFactory sf = getSessionFactory();
+ ClassMetadata metadata = sf.getClassMetadata(checkClass);
+ if (metadata == null) {
+ metadata = sf.getClassMetadata(obj.getClass());
+ }
+ value = metadata.getPropertyValue(obj, getMetaData()
+ .getColumnName(rstcol), EntityMode.POJO);
+ } else {
+ if (getMetaData().getColumnCount() == 1) {
+ value = obj;
+ } else {
+ Object[] values = (Object[]) obj;
+ value = values[rstcol - 1];
+ }
+ }
+ } catch (Exception e) {
+ throw new OdaException(e.getLocalizedMessage());
+ }
+ return (value);
+ }
+
+ private IResultSetMetaData getMetaData() throws OdaException {
+ return query.getMetaData();
+ }
+
+ public void next() {
+ currentRow = getIterator().next();
+ }
+
+
+}
17 years, 10 months