JBoss Tools SVN: r8874 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-06-20 12:22:02 -0400 (Fri, 20 Jun 2008)
New Revision: 8874
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2390
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-06-20 13:38:15 UTC (rev 8873)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-06-20 16:22:02 UTC (rev 8874)
@@ -461,7 +461,15 @@
//when update visual editor job is running, we shoud ignore this
//exception
break;
- }
+ } catch (NullPointerException ex) {
+
+ if(switcher!=null ) {
+ throw ex;
+ } else {
+ //class was disposed and exception result of that we can't stop
+ //refresh job in time, so we just ignore this exception
+ }
+ }
getChangeEvents().remove(eventBean);
}
monitor.done();
@@ -1597,6 +1605,16 @@
monitor.beginTask(VpeUIMessages.VPE_VISUAL_REFRESH_JOB, IProgressMonitor.UNKNOWN);
visualRefreshImpl();
monitor.done();
+ } catch (VpeDisposeException exc) {
+ //just ignore this exception
+ } catch (NullPointerException ex) {
+
+ if(switcher!=null ) {
+ throw ex;
+ } else {
+ //class was disposed and exception result of that we can't stop
+ //refresh job in time, so we just ignore this exception
+ }
} finally {
if(switcher!=null) {
17 years, 6 months
JBoss Tools SVN: r8873 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-06-20 09:38:15 -0400 (Fri, 20 Jun 2008)
New Revision: 8873
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
Log:
Fix bug:http://jira.jboss.com/jira/browse/JBIDE-2392
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-06-20 13:15:08 UTC (rev 8872)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-06-20 13:38:15 UTC (rev 8873)
@@ -435,7 +435,7 @@
</vpe:template>
</vpe:if>
<vpe:if
- test="hasinparents('h:selectManyListbox')|hasinparents('h:selectManyMenu')|hasinparents('h:selectOneListbox')|hasinparents('h:selectOneMenu')">
+ test="hasinparents('h:selectManyListbox')|hasinparents('h:selectManyMenu')|hasinparents('h:selectOneListbox')|hasinparents('h:selectOneMenu')|hasinparents('rich:pickList')">
<vpe:template children="yes" modify="yes"
class="org.jboss.tools.jsf.vpe.jsf.template.JsfOptionSelectItemTemplate">
</vpe:template>
@@ -502,7 +502,8 @@
hasinparents('h:selectManyListbox')|
hasinparents('h:selectOneMenu')|
hasinparents('h:selectManyMenu')|
- hasinparents('x:selectOneMenu')">
+ hasinparents('x:selectOneMenu')|
+ hasinparents('rich:pickList')">
<!-- Gavr -->
<vpe:template children="no" modify="yes">
<option value="{@itemValue}" title="{tagstring()}">
17 years, 6 months
JBoss Tools SVN: r8872 - in trunk/jsf/tests/org.jboss.tools.jsf.test: projects/JSFKickStartOldFormat/.settings and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-06-20 09:15:08 -0400 (Fri, 20 Jun 2008)
New Revision: 8872
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/BaseBean.java
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/User.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.settings/org.eclipse.wst.common.component
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.settings/org.jboss.tools.jst.web.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFImportTest.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java
Log:
Since JSFKickStart1 was removed, tests using it failed.
I have replaced references to it with JSFKickStartOldFormat,
which earlier was created as its copy.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project 2008-06-20 12:33:01 UTC (rev 8871)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.project 2008-06-20 13:15:08 UTC (rev 8872)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>JSFKickStart1</name>
+ <name>JSFKickStartOldFormat</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.settings/org.eclipse.wst.common.component 2008-06-20 12:33:01 UTC (rev 8871)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.settings/org.eclipse.wst.common.component 2008-06-20 13:15:08 UTC (rev 8872)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
-<wb-module deploy-name="JSFKickStart1">
+<wb-module deploy-name="JSFKickStartOldFormat">
<wb-resource deploy-path="/" source-path="/WebContent"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/JavaSource"/>
-<property name="context-root" value="JSFKickStart1"/>
+<property name="context-root" value="JSFKickStartOldFormat"/>
<property name="java-output-path" value="build/classes"/>
</wb-module>
</project-modules>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.settings/org.jboss.tools.jst.web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.settings/org.jboss.tools.jst.web.xml 2008-06-20 12:33:01 UTC (rev 8871)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/.settings/org.jboss.tools.jst.web.xml 2008-06-20 13:15:08 UTC (rev 8872)
@@ -30,7 +30,7 @@
<FILESYSTEM ENTITY="FileSystemJar" INFO="hidden=yes"
LOCATION="%redhat.workspace%/lib/standard.jar" NAME="lib-standard.jar"/>
<FILESYSTEM ENTITY="FileSystemFolder"
- LOCATION="%eclipse.project%" NAME="JSFKickStart1"/>
+ LOCATION="%eclipse.project%" NAME="JSFKickStartOldFormat"/>
<WEB ENTITY="JstWeb" MODEL_PATH="/web.xml" SERVLET_VERSION="2.4">
<MODULE ENTITY="WebJSFModule" MODEL_PATH="/faces-config.xml"
ROOT="WEB-ROOT" SRC="src" URI="/WEB-INF/faces-config.xml"/>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/BaseBean.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/BaseBean.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/BaseBean.java 2008-06-20 13:15:08 UTC (rev 8872)
@@ -0,0 +1,11 @@
+package demo;
+
+public class BaseBean {
+
+ public String getParent() {
+ return "";
+ }
+
+ public void fuck() {}
+
+}
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/User.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/User.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/User.java 2008-06-20 13:15:08 UTC (rev 8872)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package demo;
+
+/**
+ * Created by JBoss Developer Studio
+ */
+public class User extends BaseBean {
+
+ private String name;
+
+ /**
+ * @return User Name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param User Name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void getX1() {
+
+ }
+
+ public String getX2(int i) {
+ return "";
+ }
+
+ public void setX3(int i, int j) {
+
+ }
+}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web.xml 2008-06-20 12:33:01 UTC (rev 8871)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/web.xml 2008-06-20 13:15:08 UTC (rev 8872)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <display-name>JSFKickStart1</display-name>
+ <display-name>JSFKickStartOldFormat</display-name>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java 2008-06-20 12:33:01 UTC (rev 8871)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java 2008-06-20 13:15:08 UTC (rev 8872)
@@ -27,7 +27,7 @@
public JSFBeansTest() {}
public void setUp() throws CoreException {
- provider = new TestProjectProvider("org.jboss.tools.jsf.test", null, "JSFKickStart1", false);
+ provider = new TestProjectProvider("org.jboss.tools.jsf.test", null, "JSFKickStartOldFormat", false);
project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFImportTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFImportTest.java 2008-06-20 12:33:01 UTC (rev 8871)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFImportTest.java 2008-06-20 13:15:08 UTC (rev 8872)
@@ -25,7 +25,7 @@
File projectLocation = null;
public void setUp() throws Exception {
- init("org.jboss.tools.jsf.test", "/projects", "JSFKickStart1");
+ init("org.jboss.tools.jsf.test", "/projects", "JSFKickStartOldFormat");
}
public void testImportWithoutLinks() {
@@ -46,7 +46,7 @@
JUnitUtils.fail("Error in import operation", ex);
}
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("JSFKickStart1");
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("JSFKickStartOldFormat");
assertTrue("Project was not loaded", p != null);
File f = new File(p.getLocation().toFile(), ".project");
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java 2008-06-20 12:33:01 UTC (rev 8871)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFModelTest.java 2008-06-20 13:15:08 UTC (rev 8872)
@@ -34,7 +34,7 @@
public JSFModelTest() {}
public void setUp() throws Exception {
- provider = new TestProjectProvider("org.jboss.tools.jsf.test", null, "JSFKickStart1", false);
+ provider = new TestProjectProvider("org.jboss.tools.jsf.test", null, "JSFKickStartOldFormat", false);
project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
17 years, 6 months
JBoss Tools SVN: r8871 - branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-06-20 08:33:01 -0400 (Fri, 20 Jun 2008)
New Revision: 8871
Modified:
branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
Fixed JUnit test
Modified: branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-06-20 12:28:01 UTC (rev 8870)
+++ branches/jbosstools-2.1.x/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-06-20 12:33:01 UTC (rev 8871)
@@ -290,7 +290,7 @@
assertFalse("Problem marker 'Component class does not contain setter for property' not found' not found' not found", number == 0);
messages = getMarkersMessage(componentsFile);
- assertTrue("Problem marker 'Component class does not contain setter for property' not found", "Class \"StatefulComponent\" of component \"statefulComponent\" does not contain setter for property \"abc\"".equals(messages[0]));
+ assertTrue("Problem marker 'Component class does not have a setter or a field for the property' not found", "Class \"StatefulComponent\" of component \"statefulComponent\" does not have a setter or a field for the property \"abc\"".equals(messages[0]));
lineNumbers = getMarkersNumbersOfLine(componentsFile);
17 years, 6 months
JBoss Tools SVN: r8870 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-06-20 08:28:01 -0400 (Fri, 20 Jun 2008)
New Revision: 8870
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java
Log:
JBIDE-2353
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java 2008-06-20 12:27:29 UTC (rev 8869)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java 2008-06-20 12:28:01 UTC (rev 8870)
@@ -121,6 +121,9 @@
wizardStep.setDescription(null);
if(message == null && !isFinishEnabled) {
message = support.getMessage(support.getStepId());
+ if(message != null && message.trim().length() == 0) {
+ message = null;
+ }
}
wizardStep.setErrorMessage(message);
}
17 years, 6 months
JBoss Tools SVN: r8869 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-06-20 08:27:29 -0400 (Fri, 20 Jun 2008)
New Revision: 8869
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
Fixed JUnit test
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-06-20 12:00:41 UTC (rev 8868)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-06-20 12:27:29 UTC (rev 8869)
@@ -290,7 +290,7 @@
assertFalse("Problem marker 'Component class does not contain setter for property' not found' not found' not found", number == 0);
messages = getMarkersMessage(componentsFile);
- assertTrue("Problem marker 'Component class does not contain setter for property' not found", "Class \"StatefulComponent\" of component \"statefulComponent\" does not contain setter for property \"abc\"".equals(messages[0]));
+ assertTrue("Problem marker 'Component class does not have a setter or a field for the property' not found", "Class \"StatefulComponent\" of component \"statefulComponent\" does not have a setter or a field for the property \"abc\"".equals(messages[0]));
lineNumbers = getMarkersNumbersOfLine(componentsFile);
17 years, 6 months
JBoss Tools SVN: r8868 - trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/help.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-06-20 08:00:41 -0400 (Fri, 20 Jun 2008)
New Revision: 8868
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/help/keys-seam-pages.properties
Log:
JBIDE-2353
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/help/keys-seam-pages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/help/keys-seam-pages.properties 2008-06-20 11:39:28 UTC (rev 8867)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/help/keys-seam-pages.properties 2008-06-20 12:00:41 UTC (rev 8868)
@@ -176,8 +176,8 @@
SeamPagesDiagramItem_CreateComment.Title=Comment
SeamPagesDiagramItem_Rename_0.WindowTitle=Rename
-SeamPagesDiagramItem_Rename_0.Title=
-SeamPagesDiagramItem_Rename_0.Message=
+SeamPagesDiagramItem_Rename_0.Title=Seam Page
+SeamPagesDiagramItem_Rename_0.Message=Enter new view ID.
SeamPagesDiagramItem_Properties.Title=Seam Pages Diagram Item
17 years, 6 months
JBoss Tools SVN: r8867 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-06-20 07:39:28 -0400 (Fri, 20 Jun 2008)
New Revision: 8867
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java
Log:
JBIDE-2353
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java 2008-06-20 10:58:55 UTC (rev 8866)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java 2008-06-20 11:39:28 UTC (rev 8867)
@@ -110,6 +110,7 @@
if(validator == null) return;
validator.validate(data);
String message = validator.getErrorMessage();
+ isFinishEnabled = validator.isCommandEnabled(SpecialWizardSupport.FINISH);
DefaultStandardStep wizardStep = steps[support.getStepId()];
if(wizardStep != null && !wizardStep.isDataChanged()) {
String m = support.getMessage(support.getStepId());
@@ -118,9 +119,11 @@
wizardStep.setErrorMessage(null);
} else {
wizardStep.setDescription(null);
+ if(message == null && !isFinishEnabled) {
+ message = support.getMessage(support.getStepId());
+ }
wizardStep.setErrorMessage(message);
}
- isFinishEnabled = validator.isCommandEnabled(SpecialWizardSupport.FINISH);
boolean isNextEnabled = validator.isCommandEnabled(SpecialWizardSupport.NEXT);
wizardStep.isNextEnabled = isNextEnabled;
getContainer().updateButtons();
17 years, 6 months
JBoss Tools SVN: r8866 - trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-06-20 06:58:55 -0400 (Fri, 20 Jun 2008)
New Revision: 8866
Modified:
trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
Log:
JBIDE-2323: add unit test for commands
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF 2008-06-20 10:58:27 UTC (rev 8865)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/META-INF/MANIFEST.MF 2008-06-20 10:58:55 UTC (rev 8866)
@@ -23,5 +23,7 @@
org.eclipse.emf.common,
org.eclipse.jem,
org.eclipse.emf.ecore,
- org.eclipse.wst.server.core
+ org.eclipse.wst.server.core,
+ org.eclipse.debug.core,
+ org.jboss.tools.common
Eclipse-LazyStart: true
17 years, 6 months
JBoss Tools SVN: r8865 - trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-06-20 06:58:27 -0400 (Fri, 20 Jun 2008)
New Revision: 8865
Modified:
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java
Log:
JBIDE-2323: add unit test for commands
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java 2008-06-20 10:58:15 UTC (rev 8864)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java 2008-06-20 10:58:27 UTC (rev 8865)
@@ -11,11 +11,16 @@
package org.jboss.tools.ws.core.test.command;
import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
import java.util.HashSet;
import java.util.Set;
import junit.framework.TestCase;
+import org.apache.commons.httpclient.util.HttpURLConnection;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -24,6 +29,10 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jst.j2ee.internal.deployables.J2EEDeployableFactory;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.j2ee.model.ModelProviderManager;
import org.eclipse.jst.j2ee.webapplication.ServletType;
@@ -32,14 +41,23 @@
import org.eclipse.jst.javaee.web.WebApp;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.eclipse.wst.ws.internal.wsrt.IWebService;
import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo;
import org.eclipse.wst.ws.internal.wsrt.WebServiceScenario;
@@ -57,7 +75,7 @@
import org.jboss.tools.ws.creation.core.data.ServiceModel;
import org.jboss.tools.ws.creation.ui.wsrt.JBossWebService;
-import com.sun.jmx.remote.internal.ServerCommunicatorAdmin;
+import sun.net.www.http.HttpClient;
public class AbstractJBossWSCommandTest extends TestCase {
protected static final IWorkspace ws = ResourcesPlugin.getWorkspace();
@@ -65,10 +83,11 @@
- protected static final String JBOSSWS_HOME = "jbosstools.test.jbossws.eap.home";
- protected static final String JBOSSWS_HOME_DEFAULT = "/home/fugang/jboss-all/jboss-4.2.2.GA";
+ protected static final String JBOSSWS_HOME_DEFAULT = "/home/fugang/jboss-all/jboss-4.2.1.GA";
+ public static final String JBOSS_RUNTIME_42 = "org.jboss.ide.eclipse.as.runtime.42";
+ public static final String JBOSS_AS_42_HOME = System.getProperty(JBOSS_RUNTIME_42, JBOSSWS_HOME_DEFAULT);
+ public static final String JBOSS_SERVER_42 = "org.jboss.ide.eclipse.as.42";
-
protected final Set<IResource> resourcesToCleanup = new HashSet<IResource>();
protected static final IProjectFacetVersion dynamicWebVersion;
@@ -83,6 +102,8 @@
IFacetedProject fproject;
TestProjectProvider provider;
+ private IRuntime currentRuntime;
+ private IServer currentServer;
static {
javaVersion = ProjectFacetsManager.getProjectFacet("jst.java").getVersion("5.0");
@@ -106,6 +127,9 @@
fproject = createJBossWSProject("JBossWSTestProject", isServerSupplied());
IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+
+ createServer(JBOSS_RUNTIME_42, JBOSS_SERVER_42, JBOSS_AS_42_HOME, "default");
+
assertTrue(wsdlFile.exists());
try { EditorTestHelper.joinBackgroundActivities(); }
catch (Exception e) { JUnitUtils.fail(e.getMessage(), e); }
@@ -142,6 +166,10 @@
resourcesToCleanup.clear();
JbossWSRuntime runtime = JbossWSRuntimeManager.getInstance().findRuntimeByName(RuntimeName);
JbossWSRuntimeManager.getInstance().removeRuntime(runtime);
+
+ //cleanProjectFromServer() ;
+ currentServer.delete();
+
super.tearDown();
}
@@ -240,10 +268,85 @@
assertEquals("url pattern: ","/Greeter", mapping.getUrlPattern());
assertEquals("Greeter", mapping.getServlet().getServletName());
}
+ //ServerType d; d.createServer(id, file, monitor)
+ }
+
+ public void remove_testDeployResult() throws ExecutionException, CoreException, IOException{
+ currentServer.start(ILaunchManager.RUN_MODE, new NullProgressMonitor());
+ IFile wsdlFile = fproject.getProject().getFile(wsdlFileName);
+ ServiceModel model = new ServiceModel();
+ model.setWebProjectName(fproject.getProject().getName());
+ //model.setWsdlURI(wsdlFile.getLocation().toOSString());
+
+
+ WebServiceInfo info = new WebServiceInfo();
+ info.setWsdlURL(wsdlFile.getLocation().toOSString());
+ IWebService ws = new JBossWebService(info);
+
+ //test initial command
+ AbstractDataModelOperation cmd = new InitialCommand(model, ws, WebServiceScenario.TOPDOWN);
+ IStatus status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ cmd = new WSDL2JavaCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ cmd = new ImplementationClassCreationCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ cmd = new MergeWebXMLCommand(model);
+ status = cmd.execute(null, null);
+ assertTrue(status.getMessage(), status.isOK());
+
+ fproject.getProject().refreshLocal(0, null);
+ publishWebProject();
+
+ String webServiceUrl = "http://localhost:8080/JBossWSTestProject/IHelloWorld?wsdl";
+ URL url = new URL(webServiceUrl);
+ URLConnection conn = url.openConnection();
+ assertEquals(currentServer.getServerState(), currentServer.STATE_STARTED);
+ conn.connect();
+ conn.getHeaderFields();
+
+
}
+
+ protected void createServer(String runtimeID, String serverID,
+ String location, String configuration) throws CoreException {
+ // if file doesnt exist, abort immediately.
+ assertTrue(new Path(location).toFile().exists());
+
+ currentRuntime = createRuntime(runtimeID, location, configuration);
+ IServerType serverType = ServerCore.findServerType(serverID);
+ IServerWorkingCopy serverWC = serverType.createServer(null, null,
+ new NullProgressMonitor());
+ serverWC.setRuntime(currentRuntime);
+ serverWC.setName(serverID);
+ serverWC.setServerConfiguration(null);
+ currentServer = serverWC.save(true, new NullProgressMonitor());
+
+
+ }
+
+ private IRuntime createRuntime(String runtimeId, String homeDir,
+ String config) throws CoreException {
+ IRuntimeType[] runtimeTypes = ServerUtil.getRuntimeTypes(null, null,
+ runtimeId);
+ assertEquals("expects only one runtime type", runtimeTypes.length, 1);
+ IRuntimeType runtimeType = runtimeTypes[0];
+ IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(null,
+ new NullProgressMonitor());
+ runtimeWC.setName(runtimeId);
+ runtimeWC.setLocation(new Path(homeDir));
+ IRuntime savedRuntime = runtimeWC.save(true, new NullProgressMonitor());
+ return savedRuntime;
+ }
+
protected ServiceModel createServiceModel(){
ServiceModel model = new ServiceModel();
model.setWebProjectName(fproject.getProject().getName());
@@ -257,8 +360,25 @@
}
+ protected void publishWebProject() throws CoreException{
+ IModule[] modules = ServerUtil.getModules(currentServer.getServerType().getRuntimeType().getModuleTypes());
+ IServerWorkingCopy serverWC = currentServer.createWorkingCopy();
+ serverWC.modifyModules(modules, null, null);
+ currentServer.publish(0, null);
+
+ }
+
+ protected void cleanProjectFromServer() throws CoreException{
+ IModule[] modules = ServerUtil.getModules(currentServer.getServerType().getRuntimeType().getModuleTypes());
+ IServerWorkingCopy serverWC = currentServer.createWorkingCopy();
+ serverWC.modifyModules(null, modules, null);
+ currentServer.publish(0, null);
+ currentServer.stop(true);
+
+ }
+
protected boolean isServerSupplied(){
- return true;
+ return false;
}
@@ -309,9 +429,9 @@
protected File getJBossWSHomeFolder() {
- String jbosshome = System.getProperty("jbosstools.test.jboss.home.4.2", JBOSSWS_HOME_DEFAULT);
+ String jbosshome = System.getProperty(JBOSS_RUNTIME_42, JBOSSWS_HOME_DEFAULT);
File runtimelocation = new File(jbosshome);
- assertTrue("Please set Jboss EAP Home in system property:" + JBOSSWS_HOME, runtimelocation.exists());
+ assertTrue("Please set Jboss EAP Home in system property:" + JBOSS_RUNTIME_42, runtimelocation.exists());
String cmdFileLocation = jbosshome + File.separator + "bin" + File.separator + "wsconsume.sh";
assertTrue(jbosshome + " is not a valid jboss EAP home", new File(cmdFileLocation).exists());
17 years, 6 months