Author: vrubezhny
Date: 2010-12-28 13:49:29 -0500 (Tue, 28 Dec 2010)
New Revision: 27782
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.classpath
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.project
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/.jsdtscope
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.jdt.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.component
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/META-INF/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/faces-config.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/lib/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/page.jsp
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_en.properties
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_nl.properties
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JsfJbide7975Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
Log:
JBIDE-7975
jsf validation gives property does not exist warning on messagebundle properties
JUnit test is added
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.classpath
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.classpath
(rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.classpath 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_12">
+ <attributes>
+ <attribute name="owner.project.facets" value="java"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con"
path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/JBoss
5.1 Runtime">
+ <attributes>
+ <attribute name="owner.project.facets"
value="jst.web;jst.jsf"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con"
path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="build/classes"/>
+</classpath>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.project
(rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.project 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JsfJbide7975</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <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>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/.jsdtscope
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/.jsdtscope
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/.jsdtscope 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="WebContent"/>
+ <classpathentry kind="con"
path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con"
path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.jdt.core.prefs 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,8 @@
+#Wed Dec 22 19:22:06 MSK 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.component
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.component 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="JsfJbide7975">
+ <wb-resource deploy-path="/"
source-path="/WebContent"/>
+ <wb-resource deploy-path="/WEB-INF/classes"
source-path="/src"/>
+ <property name="java-output-path"
value="/faceted/build/classes"/>
+ <property name="context-root" value="JsfJbide7975"/>
+ </wb-module>
+</project-modules>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,7 @@
+<root>
+ <facet id="jst.jsf">
+ <node name="libprov">
+ <attribute name="provider-id"
value="runtime-library-provider"/>
+ </node>
+ </facet>
+</root>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="JBoss 5.1 Runtime"/>
+ <fixed facet="wst.jsdt.web"/>
+ <installed facet="java" version="1.5"/>
+ <installed facet="jst.web" version="2.5"/>
+ <installed facet="jst.jsf" version="1.2"/>
+ <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.common.project.facet.core.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.jsdt.ui.superType.container
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.jsdt.ui.superType.container 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.jsdt.ui.superType.name
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/.settings/org.eclipse.wst.jsdt.ui.superType.name 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/META-INF/MANIFEST.MF
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/META-INF/MANIFEST.MF 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/faces-config.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/faces-config.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/faces-config.xml 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
+ version="1.2">
+
+<application>
+ <!-- view-handler>com.sun.facelets.FaceletViewHandler</view-handler
-->
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>en</supported-locale>
+ <supported-locale>nl</supported-locale>
+ </locale-config>
+ <message-bundle>texts.msg</message-bundle>
+ </application>
+</faces-config>
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/web.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/web.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/web.xml 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"
version="2.5">
+ <display-name>JsfJbide7975</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/page.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/page.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/page.jsp 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,18 @@
+<%@ page language="java" contentType="text/html;
charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="f"
uri="http://java.sun.com/jsf/core"%>
+<%@ taglib prefix="h"
uri="http://java.sun.com/jsf/html"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
+<title>Insert title here</title>
+</head>
+<body>
+<f:loadBundle var="msg" basename="texts.msg"/>
+<f:view>
+
+<h:outputText value="#{msg.property_one}" />
+
+</f:view>
+</body>
+</html>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/WebContent/page.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_en.properties
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_en.properties
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_en.properties 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,2 @@
+property_one=one_en
+property_two=Two EN
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_en.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_nl.properties
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_nl.properties
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_nl.properties 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,2 @@
+property_one=one_nl
+property_two=Two NL
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JsfJbide7975/src/texts/msg_nl.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JsfJbide7975Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JsfJbide7975Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/model/pv/test/JsfJbide7975Test.java 2010-12-28
18:49:29 UTC (rev 27782)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.model.pv.test;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.Properties;
+
+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.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.validation.ValidationFramework;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.model.pv.JSFPromptingProvider;
+import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+public class JsfJbide7975Test extends TestCase {
+ public static final String TEST_PROJECT_NAME = "JsfJbide7975";
+ public static final String TEST_PROJECT_PATH = "/projects/" +
TEST_PROJECT_NAME;
+
+ TestProjectProvider prjProvider = null;
+ IProject project = null;
+ IModelNature nature = null;
+ XModel model = null;
+
+ JSFPromptingProvider provider = null;
+
+ @Override
+ protected void setUp() throws IOException, CoreException, InvocationTargetException,
InterruptedException {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ project =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember(TEST_PROJECT_NAME);
+ if(project==null) {
+ prjProvider = new TestProjectProvider("org.jboss.tools.jsf.test",
TEST_PROJECT_PATH, TEST_PROJECT_NAME, true);
+ project = prjProvider.getProject();
+ }
+
+ project.build(IncrementalProjectBuilder.FULL_BUILD, null);
+ nature = EclipseResourceUtil.getModelNature(project);
+ assertNotNull(nature);
+ model = nature.getModel();
+ assertNotNull(model);
+ provider = new JSFPromptingProvider();
+
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ if(prjProvider!=null) {
+ prjProvider.dispose();
+ }
+ }
+
+ public static final String PAGE_FILENAME = "/WebContent/page.jsp";
+ public static final String PAGE_MARKER_PATTERN = "\"{0}\" cannot be
resolved";
+ public static final String PAGE_BUNDLE_PROPERTY = "property_one";
+ public static final int PAGE_LINE = 14;
+
+ public void testErrorMarkerAbsence() {
+ try {
+ assertMarkerIsNotCreatedForLine(PAGE_FILENAME, PAGE_MARKER_PATTERN, new Object[]
{PAGE_BUNDLE_PROPERTY}, PAGE_LINE, true);
+ } catch (CoreException ce) {
+ fail("Error while getting markers");
+ }
+ }
+
+ public static final int GET_BUNDLE_EXPECTED_LIST_SIZE = 2;
+
+ public void testGetBundles() {
+ 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 = 2;
+
+ public void testGetBundleProperties() {
+ List<Object> list = provider.getList(model,
IWebPromptingProvider.JSF_BUNDLE_PROPERTIES, "texts.msg", new Properties());
+ assertEquals("Bundles properties proposal list has wrong
size",GET_BUNDLE_PROPERTIES_EXPECTED_LIST_SIZE, list.size());
+ }
+
+ private void assertMarkerIsNotCreatedForLine(String fileName, String template, Object[]
parameters, int lineNumber, boolean validate) throws CoreException{
+ String messagePattern = MessageFormat.format(template, parameters);
+ IFile file = project.getFile(fileName);
+
+ if(validate) {
+ 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/model/pv/test/JsfJbide7975Test.java
___________________________________________________________________
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-12-28
18:41:56 UTC (rev 27781)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-12-28
18:49:29 UTC (rev 27782)
@@ -24,6 +24,7 @@
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.model.pv.test.JsfJbide7975Test;
import org.jboss.tools.jsf.test.refactoring.ELVariableRefactoringTest;
import org.jboss.tools.jsf.test.refactoring.JSF2RefactoringTest;
import org.jboss.tools.jsf.test.refactoring.MessagePropertyRefactoringTest;
@@ -50,7 +51,13 @@
"org.jboss.tools.jsf.test", //$NON-NLS-1$
JSFPromptingProviderTest.TEST_PROJECT_PATH,
JSFPromptingProviderTest.TEST_PROJECT_NAME));
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ JsfJbide7975Test.class),
+ "org.jboss.tools.jsf.test", //$NON-NLS-1$
+ JsfJbide7975Test.TEST_PROJECT_PATH,
+ JsfJbide7975Test.TEST_PROJECT_NAME));
+
suite.addTest(new ProjectImportTestSetup(new TestSuite(
ELVariableRefactoringTest.class), "org.jboss.tools.jsf.test",
//$NON-NLS-1$
new String[] { "projects/JSFKickStartOldFormat" }, //$NON-NLS-1$