JBoss Tools SVN: r25531 - branches/jbosstools-3.2.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-10-06 13:41:32 -0400 (Wed, 06 Oct 2010)
New Revision: 25531
Modified:
branches/jbosstools-3.2.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
Log:
https://jira.jboss.org/browse/JBIDE-7274 - fixed in Beta1 branch
Modified: branches/jbosstools-3.2.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-10-06 17:40:56 UTC (rev 25530)
+++ branches/jbosstools-3.2.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-10-06 17:41:32 UTC (rev 25531)
@@ -178,55 +178,46 @@
String pass = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.password"); //$NON-NLS-1$
//
String dialectName = consoleConfigPrefs.getDialectName();
+ //
+ Set<String> specialProps = new TreeSet<String>();
+ specialProps.add(Environment.DRIVER);
+ specialProps.add(Environment.URL);
+ specialProps.add(Environment.USER);
+ specialProps.add(Environment.PASS);
+ specialProps.add(Environment.DIALECT);
+ //
+ Properties propsTmp = null;
if (consoleConfigPrefs.getPropertyFile() != null) {
- props = consoleConfigPrefs.getProperties();
- props.setProperty(Environment.DRIVER, driverClass);
- props.setProperty(Environment.URL, url);
- props.setProperty(Environment.USER, user);
- props.setProperty(Environment.PASS, pass);
- if (StringHelper.isNotEmpty(dialectName)) {
- props.setProperty(Environment.DIALECT, dialectName);
- }
- // output keys in sort order
- Object[] keys = props.keySet().toArray();
- Arrays.sort(keys);
+ propsTmp = consoleConfigPrefs.getProperties();
+ }
+ if (propsTmp == null) {
+ propsTmp = new Properties();
+ }
+ propsTmp.setProperty(Environment.DRIVER, driverClass);
+ propsTmp.setProperty(Environment.URL, url);
+ propsTmp.setProperty(Environment.USER, user);
+ propsTmp.setProperty(Environment.PASS, pass);
+ if (StringHelper.isNotEmpty(dialectName)) {
+ propsTmp.setProperty(Environment.DIALECT, dialectName);
+ }
+ // output keys in sort order
+ Object[] keys = propsTmp.keySet().toArray();
+ Arrays.sort(keys);
+ //
+ if (externalPropFile) {
for (Object obj : keys) {
- addIntoPropFileContent(propFileContent, obj.toString(), props.getProperty(obj.toString()));
+ addIntoPropFileContent(propFileContent, obj.toString(), propsTmp.getProperty(obj.toString()));
}
} else {
- //
- /** /
- String driverURL = getConnectionProfileDriverURL(connProfileName);
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, "jdbc.driver"); //$NON-NLS-1$
- el.addAttribute(CodeGenerationStrings.LOCATION, driverURL);
- /**/
- //
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.DRIVER);
- el.addAttribute(CodeGenerationStrings.VALUE, driverClass);
- addIntoPropFileContent(propFileContent, Environment.DRIVER);
- //
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.URL);
- el.addAttribute(CodeGenerationStrings.VALUE, url);
- addIntoPropFileContent(propFileContent, Environment.URL);
- //
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.USER);
- el.addAttribute(CodeGenerationStrings.VALUE, user);
- addIntoPropFileContent(propFileContent, Environment.USER);
- //
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.PASS);
- el.addAttribute(CodeGenerationStrings.VALUE, pass);
- addIntoPropFileContent(propFileContent, Environment.PASS);
- //
- if (StringHelper.isNotEmpty(dialectName)) {
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.DIALECT);
- el.addAttribute(CodeGenerationStrings.VALUE, dialectName);
- addIntoPropFileContent(propFileContent, Environment.DIALECT);
+ for (Object obj : keys) {
+ if (specialProps.contains(obj)) {
+ el = root.addElement(CodeGenerationStrings.PROPERTY);
+ el.addAttribute(CodeGenerationStrings.NAME, obj.toString());
+ el.addAttribute(CodeGenerationStrings.VALUE, propsTmp.getProperty(obj.toString()));
+ addIntoPropFileContent(propFileContent, obj.toString());
+ } else {
+ addIntoPropFileContent(propFileContent, obj.toString(), propsTmp.getProperty(obj.toString()));
+ }
}
}
if (externalPropFile) {
14 years, 5 months
JBoss Tools SVN: r25530 - in branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test: src/org/hibernate/eclipse/console/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-10-06 13:40:56 -0400 (Wed, 06 Oct 2010)
New Revision: 25530
Added:
branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenPropsInternal.hibernate.properties
Modified:
branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7274 - fixed in Beta1 branch
Modified: branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
===================================================================
--- branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-10-06 17:38:15 UTC (rev 25529)
+++ branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-10-06 17:40:56 UTC (rev 25530)
@@ -1,13 +1,18 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
<property name="build.dir" location="reslocation/test"/>
- <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
- <target name="generateHibernatePropeties">
- <echo file="${hibernatePropFile}">hibernate.connection.driver_class=driverClass
-hibernate.connection.password=passw
-hibernate.connection.url=url
-hibernate.connection.username=username
-hibernate.dialect=testDialect</echo>
- </target>
+ <property name="hibernate.connection.driver_class" value="driverClass"/>
+ <property name="hibernate.connection.password" value="passw"/>
+ <property name="hibernate.connection.url" value="url"/>
+ <property name="hibernate.connection.username" value="username"/>
+ <property name="hibernate.dialect" value="testDialect"/>
+ <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
+ <target name="generateHibernatePropeties">
+ <echo file="${hibernatePropFile}">hibernate.connection.driver_class=${hibernate.connection.driver_class}
+hibernate.connection.password=${hibernate.connection.password}
+hibernate.connection.url=${hibernate.connection.url}
+hibernate.connection.username=${hibernate.connection.username}
+hibernate.dialect=${hibernate.dialect}</echo>
+ </target>
<path id="toolslib"/>
<target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
Modified: branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
===================================================================
--- branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml 2010-10-06 17:38:15 UTC (rev 25529)
+++ branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml 2010-10-06 17:40:56 UTC (rev 25530)
@@ -1,13 +1,18 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
<property name="build.dir" location="reslocation/test"/>
- <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
- <target name="generateHibernatePropeties">
- <echo file="${hibernatePropFile}">hibernate.connection.driver_class=driverClass
-hibernate.connection.password=passw
-hibernate.connection.url=url
-hibernate.connection.username=username
-hibernate.dialect=testDialect</echo>
- </target>
+ <property name="hibernate.connection.driver_class" value="driverClass"/>
+ <property name="hibernate.connection.password" value="passw"/>
+ <property name="hibernate.connection.url" value="url"/>
+ <property name="hibernate.connection.username" value="username"/>
+ <property name="hibernate.dialect" value="testDialect"/>
+ <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
+ <target name="generateHibernatePropeties">
+ <echo file="${hibernatePropFile}">hibernate.connection.driver_class=${hibernate.connection.driver_class}
+hibernate.connection.password=${hibernate.connection.password}
+hibernate.connection.url=${hibernate.connection.url}
+hibernate.connection.username=${hibernate.connection.username}
+hibernate.dialect=${hibernate.dialect}</echo>
+ </target>
<path id="toolslib"/>
<target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
Added: branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenPropsInternal.hibernate.properties
===================================================================
--- branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenPropsInternal.hibernate.properties (rev 0)
+++ branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenPropsInternal.hibernate.properties 2010-10-06 17:40:56 UTC (rev 25530)
@@ -0,0 +1,5 @@
+hibernate.connection.driver_class=${hibernate.connection.driver_class}
+hibernate.connection.password=${hibernate.connection.password}
+hibernate.connection.url=${hibernate.connection.url}
+hibernate.connection.username=${hibernate.connection.username}
+hibernate.dialect=${hibernate.dialect}
\ No newline at end of file
Modified: branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
===================================================================
--- branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-10-06 17:38:15 UTC (rev 25529)
+++ branches/jbosstools-3.2.0.Beta1/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-10-06 17:40:56 UTC (rev 25530)
@@ -390,7 +390,7 @@
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenInternalProps_test1.xml"); //$NON-NLS-1$
- String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
+ String sampleProperties = getSample("AntCodeGenPropsInternal.hibernate.properties"); //$NON-NLS-1$
assertEquals(sample, codeGen);
assertEquals(sampleProperties.trim(), codeGenProperties);
}
@@ -403,7 +403,7 @@
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenInternalProps_test2.xml"); //$NON-NLS-1$
- String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
+ String sampleProperties = getSample("AntCodeGenPropsInternal.hibernate.properties"); //$NON-NLS-1$
assertEquals(sample, codeGen);
assertEquals(sampleProperties.trim(), codeGenProperties);
}
14 years, 5 months
JBoss Tools SVN: r25529 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-06 13:38:15 -0400 (Wed, 06 Oct 2010)
New Revision: 25529
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
Log:
[JBIDE-7259] corrected request-url and adapted accept-headers
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-06 17:31:54 UTC (rev 25528)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-06 17:38:15 UTC (rev 25529)
@@ -17,6 +17,7 @@
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLConnection;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -257,8 +258,7 @@
if (url.length() > 0) {
if (!url.equals(oldurl)) {
try {
- URL u = new URL(url + "/api.xml"); //$NON-NLS-1$
- Object o = u.getContent();
+ Object o = getURLContent(url);
if (o instanceof InputStream) {
String xml = "";
InputStream is = (InputStream)o;
@@ -327,6 +327,13 @@
return valid;
}
+ private Object getURLContent(String url) throws IOException {
+ URL u = new URL(url);
+ URLConnection connection = u.openConnection();
+ connection.setRequestProperty("Accept", "application/xml;q=1.0"); //$NON-NLS-1$
+ return connection.getContent();
+ }
+
/**
* Set whether the URL is a valid Delta-cloud API URL.
*
14 years, 5 months
JBoss Tools SVN: r25528 - in trunk/hibernatetools: tests/org.hibernate.eclipse.console.test/res/sample and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-10-06 13:31:54 -0400 (Wed, 06 Oct 2010)
New Revision: 25528
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenPropsInternal.hibernate.properties
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7274 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-10-06 17:09:03 UTC (rev 25527)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenXMLFactory.java 2010-10-06 17:31:54 UTC (rev 25528)
@@ -178,55 +178,46 @@
String pass = cpProperties.getProperty("org.eclipse.datatools.connectivity.db.password"); //$NON-NLS-1$
//
String dialectName = consoleConfigPrefs.getDialectName();
+ //
+ Set<String> specialProps = new TreeSet<String>();
+ specialProps.add(Environment.DRIVER);
+ specialProps.add(Environment.URL);
+ specialProps.add(Environment.USER);
+ specialProps.add(Environment.PASS);
+ specialProps.add(Environment.DIALECT);
+ //
+ Properties propsTmp = null;
if (consoleConfigPrefs.getPropertyFile() != null) {
- props = consoleConfigPrefs.getProperties();
- props.setProperty(Environment.DRIVER, driverClass);
- props.setProperty(Environment.URL, url);
- props.setProperty(Environment.USER, user);
- props.setProperty(Environment.PASS, pass);
- if (StringHelper.isNotEmpty(dialectName)) {
- props.setProperty(Environment.DIALECT, dialectName);
- }
- // output keys in sort order
- Object[] keys = props.keySet().toArray();
- Arrays.sort(keys);
+ propsTmp = consoleConfigPrefs.getProperties();
+ }
+ if (propsTmp == null) {
+ propsTmp = new Properties();
+ }
+ propsTmp.setProperty(Environment.DRIVER, driverClass);
+ propsTmp.setProperty(Environment.URL, url);
+ propsTmp.setProperty(Environment.USER, user);
+ propsTmp.setProperty(Environment.PASS, pass);
+ if (StringHelper.isNotEmpty(dialectName)) {
+ propsTmp.setProperty(Environment.DIALECT, dialectName);
+ }
+ // output keys in sort order
+ Object[] keys = propsTmp.keySet().toArray();
+ Arrays.sort(keys);
+ //
+ if (externalPropFile) {
for (Object obj : keys) {
- addIntoPropFileContent(propFileContent, obj.toString(), props.getProperty(obj.toString()));
+ addIntoPropFileContent(propFileContent, obj.toString(), propsTmp.getProperty(obj.toString()));
}
} else {
- //
- /** /
- String driverURL = getConnectionProfileDriverURL(connProfileName);
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, "jdbc.driver"); //$NON-NLS-1$
- el.addAttribute(CodeGenerationStrings.LOCATION, driverURL);
- /**/
- //
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.DRIVER);
- el.addAttribute(CodeGenerationStrings.VALUE, driverClass);
- addIntoPropFileContent(propFileContent, Environment.DRIVER);
- //
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.URL);
- el.addAttribute(CodeGenerationStrings.VALUE, url);
- addIntoPropFileContent(propFileContent, Environment.URL);
- //
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.USER);
- el.addAttribute(CodeGenerationStrings.VALUE, user);
- addIntoPropFileContent(propFileContent, Environment.USER);
- //
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.PASS);
- el.addAttribute(CodeGenerationStrings.VALUE, pass);
- addIntoPropFileContent(propFileContent, Environment.PASS);
- //
- if (StringHelper.isNotEmpty(dialectName)) {
- el = root.addElement(CodeGenerationStrings.PROPERTY);
- el.addAttribute(CodeGenerationStrings.NAME, Environment.DIALECT);
- el.addAttribute(CodeGenerationStrings.VALUE, dialectName);
- addIntoPropFileContent(propFileContent, Environment.DIALECT);
+ for (Object obj : keys) {
+ if (specialProps.contains(obj)) {
+ el = root.addElement(CodeGenerationStrings.PROPERTY);
+ el.addAttribute(CodeGenerationStrings.NAME, obj.toString());
+ el.addAttribute(CodeGenerationStrings.VALUE, propsTmp.getProperty(obj.toString()));
+ addIntoPropFileContent(propFileContent, obj.toString());
+ } else {
+ addIntoPropFileContent(propFileContent, obj.toString(), propsTmp.getProperty(obj.toString()));
+ }
}
}
if (externalPropFile) {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-10-06 17:09:03 UTC (rev 25527)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test1.xml 2010-10-06 17:31:54 UTC (rev 25528)
@@ -1,13 +1,18 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
<property name="build.dir" location="reslocation/test"/>
- <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
- <target name="generateHibernatePropeties">
- <echo file="${hibernatePropFile}">hibernate.connection.driver_class=driverClass
-hibernate.connection.password=passw
-hibernate.connection.url=url
-hibernate.connection.username=username
-hibernate.dialect=testDialect</echo>
- </target>
+ <property name="hibernate.connection.driver_class" value="driverClass"/>
+ <property name="hibernate.connection.password" value="passw"/>
+ <property name="hibernate.connection.url" value="url"/>
+ <property name="hibernate.connection.username" value="username"/>
+ <property name="hibernate.dialect" value="testDialect"/>
+ <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
+ <target name="generateHibernatePropeties">
+ <echo file="${hibernatePropFile}">hibernate.connection.driver_class=${hibernate.connection.driver_class}
+hibernate.connection.password=${hibernate.connection.password}
+hibernate.connection.url=${hibernate.connection.url}
+hibernate.connection.username=${hibernate.connection.username}
+hibernate.dialect=${hibernate.dialect}</echo>
+ </target>
<path id="toolslib"/>
<target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml 2010-10-06 17:09:03 UTC (rev 25527)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenInternalProps_test2.xml 2010-10-06 17:31:54 UTC (rev 25528)
@@ -1,13 +1,18 @@
<project name="CodeGen" default="hibernateAntCodeGeneration">
<property name="build.dir" location="reslocation/test"/>
- <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
- <target name="generateHibernatePropeties">
- <echo file="${hibernatePropFile}">hibernate.connection.driver_class=driverClass
-hibernate.connection.password=passw
-hibernate.connection.url=url
-hibernate.connection.username=username
-hibernate.dialect=testDialect</echo>
- </target>
+ <property name="hibernate.connection.driver_class" value="driverClass"/>
+ <property name="hibernate.connection.password" value="passw"/>
+ <property name="hibernate.connection.url" value="url"/>
+ <property name="hibernate.connection.username" value="username"/>
+ <property name="hibernate.dialect" value="testDialect"/>
+ <property name="hibernatePropFile" value="${java.io.tmpdir}${ant.project.name}-hibernate.properties"/>
+ <target name="generateHibernatePropeties">
+ <echo file="${hibernatePropFile}">hibernate.connection.driver_class=${hibernate.connection.driver_class}
+hibernate.connection.password=${hibernate.connection.password}
+hibernate.connection.url=${hibernate.connection.url}
+hibernate.connection.username=${hibernate.connection.username}
+hibernate.dialect=${hibernate.dialect}</echo>
+ </target>
<path id="toolslib"/>
<target name="hibernateAntCodeGeneration" depends="generateHibernatePropeties">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib"/>
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenPropsInternal.hibernate.properties
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenPropsInternal.hibernate.properties (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/res/sample/AntCodeGenPropsInternal.hibernate.properties 2010-10-06 17:31:54 UTC (rev 25528)
@@ -0,0 +1,5 @@
+hibernate.connection.driver_class=${hibernate.connection.driver_class}
+hibernate.connection.password=${hibernate.connection.password}
+hibernate.connection.url=${hibernate.connection.url}
+hibernate.connection.username=${hibernate.connection.username}
+hibernate.dialect=${hibernate.dialect}
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-10-06 17:09:03 UTC (rev 25527)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/CodeGenXMLFactoryTest.java 2010-10-06 17:31:54 UTC (rev 25528)
@@ -390,7 +390,7 @@
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenInternalProps_test1.xml"); //$NON-NLS-1$
- String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
+ String sampleProperties = getSample("AntCodeGenPropsInternal.hibernate.properties"); //$NON-NLS-1$
assertEquals(sample, codeGen);
assertEquals(sampleProperties.trim(), codeGenProperties);
}
@@ -403,7 +403,7 @@
String codeGenProperties = codeGenFactory.getPropFileContentPreSave();
codeGen = updatePaths(codeGen);
String sample = getSample("AntCodeGenInternalProps_test2.xml"); //$NON-NLS-1$
- String sampleProperties = getSample("AntCodeGenProps.hibernate.properties"); //$NON-NLS-1$
+ String sampleProperties = getSample("AntCodeGenPropsInternal.hibernate.properties"); //$NON-NLS-1$
assertEquals(sample, codeGen);
assertEquals(sampleProperties.trim(), codeGenProperties);
}
14 years, 5 months
JBoss Tools SVN: r25527 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp: outline/cssdialog/common and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-10-06 13:09:03 -0400 (Wed, 06 Oct 2010)
New Revision: 25527
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java
Log:
https://jira.jboss.org/browse/JBIDE-7247 , initial values are set.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java 2010-10-06 17:08:30 UTC (rev 25526)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java 2010-10-06 17:09:03 UTC (rev 25527)
@@ -16,13 +16,17 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.common.model.ui.ModelUIImages;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.bundle.BundleMap;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
public class ExternalizeStringsWizard extends Wizard {
@@ -56,6 +60,28 @@
page2.setTitle(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_TITLE);
page2.setDescription(JstUIMessages.EXTERNALIZE_STRINGS_DIALOG_DESCRIPTION);
page2.setImageDescriptor(ModelUIImages.getImageDescriptor(ModelUIImages.WIZARD_DEFAULT));
+ /*
+ * https://jira.jboss.org/browse/JBIDE-7247
+ * Set initial values for the new properties file
+ */
+ if (editor.getEditorInput() instanceof IStorageEditorInput) {
+ try {
+ IPath fullPath = ((IStorageEditorInput) editor.getEditorInput()).getStorage().getFullPath();
+ page2.setContainerFullPath(fullPath);
+ } catch (CoreException e) {
+ JspEditorPlugin.getDefault().logError(e);
+ }
+
+ }
+ String fileName = editor.getEditorInput().getName();
+ int pos = fileName.lastIndexOf(Constants.DOT);
+ if (pos != -1) {
+ fileName = fileName.substring(0, pos) + Constants.PROPERTIES_EXTENTION;
+ }
+ page2.setFileName(fileName);
+ /*
+ * Add all the pages to the wizard
+ */
addPage(page1);
addPage(page2);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java 2010-10-06 17:08:30 UTC (rev 25526)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/Constants.java 2010-10-06 17:09:03 UTC (rev 25527)
@@ -83,6 +83,7 @@
public static final String END_BRACKET = ")"; //$NON-NLS-1$
public static final String GT = ">"; //$NON-NLS-1$
public static final String LT = "<"; //$NON-NLS-1$
+ public static final String PROPERTIES_EXTENTION = ".properties"; //$NON-NLS-1$
public static final String LEFT_BRACE = "{"; //$NON-NLS-1$
public static final String RIGHT_BRACE = "}"; //$NON-NLS-1$
14 years, 5 months
JBoss Tools SVN: r25526 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2010-10-06 13:08:30 -0400 (Wed, 06 Oct 2010)
New Revision: 25526
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java
Log:
JBIDE-7104
CA proposals aren't filtered when CA is invoked right before next tag or tag ending (before '<'-character)
Apply operation for the proposals is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java 2010-10-06 16:53:48 UTC (rev 25525)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlTagCompletionProposalComputer.java 2010-10-06 17:08:30 UTC (rev 25526)
@@ -156,6 +156,48 @@
}
}
+ protected String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) {
+ if ((aRegion == null) || isCloseRegion(aRegion)) {
+ return ""; //$NON-NLS-1$
+ }
+ String matchString = null;
+ String regionType = aRegion.getType();
+ if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (regionType == DOMRegionContext.XML_TAG_OPEN) || (offset > parent.getStartOffset(aRegion) + aRegion.getTextLength())) {
+ matchString = ""; //$NON-NLS-1$
+ }
+ else if (regionType == DOMRegionContext.XML_CONTENT) {
+ matchString = ""; //$NON-NLS-1$
+ }
+ else {
+ if ((parent.getText(aRegion).length() > 0) && (parent.getStartOffset(aRegion) < offset)) {
+ matchString = parent.getText(aRegion).substring(0, offset - parent.getStartOffset(aRegion));
+ }
+ else {
+ matchString = ""; //$NON-NLS-1$
+ }
+ }
+ if(regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE && matchString.startsWith("\"")) { //$NON-NLS-1$
+ matchString = matchString.substring(1);
+ }
+ return matchString;
+ }
+
+ protected boolean isCloseRegion(ITextRegion region) {
+ String type = region.getType();
+ return ((type == DOMRegionContext.XML_PI_CLOSE) ||
+ (type == DOMRegionContext.XML_TAG_CLOSE) ||
+ (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) ||
+ (type == DOMRegionContext.XML_CDATA_CLOSE) ||
+ (type == DOMRegionContext.XML_COMMENT_CLOSE) ||
+ (type == DOMRegionContext.XML_ATTLIST_DECL_CLOSE) ||
+ (type == DOMRegionContext.XML_ELEMENT_DECL_CLOSE) ||
+ (type == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE) ||
+ (type == "JSP_CLOSE") || //$NON-NLS-1$
+ (type == "JSP_COMMENT_CLOSE") || //$NON-NLS-1$
+ (type.equals("JSP_DIRECTIVE_CLOSE")) || //$NON-NLS-1$
+ (type == DOMRegionContext.XML_DECLARATION_CLOSE));
+ }
+
/*
* Checks if the specified attribute exists
*
@@ -276,8 +318,25 @@
String mainPrefix = getTagPrefix();
String mainURI = getTagUri();
+ // TODO: Insert here: processing for the tag ending start region due to
+ // - calculate correct replacenemt begin position
+ // - calculate correct replacenment length
+ // - calculate correct match string
- String query = contentAssistRequest.getMatchString();
+ String matchString = contentAssistRequest.getMatchString();
+
+ /*
+ * Jeremy: Add attribute name proposals before empty tag close
+ */
+ // TODO: calculate those values hereafter
+ IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(getOffset());
+ ITextRegion completionRegion = getCompletionRegion(getOffset(),
+ contentAssistRequest.getNode());
+
+ matchString = getMatchString(sdRegion, completionRegion,
+ getOffset());
+
+ String query = matchString;
addTagNameProposalsForPrefix(contentAssistRequest, childPosition, query, mainPrefix, mainURI, TextProposal.R_TAG_INSERTION, insertTagOpenningCharacter);
if (query == null || query.length() == 0 || query.contains(":")) //$NON-NLS-1$
@@ -344,8 +403,8 @@
}
- int replacementOffset = contentAssistRequest.getReplacementBeginPosition();
- int replacementLength = contentAssistRequest.getReplacementLength();
+ int replacementOffset = getOffset() - query.length();
+ int replacementLength = query.length();
int cursorPosition = getCursorPositionForProposedText(replacementString);
Image image = textProposal.getImage();
if (image == null) {
14 years, 5 months
JBoss Tools SVN: r25525 - in trunk/documentation/whatsnew: teiid and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2010-10-06 12:53:48 -0400 (Wed, 06 Oct 2010)
New Revision: 25525
Modified:
trunk/documentation/whatsnew/jst/jst-news-3.2.0.Beta1.html
trunk/documentation/whatsnew/teiid/teiid-news-7.1.0.Beta1.html
trunk/documentation/whatsnew/vpe/vpe-news-3.2.0.Beta1.html
Log:
Fixed mistyping issues and removed D&D for selected text article from vpe news.
Modified: trunk/documentation/whatsnew/jst/jst-news-3.2.0.Beta1.html
===================================================================
--- trunk/documentation/whatsnew/jst/jst-news-3.2.0.Beta1.html 2010-10-06 15:50:46 UTC (rev 25524)
+++ trunk/documentation/whatsnew/jst/jst-news-3.2.0.Beta1.html 2010-10-06 16:53:48 UTC (rev 25525)
@@ -64,7 +64,7 @@
<p><b>Code completion for getters/setters</b></p>
</td>
<td valign="top">
- <p>There are new options in Preferences to disable/enable code completion for getteres and setters in EL.</p>
+ <p>There are new options in Preferences to disable/enable code completion for getters and setters in EL.</p>
<img src="images/3.2.0.Beta1/preferences.png"/>
<p><small><a
href="https://jira.jboss.org/browse/JBIDE-6259">Related Jira</a></small></p>
Modified: trunk/documentation/whatsnew/teiid/teiid-news-7.1.0.Beta1.html
===================================================================
--- trunk/documentation/whatsnew/teiid/teiid-news-7.1.0.Beta1.html 2010-10-06 15:50:46 UTC (rev 25524)
+++ trunk/documentation/whatsnew/teiid/teiid-news-7.1.0.Beta1.html 2010-10-06 16:53:48 UTC (rev 25525)
@@ -78,7 +78,7 @@
<td valign="top" align="left">
<p><b>Authorization</b></p></td>
<td valign="top">
- <p><strong>In Beta1</strong> Teiid Designer's VDB Data Role Wizard includes an option to allow data
+ <p><strong>In Beta1</strong> Teiid Designer's VDB Data Role Wizard includes an option to allow
data access to ALL users defined in the deployed server location. By checking the "Apply this role to All Users"
the Mapped Role names panel is disabled and any previously entered mapped role names will be removed from this
data role.
Modified: trunk/documentation/whatsnew/vpe/vpe-news-3.2.0.Beta1.html
===================================================================
--- trunk/documentation/whatsnew/vpe/vpe-news-3.2.0.Beta1.html 2010-10-06 15:50:46 UTC (rev 25524)
+++ trunk/documentation/whatsnew/vpe/vpe-news-3.2.0.Beta1.html 2010-10-06 16:53:48 UTC (rev 25525)
@@ -62,25 +62,9 @@
</small></p>
</td>
</tr>
-
<tr>
<td colspan="2">
<hr />
- </td>
- </tr>
- <tr>
- <td valign="top" align="left"><b>D&D for selected text</b></td>
- <td valign="top">Possibility to D&D selected part of some text has been added.
- <p><img src="images/3.2.0.Beta1/text-dnd.png" alt="D&D selected text in Visual Part"/>
- </p>
- <p><small>
- <a href="https://jira.jboss.org/browse/JBIDE-6229">Related Jira</a>
- </small></p>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <hr />
<h3>Templates</h3>
<hr />
</td>
14 years, 5 months
JBoss Tools SVN: r25524 - in trunk: jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-10-06 11:50:46 -0400 (Wed, 06 Oct 2010)
New Revision: 25524
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.1
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.original
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/testElRevalidation.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6264
testRevalidationUnresolvedELs() moved from org.jboss.tools.seam.core.test to org.jboss.tools.jsf.test
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project 2010-10-06 13:52:08 UTC (rev 25523)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project 2010-10-06 15:50:46 UTC (rev 25524)
@@ -15,6 +15,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
@@ -22,5 +27,6 @@
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.jboss.tools.jsf.jsfnature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
</natures>
</projectDescription>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.1
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.1 (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.1 2010-10-06 15:50:46 UTC (rev 25524)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <component>
+ <description>Component Example.</description>
+ <display-name>Component c1</display-name>
+ <component-type>c1</component-type>
+ <component-class>javax.faces.component.UICommand</component-class>
+ <facet>
+ <description>Facet Example.</description>
+ <display-name>Facet f1</display-name>
+ <facet-name>f1</facet-name>
+ </facet>
+ <attribute>
+ <description>Attribute Example.</description>
+ <display-name>Attribute a1</display-name>
+ <attribute-name>a1</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ <default-value>v1</default-value>
+ <suggested-value>v2</suggested-value>
+ </attribute>
+ <property>
+ <description>Property Example.</description>
+ <display-name>Property p1</display-name>
+ <property-name>p1</property-name>
+ <property-class>java.lang.Integer</property-class>
+ <default-value>1</default-value>
+ <suggested-value>2</suggested-value>
+ </property>
+ </component>
+ <converter>
+ <description>Converter Example.</description>
+ <converter-id>c1</converter-id>
+ <converter-class>javax.faces.convert.LongConverter</converter-class>
+ <attribute>
+ <attribute-name>a2</attribute-name>
+ <attribute-class/>
+ </attribute>
+ <property>
+ <property-name>p2</property-name>
+ <property-class/>
+ </property>
+ </converter>
+ <converter>
+ <converter-for-class>demo.B</converter-for-class>
+ <converter-class>javax.faces.convert.LongConverter</converter-class>
+ </converter>
+ <managed-bean>
+ <description>Input Value Holder</description>
+ <managed-bean-name>user2</managed-bean-name>
+ <managed-bean-class>demo.User</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>name</property-name>
+ <property-class>java.lang.String</property-class>
+ <value/>
+ </managed-property>
+ <managed-property>
+ <property-name>aliases</property-name>
+ <property-class>java.util.List</property-class>
+ <list-entries>
+ <value-class>java.lang.String</value-class>
+ <null-value/>
+ <value>Red Hat</value>
+ </list-entries>
+ </managed-property>
+ </managed-bean>
+ <navigation-rule>
+ <from-view-id>/pages/inputname.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>greeting</from-outcome>
+ <to-view-id>/pages/greeting.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <render-kit>
+ <description>Render Kit Example.</description>
+ <display-name>Render Kit myRenderKit</display-name>
+ <render-kit-id>myRenderKit</render-kit-id>
+ <render-kit-class>com.sun.faces.renderkit.RenderKitImpl</render-kit-class>
+ <renderer>
+ <description>Renderer Example.</description>
+ <display-name>Renderer r1</display-name>
+ <component-family>command</component-family>
+ <renderer-type>r1</renderer-type>
+ <renderer-class>com.sun.faces.renderkit.html_basic.ButtonRenderer</renderer-class>
+ <facet>
+ <facet-name>f3</facet-name>
+ </facet>
+ <attribute>
+ <attribute-name>a3</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ </renderer>
+ </render-kit>
+ <validator>
+ <description>Validator Example.</description>
+ <display-name>Validator v1</display-name>
+ <validator-id>v1</validator-id>
+ <validator-class>javax.faces.validator.LengthValidator</validator-class>
+ <attribute>
+ <attribute-name>a4</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ <property>
+ <property-name>p4</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ </validator>
+ <application>
+ <action-listener>demo.ActionListenerImpl</action-listener>
+ <default-render-kit-id>myRenderKit</default-render-kit-id>
+ <navigation-handler>com.sun.faces.application.NavigationHandlerImpl</navigation-handler>
+ <view-handler>com.sun.faces.application.ViewHandlerImpl</view-handler>
+ <state-manager>com.sun.faces.application.StateManagerImpl</state-manager>
+ <message-bundle>demo.bundle.Messages</message-bundle>
+ <property-resolver>com.sun.faces.el.PropertyResolverImpl</property-resolver>
+ <variable-resolver>com.sun.faces.el.VariableResolverImpl</variable-resolver>
+ <locale-config>
+ <default-locale>en_US</default-locale>
+ <supported-locale>ru</supported-locale>
+ </locale-config>
+ </application>
+</faces-config>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.original
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.original (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.original 2010-10-06 15:50:46 UTC (rev 25524)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <component>
+ <description>Component Example.</description>
+ <display-name>Component c1</display-name>
+ <component-type>c1</component-type>
+ <component-class>javax.faces.component.UICommand</component-class>
+ <facet>
+ <description>Facet Example.</description>
+ <display-name>Facet f1</display-name>
+ <facet-name>f1</facet-name>
+ </facet>
+ <attribute>
+ <description>Attribute Example.</description>
+ <display-name>Attribute a1</display-name>
+ <attribute-name>a1</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ <default-value>v1</default-value>
+ <suggested-value>v2</suggested-value>
+ </attribute>
+ <property>
+ <description>Property Example.</description>
+ <display-name>Property p1</display-name>
+ <property-name>p1</property-name>
+ <property-class>java.lang.Integer</property-class>
+ <default-value>1</default-value>
+ <suggested-value>2</suggested-value>
+ </property>
+ </component>
+ <converter>
+ <description>Converter Example.</description>
+ <converter-id>c1</converter-id>
+ <converter-class>javax.faces.convert.LongConverter</converter-class>
+ <attribute>
+ <attribute-name>a2</attribute-name>
+ <attribute-class/>
+ </attribute>
+ <property>
+ <property-name>p2</property-name>
+ <property-class/>
+ </property>
+ </converter>
+ <converter>
+ <converter-for-class>demo.B</converter-for-class>
+ <converter-class>javax.faces.convert.LongConverter</converter-class>
+ </converter>
+ <managed-bean>
+ <description>Input Value Holder</description>
+ <managed-bean-name>user</managed-bean-name>
+ <managed-bean-class>demo.User</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>name</property-name>
+ <property-class>java.lang.String</property-class>
+ <value/>
+ </managed-property>
+ <managed-property>
+ <property-name>aliases</property-name>
+ <property-class>java.util.List</property-class>
+ <list-entries>
+ <value-class>java.lang.String</value-class>
+ <null-value/>
+ <value>Red Hat</value>
+ </list-entries>
+ </managed-property>
+ </managed-bean>
+ <navigation-rule>
+ <from-view-id>/pages/inputname.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>greeting</from-outcome>
+ <to-view-id>/pages/greeting.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <render-kit>
+ <description>Render Kit Example.</description>
+ <display-name>Render Kit myRenderKit</display-name>
+ <render-kit-id>myRenderKit</render-kit-id>
+ <render-kit-class>com.sun.faces.renderkit.RenderKitImpl</render-kit-class>
+ <renderer>
+ <description>Renderer Example.</description>
+ <display-name>Renderer r1</display-name>
+ <component-family>command</component-family>
+ <renderer-type>r1</renderer-type>
+ <renderer-class>com.sun.faces.renderkit.html_basic.ButtonRenderer</renderer-class>
+ <facet>
+ <facet-name>f3</facet-name>
+ </facet>
+ <attribute>
+ <attribute-name>a3</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ </renderer>
+ </render-kit>
+ <validator>
+ <description>Validator Example.</description>
+ <display-name>Validator v1</display-name>
+ <validator-id>v1</validator-id>
+ <validator-class>javax.faces.validator.LengthValidator</validator-class>
+ <attribute>
+ <attribute-name>a4</attribute-name>
+ <attribute-class>java.lang.String</attribute-class>
+ </attribute>
+ <property>
+ <property-name>p4</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ </validator>
+ <application>
+ <action-listener>demo.ActionListenerImpl</action-listener>
+ <default-render-kit-id>myRenderKit</default-render-kit-id>
+ <navigation-handler>com.sun.faces.application.NavigationHandlerImpl</navigation-handler>
+ <view-handler>com.sun.faces.application.ViewHandlerImpl</view-handler>
+ <state-manager>com.sun.faces.application.StateManagerImpl</state-manager>
+ <message-bundle>demo.bundle.Messages</message-bundle>
+ <property-resolver>com.sun.faces.el.PropertyResolverImpl</property-resolver>
+ <variable-resolver>com.sun.faces.el.VariableResolverImpl</variable-resolver>
+ <locale-config>
+ <default-locale>en_US</default-locale>
+ <supported-locale>ru</supported-locale>
+ </locale-config>
+ </application>
+</faces-config>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/testElRevalidation.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/testElRevalidation.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/testElRevalidation.xhtml 2010-10-06 15:50:46 UTC (rev 25524)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<!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:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.org/rich">
+ <rich:componentControl for="loginModalPanel" />
+ <rich:modalPanel id="loginModalPanel">
+ <f:facet name="controls">
+ <rich:componentControl for="loginModalPanel" />
+ </f:facet>
+ <ui:define name="body">
+ #{user}
+ </ui:define>
+ </rich:modalPanel>
+</ui:composition>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/testElRevalidation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-10-06 13:52:08 UTC (rev 25523)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-10-06 15:50:46 UTC (rev 25524)
@@ -14,12 +14,22 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.eclipse.wst.validation.Validator;
+import org.eclipse.wst.validation.internal.operations.ValidatorManager;
import org.jboss.tools.jsf.model.pv.test.JSFPromptingProviderTest;
import org.jboss.tools.jsf.test.refactoring.ELVariableRefactoringTest;
import org.jboss.tools.jsf.test.refactoring.JSF2RefactoringTest;
import org.jboss.tools.jsf.test.refactoring.MessagePropertyRefactoringTest;
+import org.jboss.tools.jsf.test.validation.ELValidatorTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsValidatorTest;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
public class JsfAllTests {
@@ -56,6 +66,17 @@
JSF2RefactoringTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
new String[] { "projects/JSF2ComponentsValidator" }, //$NON-NLS-1$
new String[] { "JSF2ComponentsValidator" })); //$NON-NLS-1$
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(ELValidatorTest.class),"org.jboss.tools.jsf.test","projects/JSFKickStartOldFormat","JSFKickStartOldFormat") {
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ IProject project = (IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("JSFKickStartOldFormat");
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ JobUtils.waitForIdle();
+
+ ValidatorManager.addProjectBuildValidationSupport(project);
+ }
+ } );
return new DisableJavaIndexingSetup(suite);
}
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-10-06 15:50:46 UTC (rev 25524)
@@ -0,0 +1,122 @@
+package org.jboss.tools.jsf.test.validation;
+
+import java.io.IOException;
+import java.text.MessageFormat;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.preferences.JSFSeverityPreferences;
+import org.jboss.tools.jsf.web.validation.JSFValidationMessages;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+public class ELValidatorTest extends AbstractResourceMarkerTest{
+ public static final String MARKER_TYPE = "org.eclipse.wst.validation.problemmarker";
+
+ protected void setUp() throws Exception {
+ JobUtils.waitForIdle();
+ IResource project = ResourcesPlugin.getWorkspace().getRoot().findMember("JSFKickStartOldFormat");
+ this.project = project.getProject();
+
+ this.project.build(IncrementalProjectBuilder.CLEAN_BUILD,
+ new NullProgressMonitor());
+
+ JobUtils.waitForIdle();
+ }
+
+ public void testUnknownELVariable() throws CoreException, ValidationException {
+
+ IPreferenceStore store = JSFModelPlugin.getDefault().getPreferenceStore();
+ store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, JSFSeverityPreferences.ENABLE);
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, JSFSeverityPreferences.ERROR);
+
+ copyContentsFile("WebContent/WEB-INF/faces-config.xml", "WebContent/WEB-INF/faces-config.1");
+
+ assertMarkerIsCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 13);
+
+ // Check if the validator was not invoked.
+ copyContentsFile("WebContent/WEB-INF/faces-config.xml", "WebContent/WEB-INF/faces-config.original");
+
+ assertMarkerIsNotCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 13);
+
+ store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, JSFSeverityPreferences.ENABLE);
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, JSFSeverityPreferences.IGNORE);
+ }
+
+ public void testRevalidationUnresolvedELs() throws CoreException, ValidationException{
+ IPreferenceStore store = JSFModelPlugin.getDefault().getPreferenceStore();
+ store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, JSFSeverityPreferences.DISABLE);
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, JSFSeverityPreferences.ERROR);
+
+ copyContentsFile("WebContent/WEB-INF/faces-config.xml", "WebContent/WEB-INF/faces-config.1");
+
+ assertMarkerIsCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 13);
+
+ // Check if the validator was not invoked.
+ copyContentsFile("WebContent/WEB-INF/faces-config.xml", "WebContent/WEB-INF/faces-config.original");
+
+ assertMarkerIsNotCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 13);
+
+ store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, JSFSeverityPreferences.ENABLE);
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, JSFSeverityPreferences.IGNORE);
+ }
+
+ private void assertMarkerIsCreatedForLine(String fileName, String template, Object[] parameters, int lineNumber) throws CoreException{
+ String messagePattern = MessageFormat.format(template, parameters);
+ IFile file = project.getFile(fileName);
+
+ ValidationFramework.getDefault().validate(file, new NullProgressMonitor());
+
+ IMarker[] markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
+ for (int i = 0; i < markers.length; i++) {
+ String message = markers[i].getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
+ int line = markers[i].getAttribute(IMarker.LINE_NUMBER, -1); //$NON-NLS-1$
+ if(message.equals(messagePattern) && line == lineNumber)
+ return;
+ }
+ fail("Marker "+messagePattern+" for line - "+lineNumber+" not found");
+ }
+
+ private void assertMarkerIsNotCreatedForLine(String fileName, String template, Object[] parameters, int lineNumber) throws CoreException{
+ String messagePattern = MessageFormat.format(template, parameters);
+ IFile file = project.getFile(fileName);
+
+ ValidationFramework.getDefault().validate(file, new NullProgressMonitor());
+
+ IMarker[] markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
+ for (int i = 0; i < markers.length; i++) {
+ String message = markers[i].getAttribute(IMarker.MESSAGE, ""); //$NON-NLS-1$
+ int line = markers[i].getAttribute(IMarker.LINE_NUMBER, -1); //$NON-NLS-1$
+ if(message.equals(messagePattern) && line == lineNumber){
+ fail("Marker "+messagePattern+" for line - "+lineNumber+" has been found");
+ }
+ }
+
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.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-10-06 13:52:08 UTC (rev 25523)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2010-10-06 15:50:46 UTC (rev 25524)
@@ -51,8 +51,6 @@
public class SeamValidatorsTest extends AbstractResourceMarkerTest {
- IProject project = null;
-
public static SeamMarkerFilter SEAM_MARKER_FILTER = new SeamMarkerFilter();
public SeamValidatorsTest() {
@@ -83,42 +81,6 @@
}
- private void copyContentsFile(String originalName, String newContentName) throws CoreException{
- IFile originalFile = project.getFile(originalName);
- IFile newContentFile = project.getFile(newContentName);
-
- copyContentsFile(originalFile, newContentFile);
- }
-
- private void copyContentsFile(IFile originalFile, String newContentName) throws CoreException{
- IFile newContentFile = project.getFile(newContentName);
- copyContentsFile(originalFile, newContentFile);
- }
-
- private void copyContentsFile(IFile originalFile, IFile newContentFile) throws CoreException{
- PageContextFactory.getInstance().cleanUp(originalFile);
- InputStream is = null;
- try{
- is = newContentFile.getContents();
- originalFile.setContents(is, true, false, null);
- } finally {
- if(is!=null) {
- try {
- is.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- JobUtils.waitForIdle();
- originalFile.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, "org.eclipse.jdt.internal.core.builder.JavaBuilder", null, null);
- JobUtils.waitForIdle();
- originalFile.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, SeamCoreBuilder.BUILDER_ID, null, null);
-// originalFile.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
- JobUtils.waitForIdle();
- }
-
private ISeamProject getSeamProject(IProject project) {
refreshProject(project);
@@ -806,36 +768,6 @@
}
- // See https://jira.jboss.org/jira/browse/JBIDE-4515
- public void testRevalidationUnresolvedELs() throws CoreException, ValidationException {
- JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, SeamPreferences.ENABLE);
- JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, SeamPreferences.ERROR);
-
- copyContentsFile("src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.java", "src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.new");
-
- assertMarkerIsCreatedForLine(
- new ELValidatorWrapper(project),
- "WebContent/testElRevalidation.xhtml",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
- new Object[] {"testElRevalidation"},
- 6);
-
- JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, SeamPreferences.DISABLE);
-
- // Check if the validator was not invoked.
- copyContentsFile("src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.java", "src/action/org/domain/SeamWebWarTestProject/entity/TestElRevalidation.original");
-
- assertMarkerIsCreatedForLine(
- new ELValidatorWrapper(project),
- "WebContent/testElRevalidation.xhtml",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
- new Object[] {"testElRevalidation"},
- 6);
-
- JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL, SeamPreferences.ENABLE);
- JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, SeamPreferences.IGNORE);
- }
-
// See https://jira.jboss.org/browse/JBIDE-6352
public void testErrorMarkerForEL() throws CoreException, ValidationException{
assertMarkerIsCreatedForLine(
Modified: trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-10-06 13:52:08 UTC (rev 25523)
+++ trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-10-06 15:50:46 UTC (rev 25524)
@@ -10,15 +10,21 @@
******************************************************************************/
package org.jboss.tools.tests;
+import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
/**
* @author eskimo
@@ -27,6 +33,8 @@
public class AbstractResourceMarkerTest extends TestCase {
public static final String MARKER_TYPE = "org.eclipse.wst.validation.problemmarker";
+
+ protected IProject project = null;
/**
*
@@ -40,7 +48,38 @@
public AbstractResourceMarkerTest(String name) {
super(name);
}
+
+ protected void copyContentsFile(String originalName, String newContentName) throws CoreException{
+ IFile originalFile = project.getFile(originalName);
+ IFile newContentFile = project.getFile(newContentName);
+
+ copyContentsFile(originalFile, newContentFile);
+ }
+
+ protected void copyContentsFile(IFile originalFile, String newContentName) throws CoreException{
+ IFile newContentFile = project.getFile(newContentName);
+ copyContentsFile(originalFile, newContentFile);
+ }
+ protected void copyContentsFile(IFile originalFile, IFile newContentFile) throws CoreException{
+ InputStream is = null;
+ try{
+ is = newContentFile.getContents();
+ originalFile.setContents(is, true, false, null);
+ } finally {
+ if(is!=null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ originalFile.getProject().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, null);
+ JobUtils.waitForIdle();
+ }
+
+
public static int findMarkerLine(IResource resource, String type, String errorMessage, boolean pattern)
throws CoreException {
int number = -1;
14 years, 5 months
JBoss Tools SVN: r25523 - in trunk/usage: tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-06 09:52:08 -0400 (Wed, 06 Oct 2010)
New Revision: 25523
Modified:
trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/eclipse/LinuxSystem.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/LinuxSystemTest.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/LinuxSystemFake.java
trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java
Log:
[JBIDE-7268] changed checking order: checking ubuntu prior to debian (no other reliable variant known to me so far)
Modified: trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/eclipse/LinuxSystem.java
===================================================================
--- trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/eclipse/LinuxSystem.java 2010-10-06 13:35:53 UTC (rev 25522)
+++ trunk/usage/plugins/org.jboss.tools.usage/src/org/jboss/tools/usage/googleanalytics/eclipse/LinuxSystem.java 2010-10-06 13:52:08 UTC (rev 25523)
@@ -28,6 +28,7 @@
* href="http://superuser.com/questions/11008/how-do-i-find-out-what-version-of-li...">
* release-file strings</a>
*/
+
public final LinuxDistro CENTOS = new CentOSDistro("CentOS", "/etc/redhat-release");
public final LinuxDistro DEBIAN = new LinuxDistro("Debian", "/etc/debian_version");
public final LinuxDistro FEDORA = new LinuxDistro("Fedora", "/etc/fedora-release");
@@ -44,6 +45,21 @@
private final LinuxDistro[] ALL = new LinuxDistro[] {
CENTOS,
+ /**
+ * Attention: ubuntu has 2 release files
+ * <ul>
+ * <li>/etc/lsb-release</li>
+ * <li>/etc/debian_version</li>
+ * </ul>
+ *
+ * It is not reliable to check Debian first and check there if no
+ * /etc/lsb-release exists. Debian may also have a /etc/lsb-release. We must
+ * check ubuntu prior to Debian.
+ *
+ * @see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=444678
+ *
+ */
+ UBUNTU,
DEBIAN,
FEDORA,
GENTOO,
@@ -54,7 +70,6 @@
REDHAT,
SLACKWARE,
SUSE,
- UBUNTU,
YELLOWDOG
};
@@ -76,7 +91,7 @@
return "";
}
}
-
+
protected class CentOSDistro extends LinuxDistro {
private static final String CENTOS_NAME = "CentOS";
@@ -138,16 +153,16 @@
public String getNameAndVersion() {
return new StringBuilder().append(getName()).append(" ").append(getVersion()).toString();
}
-
+
public String getReleaseFilePath() {
return releaseFilePath;
}
}
-
+
protected boolean exists(String releaseFilePath) {
- return new File(releaseFilePath).exists();
+ return new File(releaseFilePath).exists();
}
-
+
protected String getDistroFileContent(String filePath) throws IOException {
int charachtersToRead = 1024;
StringBuilder builder = new StringBuilder(charachtersToRead);
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/LinuxSystemTest.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/LinuxSystemTest.java 2010-10-06 13:35:53 UTC (rev 25522)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/LinuxSystemTest.java 2010-10-06 13:52:08 UTC (rev 25523)
@@ -13,41 +13,54 @@
import org.jboss.tools.usage.googleanalytics.eclipse.LinuxSystem;
import org.jboss.tools.usage.test.fakes.LinuxSystemFake;
+import org.jboss.tools.usage.test.fakes.LinuxSystemFake.ReleaseFile;
import org.junit.Test;
public class LinuxSystemTest {
@Test
public void canExtractFedoraVersion() {
- LinuxSystem linuxSystem = new LinuxSystemFake(LinuxSystem.INSTANCE.FEDORA.getReleaseFilePath(), "Fedora release 13 (Goddard)");
+ LinuxSystem linuxSystem = new LinuxSystemFake(
+ new ReleaseFile(LinuxSystem.INSTANCE.FEDORA.getReleaseFilePath(), "Fedora release 13 (Goddard)"));
assertEquals("Fedora 13", linuxSystem.getDistroNameAndVersion());
}
+ /**
+ * Ubuntu has 2 release files!
+ * <ul>
+ * <li>/etc/lsb-release</li>
+ * <li>/etc/debian_version</li>
+ * </ul>
+ */
@Test
public void canExtractUbuntuVersion() {
- LinuxSystem linuxSystem = new LinuxSystemFake(LinuxSystem.INSTANCE.UBUNTU.getReleaseFilePath(),
- "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=9.04\nDISTRIB_CODENAME=jaunty\nDISTRIB_DESCRIPTION=\"Ubuntu 9.04\"");
+ LinuxSystem linuxSystem = new LinuxSystemFake(
+ new ReleaseFile(
+ LinuxSystem.INSTANCE.UBUNTU.getReleaseFilePath(),
+ "DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=9.04\nDISTRIB_CODENAME=jaunty\nDISTRIB_DESCRIPTION=\"Ubuntu 9.04\"")
+ , new ReleaseFile(LinuxSystem.INSTANCE.DEBIAN.getReleaseFilePath(), "squeeze/sid"));
assertEquals("Ubuntu 9.04", linuxSystem.getDistroNameAndVersion());
}
@Test
public void canExtractRedHatVersion() {
- LinuxSystem linuxSystem = new LinuxSystemFake(LinuxSystem.INSTANCE.REDHAT.getReleaseFilePath(),
- "Red Hat Enterprise Linux Workstation release 6.0 (Santiago)");
+ LinuxSystem linuxSystem = new LinuxSystemFake(
+ new ReleaseFile(LinuxSystem.INSTANCE.REDHAT.getReleaseFilePath(),
+ "Red Hat Enterprise Linux Workstation release 6.0 (Santiago)"));
assertEquals("RedHat 6.0", linuxSystem.getDistroNameAndVersion());
}
@Test
public void canExtractGentooVersion() {
- LinuxSystem linuxSystem = new LinuxSystemFake(LinuxSystem.INSTANCE.GENTOO.getReleaseFilePath(),
- "Gentoo Base System release 2.0.1");
+ LinuxSystem linuxSystem = new LinuxSystemFake(
+ new ReleaseFile(LinuxSystem.INSTANCE.GENTOO.getReleaseFilePath(), "Gentoo Base System release 2.0.1"));
assertEquals("Gentoo 2.0.1", linuxSystem.getDistroNameAndVersion());
}
-
+
@Test
public void canExtractCentOSVersion() {
- LinuxSystem linuxSystem = new LinuxSystemFake(LinuxSystem.INSTANCE.CENTOS.getReleaseFilePath(),
- "CentOS release 5.3 (Final)");
+ LinuxSystem linuxSystem = new LinuxSystemFake(
+ new ReleaseFile(LinuxSystem.INSTANCE.CENTOS.getReleaseFilePath(), "CentOS release 5.3 (Final)"));
assertEquals("CentOS 5.3", linuxSystem.getDistroNameAndVersion());
}
}
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/LinuxSystemFake.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/LinuxSystemFake.java 2010-10-06 13:35:53 UTC (rev 25522)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/LinuxSystemFake.java 2010-10-06 13:52:08 UTC (rev 25523)
@@ -28,23 +28,50 @@
*/
public class LinuxSystemFake extends LinuxSystem {
- private String releaseFilePath;
+ /** release file paths on the faked system */
+ private ReleaseFile[] releaseFiles;
- private String releaseFileContent;
-
- public LinuxSystemFake(String releaseFilePath, String releaseFileContent) {
- super();
- this.releaseFilePath = releaseFilePath;
- this.releaseFileContent = releaseFileContent;
+ public LinuxSystemFake(ReleaseFile... releaseFiles) {
+ this.releaseFiles = releaseFiles;
}
@Override
protected boolean exists(String releaseFilePath) {
- return this.releaseFilePath.equals(releaseFilePath);
+ for (ReleaseFile releaseFile : releaseFiles) {
+ if(releaseFile.getPath().equals(releaseFilePath)) {
+ return true;
+ }
+ }
+ return false;
}
@Override
protected String getDistroFileContent(String filePath) throws IOException {
- return releaseFileContent;
+ for (ReleaseFile releaseFile : releaseFiles) {
+ if (releaseFile.getPath().equals(filePath)) {
+ return releaseFile.getContent();
+ }
+ }
+ return null;
}
+
+ public static class ReleaseFile {
+ private String path;
+ private String content;
+
+ public ReleaseFile(String path, String content) {
+ this.path = path;
+ this.content = content;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getContent() {
+ return content;
+ }
+ }
+
+
}
\ No newline at end of file
Modified: trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java
===================================================================
--- trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java 2010-10-06 13:35:53 UTC (rev 25522)
+++ trunk/usage/tests/org.jboss.tools.usage.test/src/org/jboss/tools/usage/test/fakes/ReportingEclipseEnvironmentFake.java 2010-10-06 13:52:08 UTC (rev 25523)
@@ -11,15 +11,16 @@
package org.jboss.tools.usage.test.fakes;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.jboss.tools.usage.googleanalytics.eclipse.IEclipseUserAgent;
import org.jboss.tools.usage.googleanalytics.eclipse.LinuxSystem;
-import org.jboss.tools.usage.googleanalytics.eclipse.IEclipseUserAgent;
import org.jboss.tools.usage.internal.reporting.JBossToolsEclipseEnvironment;
+import org.jboss.tools.usage.test.fakes.LinuxSystemFake.ReleaseFile;
/**
* @author Andre Dietisheim
*/
public class ReportingEclipseEnvironmentFake extends JBossToolsEclipseEnvironment {
-
+
public static final String GANALYTICS_ACCOUNTNAME = "UA-17645367-1";
public static final String HOSTNAME = "jboss.org";
public static final String JAVA_VERSION = "1.6.0_20";
@@ -70,6 +71,6 @@
@Override
protected String getLinuxDistroNameAndVersion() {
- return new LinuxSystemFake(LinuxSystem.INSTANCE.FEDORA.getName(), "Fedora release 13 (Goddard)").getDistroNameAndVersion();
+ return new LinuxSystemFake(new ReleaseFile(LinuxSystem.INSTANCE.FEDORA.getReleaseFilePath(), "Fedora release 13 (Goddard)")).getDistroNameAndVersion();
}
}
14 years, 5 months
JBoss Tools SVN: r25522 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-06 09:35:53 -0400 (Wed, 06 Oct 2010)
New Revision: 25522
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
JBIDE-6398
https://jira.jboss.org/browse/JBIDE-6398
Since kb builder is turned off, page context cleaning is added.
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-10-06 13:13:01 UTC (rev 25521)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2010-10-06 13:35:53 UTC (rev 25522)
@@ -28,6 +28,7 @@
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.preferences.JSFSeverityPreferences;
import org.jboss.tools.jsf.web.validation.JSFValidationMessages;
+import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.jst.web.kb.validation.IValidator;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentMethod;
@@ -95,6 +96,7 @@
}
private void copyContentsFile(IFile originalFile, IFile newContentFile) throws CoreException{
+ PageContextFactory.getInstance().cleanUp(originalFile);
InputStream is = null;
try{
is = newContentFile.getContents();
14 years, 5 months