Author: akazakov
Date: 2012-10-04 15:00:25 -0400 (Thu, 04 Oct 2012)
New Revision: 44310
Added:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityHome.java
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityManager.java
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Home.java
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Person.java
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/PersonHome.java
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/WebContent/paramValidation.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ParameterizedClassValidationTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-12778 EL completition doesn't understand Seam
EntityHome<E> anymore
Added:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityHome.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityHome.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityHome.java 2012-10-04
19:00:25 UTC (rev 44310)
@@ -0,0 +1,15 @@
+package demo.param;
+
+public class EntityHome<E> extends Home<EntityManager, E> {
+
+ public boolean isManaged() {
+ return true;
+ }
+
+ public E find() {
+ return getInstance();
+ }
+
+ public void create() {
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityHome.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityManager.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityManager.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityManager.java 2012-10-04
19:00:25 UTC (rev 44310)
@@ -0,0 +1,5 @@
+package demo.param;
+
+public class EntityManager {
+
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/EntityManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Home.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Home.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Home.java 2012-10-04
19:00:25 UTC (rev 44310)
@@ -0,0 +1,22 @@
+package demo.param;
+
+public abstract class Home<T, E> {
+
+ protected E instance;
+
+ public E getInstance() {
+ return instance;
+ }
+
+ public void setInstance(E instance) {
+ this.instance = instance;
+ }
+
+ public String getId() {
+ return null;
+ }
+
+ public String getVersion() {
+ return "";
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Home.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Person.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Person.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Person.java 2012-10-04
19:00:25 UTC (rev 44310)
@@ -0,0 +1,24 @@
+package demo.param;
+
+
+public class Person {
+
+ private Long id;
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/Person.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/PersonHome.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/PersonHome.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/PersonHome.java 2012-10-04
19:00:25 UTC (rev 44310)
@@ -0,0 +1,12 @@
+package demo.param;
+
+import javax.faces.bean.ManagedBean;
+
+@ManagedBean
+public class PersonHome extends EntityHome<Person> {
+
+ @Override
+ public String getId() {
+ return super.getId();
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/JavaSource/demo/param/PersonHome.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/WebContent/paramValidation.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/WebContent/paramValidation.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.base.test/projects/jsf2pr/WebContent/paramValidation.xhtml 2012-10-04
19:00:25 UTC (rev 44310)
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <h:outputText value="#{personHome.instance.name}" />
+ <h:outputText value="#{personHome.instance.broken}" />
+ <h:outputText value="#{personHome.broken}" />
+ <h:outputText value="#{personHome.create()}" />
+ <h:outputText value="#{personHome.find().id}" />
+ <h:outputText value="#{personHome.find().broken}" />
+ <h:outputText value="#{personHome.managed}" />
+ <h:outputText value="#{personHome.id}" />
+ <h:outputText value="#{personHome.version}" />
+</html>
\ No newline at end of file
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 2012-10-04
18:41:31 UTC (rev 44309)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2012-10-04
19:00:25 UTC (rev 44310)
@@ -29,6 +29,7 @@
import org.jboss.tools.jsf.test.validation.FacesConfigValidatorTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsInClassFolderTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsValidatorTest;
+import org.jboss.tools.jsf.test.validation.ParameterizedClassValidationTest;
import org.jboss.tools.jsf.test.validation.VarAttributesTest;
import org.jboss.tools.jsf.test.validation.WTPValidationTest;
import org.jboss.tools.jsf.test.validation.WebContentTest;
@@ -105,6 +106,7 @@
XHTMLDetectorAndValidatorTest.class,
BuilderValidationTest.class,
VarAttributesTest.class,
+ ParameterizedClassValidationTest.class,
WTPValidationTest.class
),"org.jboss.tools.jsf.base.test","projects/jsf2pr","jsf2pr"));
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ParameterizedClassValidationTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ParameterizedClassValidationTest.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ParameterizedClassValidationTest.java 2012-10-04
19:00:25 UTC (rev 44310)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.test.validation;
+
+import java.text.MessageFormat;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.jst.web.kb.internal.validation.ELValidationMessages;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ParameterizedClassValidationTest extends TestCase {
+
+ IProject project;
+ IFile xhtml;
+ String messageBroken =
MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new
Object[]{"broken"});
+ String[] messagesOk = new String[]
{MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new
Object[]{"personHome"}),
+ MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[]{"instance"}),
+ MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[]{"name"}),
+ MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[]{"create"}),
+ MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[]{"find"}),
+ MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[]{"id"}),
+ MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[]{"managed"}),
+ MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
new Object[]{"version"})};
+
+ @Override
+ protected void setUp() throws Exception {
+ project = ProjectImportTestSetup.loadProject("jsf2pr");
+ xhtml = project.getFile("WebContent/paramValidation.xhtml");
+ }
+
+ public void testBroken() throws Exception {
+ AbstractResourceMarkerTest.assertMarkerIsCreated(xhtml, messageBroken, 7, 8, 11);
+ }
+
+ public void testOk() throws Exception {
+ for (String message : messagesOk) {
+ for(int i = 6; i<15; i++) {
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(xhtml, message, i);
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ParameterizedClassValidationTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain