Author: scabanovich
Date: 2008-10-22 10:37:28 -0400 (Wed, 22 Oct 2008)
New Revision: 11075
Added:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/bundle/
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/bundle/Messages.properties
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/Bundle.properties
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/ManagedBean9.java
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/RefBean3.java
Modified:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.xml
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/ManagedBean2.java
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/WebContent/WEB-INF/faces-config.xml
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JSFPromptingProviderTest.java
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFImportTest.java
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
Log:
JBIDE-2421
Added:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/bundle/Messages.properties
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/bundle/Messages.properties
(rev 0)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/JavaSource/demo/bundle/Messages.properties 2008-10-22
14:37:28 UTC (rev 11075)
@@ -0,0 +1 @@
+a=b
\ No newline at end of file
Modified:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.xml
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.xml 2008-10-22
14:20:58 UTC (rev 11074)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/WEB-INF/faces-config.xml 2008-10-22
14:37:28 UTC (rev 11075)
@@ -48,11 +48,11 @@
</converter>
<managed-bean>
<description>Input Value Holder</description>
- <managed-bean-name>nameBean</managed-bean-name>
- <managed-bean-class>demo.NameBean</managed-bean-class>
+ <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>userName</property-name>
+ <property-name>name</property-name>
<property-class>java.lang.String</property-class>
<value/>
</managed-property>
Added:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/Bundle.properties
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/Bundle.properties
(rev 0)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/Bundle.properties 2008-10-22
14:37:28 UTC (rev 11075)
@@ -0,0 +1,3 @@
+a=1
+b=2
+c=3
\ No newline at end of file
Modified:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/ManagedBean2.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/ManagedBean2.java 2008-10-22
14:20:58 UTC (rev 11074)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/ManagedBean2.java 2008-10-22
14:37:28 UTC (rev 11075)
@@ -10,4 +10,6 @@
public class ManagedBean2 {
public ManagedBean2() {
}
+
+ public void exec() {}
}
Added:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/ManagedBean9.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/ManagedBean9.java
(rev 0)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/ManagedBean9.java 2008-10-22
14:37:28 UTC (rev 11075)
@@ -0,0 +1,13 @@
+/**
+ *
+ */
+package org.jboss.tools.jsf.test;
+
+/**
+ * @author eskimo
+ *
+ */
+public class ManagedBean9 {
+ public ManagedBean9() {
+ }
+}
Added:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/RefBean3.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/RefBean3.java
(rev 0)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/JavaSource/org/jboss/tools/jsf/test/RefBean3.java 2008-10-22
14:37:28 UTC (rev 11075)
@@ -0,0 +1,49 @@
+package org.jboss.tools.jsf.test;
+
+public class RefBean3 {
+ private String property6;
+ private String property7;
+ private String property8;
+ private String property9;
+ private RefBean2 property10;
+
+ public String getProperty6() {
+ return property6;
+ }
+
+ public void setProperty6(String property1) {
+ this.property6 = property1;
+ }
+
+ public String getProperty7() {
+ return property7;
+ }
+
+ public void setProperty7(String property2) {
+ this.property7 = property2;
+ }
+
+ public String getProperty8() {
+ return property8;
+ }
+
+ public void setProperty8(String property3) {
+ this.property8 = property3;
+ }
+
+ public String getProperty9() {
+ return property9;
+ }
+
+ public void setProperty9(String property4) {
+ this.property9 = property4;
+ }
+
+ public RefBean2 getProperty10() {
+ return property10;
+ }
+
+ public void setProperty10(RefBean2 property5) {
+ this.property10 = property5;
+ }
+}
Modified:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/WebContent/WEB-INF/faces-config.xml
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/WebContent/WEB-INF/faces-config.xml 2008-10-22
14:20:58 UTC (rev 11074)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/projects/JSFPromptingProviderTestProject/WebContent/WEB-INF/faces-config.xml 2008-10-22
14:37:28 UTC (rev 11075)
@@ -61,4 +61,14 @@
<referenced-bean-name>refbean2</referenced-bean-name>
<referenced-bean-class>org.jboss.tools.jsf.test.RefBean2</referenced-bean-class>
</referenced-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>
+ <application>
+ <message-bundle>org.jboss.tools.jsf.test.Bundle</message-bundle>
+ </application>
</faces-config>
Modified:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JSFPromptingProviderTest.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JSFPromptingProviderTest.java 2008-10-22
14:20:58 UTC (rev 11074)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JSFPromptingProviderTest.java 2008-10-22
14:37:28 UTC (rev 11075)
@@ -3,14 +3,11 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
+import java.util.Properties;
-import org.eclipse.core.internal.resources.Workspace;
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.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.model.XModel;
@@ -18,7 +15,9 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jsf.model.pv.JSFPromptingProvider;
import org.jboss.tools.jsf.plugin.JsfTestPlugin;
+import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import junit.framework.TestCase;
@@ -57,80 +56,76 @@
}
public void testIsSupporting() {
- fail("Not yet implemented");
+ assertTrue(provider.isSupporting(IWebPromptingProvider.JSF_BUNDLES));
}
public void testGetList() {
- fail("Not yet implemented");
+ List<Object> list = provider.getList(model, "", "", new
Properties());
+ assertEquals("Empty list should be returned for unsupported
id.",IWebPromptingProvider.EMPTY_LIST, list);
}
/******************************************************************
* getBundles method test
******************************************************************/
- public static final int GET_BUNDLE_EXPECTED_LIST_SIZE = 0;
+ public static final int GET_BUNDLE_EXPECTED_LIST_SIZE = 1;
/**
*
*/
public void testGetBundles() {
- List<Object> list = provider.getBundles(model);
+ List<Object> list = provider.getList(model, IWebPromptingProvider.JSF_BUNDLES,
"", new Properties());
assertEquals("Bundles proposal list has wrong
size",GET_BUNDLE_EXPECTED_LIST_SIZE, list.size());
}
+ public static final int GET_BUNDLE_PROPERTIES_EXPECTED_LIST_SIZE = 3;
+
public void testGetBundleProperties() {
- fail("Not yet implemented");
+ List<Object> list = provider.getList(model,
IWebPromptingProvider.JSF_BUNDLE_PROPERTIES, "org.jboss.tools.jsf.test.Bundle",
new Properties());
+ assertEquals("Bundles properties proposal list has wrong
size",GET_BUNDLE_PROPERTIES_EXPECTED_LIST_SIZE, list.size());
}
/**
* Expected beans list size
*/
- public static final int GET_BEANS_EXPECTED_LIST_SIZE = 10;
+ public static final int GET_BEANS_EXPECTED_LIST_SIZE = 12;
/**
* <code>JSFPromptingProvider.getBundles()</code> method test
*/
public void testGetBeans() {
- List<Object> list = provider.getBeans(model);
+ List<Object> list = provider.getList(model,
IWebPromptingProvider.JSF_MANAGED_BEANS, null, new Properties());
assertEquals("Managed Beans proposal list has wrong
size",GET_BEANS_EXPECTED_LIST_SIZE, list.size());
-
}
+ public static final int GET_BEAN_PROPERTIES_LIST_SIZE = 5;
+
public void testGetBeanProperties() {
- fail("Not yet implemented");
+ List<Object> list = provider.getList(model,
IWebPromptingProvider.JSF_BEAN_PROPERTIES, "mbean1.", new Properties());
+ assertEquals("Bean properties proposal list has wrong
size",GET_BEAN_PROPERTIES_LIST_SIZE, list.size());
}
+ public static final int BUILD_BEAN_PROPERTIES_LIST_SIZE = 5;
+
public void testBuildBeanProperties() {
- fail("Not yet implemented");
+ List list = provider.buildBeanProperties(model,
"org.jboss.tools.jsf.test.ManagedBean1", null);
+ assertEquals("Bean properties proposal list has wrong
size",BUILD_BEAN_PROPERTIES_LIST_SIZE, list.size());
}
- public void testBuildBean() {
- fail("Not yet implemented");
- }
-
- public void testFindBean() {
- fail("Not yet implemented");
- }
-
- public void testFindBeanClass() {
- fail("Not yet implemented");
- }
-
- public void testFindBeanClassByClassName() {
- fail("Not yet implemented");
- }
-
public void testGetBeanMethods() {
- fail("Not yet implemented");
+ List<Object> list = provider.getList(model,
IWebPromptingProvider.JSF_BEAN_METHODS, "mbean2", new Properties());
+ assertEquals(1, list.size());
}
public void testGetViewActions() {
- fail("Not yet implemented");
+ Properties p = new Properties();
+ p.setProperty(IWebPromptingProvider.VIEW_PATH, "/pages/inputname.jsp");
+ List<Object> list = provider.getList(model,
IWebPromptingProvider.JSF_VIEW_ACTIONS, "", p);
+ assertEquals(1, list.size());
}
- public void testGetPathAsList() {
- fail("Not yet implemented");
- }
-
public void testGetPath() {
- fail("Not yet implemented");
+ List<Object> list = provider.getList(model, IWebPromptingProvider.JSF_GET_PATH,
"/a.jsf", new Properties());
+ assertEquals(1, list.size());
+ String s = (String)list.get(0);
+ assertEquals("/a.jsp", s);
}
public void testOpenBean() {
@@ -148,7 +143,10 @@
@Override
protected void tearDown() throws Exception {
if(project!=null) {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
ResourcesUtils.deleteProject(TEST_PROJECT_NAME);
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
}
}
}
Modified:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java 2008-10-22
14:20:58 UTC (rev 11074)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFBeansTest.java 2008-10-22
14:37:28 UTC (rev 11075)
@@ -46,9 +46,9 @@
public void testGettersAndSetters() {
IModelNature n = EclipseResourceUtil.getModelNature(project);
List<Object> result = WebPromptingProvider.getInstance().getList(n.getModel(),
IWebPromptingProvider.JSF_BEAN_METHODS, "user.", new Properties());
- assertFalse("Method getX1 is not found. It is not a getter because it has type
void.", result.contains("getX1"));
- assertFalse("Method getX2 is not found. It is not a getter because it has a
parameter.", result.contains("getX2"));
- assertFalse("Method setX3 is not found. It is not a setter because it has 2
parameters", result.contains("setX3"));
+ assertTrue("Method getX1 is not found. It is not a getter because it has type
void.", result.contains("getX1"));
+ assertTrue("Method getX2 is not found. It is not a getter because it has a
parameter.", result.contains("getX2"));
+ assertTrue("Method setX3 is not found. It is not a setter because it has 2
parameters", result.contains("setX3"));
}
protected void tearDown() throws CoreException{
Modified:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFImportTest.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFImportTest.java 2008-10-22
14:20:58 UTC (rev 11074)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JSFImportTest.java 2008-10-22
14:37:28 UTC (rev 11075)
@@ -16,6 +16,7 @@
import org.jboss.tools.jsf.web.helpers.context.ImportProjectWizardContext;
import org.jboss.tools.jst.web.context.*;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
import org.osgi.framework.Bundle;
import junit.framework.TestCase;
@@ -32,7 +33,7 @@
* FIXME test is disabled because it hangs build for an eternity
*
http://jira.jboss.org/jira/browse/JBIDE-2441
*/
- public void disapledTestImportWithoutLinks() {
+ public void testImportWithoutLinks() {
if(projectLocation == null) return;
ImportWebDirProjectContext context = new
ImportProjectWizardContext(XModelFactory.getDefaultInstance().getRoot());
@@ -60,7 +61,9 @@
p.getLocation().toFile().equals(projectLocation));
try {
+ boolean save = ResourcesUtils.setBuildAutomatically(false);
p.delete(false, true, new NullProgressMonitor());
+ ResourcesUtils.setBuildAutomatically(save);
} catch (CoreException e) {
JUnitUtils.fail("Error in removing project", e);
}
Modified:
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2008-10-22
14:20:58 UTC (rev 11074)
+++
branches/jbosstools-3.0.0.Beta1/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2008-10-22
14:37:28 UTC (rev 11075)
@@ -24,9 +24,9 @@
suite.addTestSuite(JSFModelTest.class);
suite.addTestSuite(ModelFormat_2_0_0_Test.class);
// FIXME
http://jira.jboss.org/jira/browse/JBIDE-2441
- // suite.addTestSuite(JSFImportTest.class);
+ suite.addTestSuite(JSFImportTest.class);
suite.addTestSuite(JSFBeansTest.class);
- //suite.addTestSuite(JSFPromptingProviderTest.class);
+ suite.addTestSuite(JSFPromptingProviderTest.class);
return suite;
}