Author: mareshkau
Date: 2008-11-03 09:01:32 -0500 (Mon, 03 Nov 2008)
New Revision: 11488
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2979/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2979/test.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2979Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
Junit test for JBIDE-2979
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2979/test.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2979/test.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2979/test.xhtml 2008-11-03
14:01:32 UTC (rev 11488)
@@ -0,0 +1,18 @@
+<!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"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+<f:loadBundle basename="demo.Messages" var="msg" />
+<head>
+<title><ui:insert name="pageTitle">Page
Title</ui:insert></title>
+</head>
+
+<body>
+ <!-- Comment Node -->
+ <h1>Text XHtml Page</h1>
+
+</body>
+
+</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-03
13:21:10 UTC (rev 11487)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-03
14:01:32 UTC (rev 11488)
@@ -39,6 +39,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2624Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2774Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2828Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2979Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3030Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
@@ -105,6 +106,7 @@
suite.addTestSuite(JBIDE2774Test.class);
suite.addTestSuite(JBIDE2828Test.class);
suite.addTestSuite(JBIDE3030Test.class);
+ suite.addTestSuite(JBIDE2979Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2979Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2979Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2979Test.java 2008-11-03
14:01:32 UTC (rev 11488)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+* Copyright (c) 2007 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.vpe.jsf.test.jbide;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.common.el.core.ELReferenceList;
+import org.jboss.tools.common.resref.core.ResourceReference;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * Test case for JBIDE-2979
+ * @author mareshkau
+ *
+ */
+public class JBIDE2979Test extends VpeTest {
+
+ /**
+ * Test Page
+ */
+ private IFile file;
+
+
+ private static Map<String, String> elValuesMap;
+
+ public JBIDE2979Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE2979() {
+ ResourceReference[] entries = ELReferenceList.getInstance().getAllResources(file);
+ for (ResourceReference resourceReference : entries) {
+ assertEquals("Value from Map Should be equal value from Resource",
//$NON-NLS-1$
+ elValuesMap.get(resourceReference.getLocation()),resourceReference.getProperties());
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.ui.test.VpeTest#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ setException(null);
+ this.file = (IFile) TestUtil.getComponentPath("JBIDE/2979/test.xhtml",
//$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ elValuesMap = new HashMap<String, String>();
+ elValuesMap.put("bean.name", "Test Test"); //$NON-NLS-1$
//$NON-NLS-2$
+ elValuesMap.put("bean.value", "Test;. Test"); //$NON-NLS-1$
//$NON-NLS-2$
+ elValuesMap.put("bean.value2", "%Test,.; ddfdf %ED Test");
//$NON-NLS-1$//$NON-NLS-2$
+ ResourceReference[] entries = new ResourceReference[elValuesMap.size()];
+ int i = 0;
+ for (Entry<String, String> string : elValuesMap.entrySet()) {
+ entries[i] = new ResourceReference(string.getKey(),
ResourceReference.PROJECT_SCOPE);
+ entries[i].setProperties(string.getValue());
+ i++;
+ }
+ ELReferenceList.getInstance().setAllResources(this.file,entries);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.ui.test.VpeTest#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ ELReferenceList.getInstance().setAllResources(this.file, new ResourceReference[0]);
+ if(getException()!=null) {
+ throw new Exception(getException());
+ }
+ super.tearDown();
+ }
+}