Author: mareshkau
Date: 2008-10-09 08:19:45 -0400 (Thu, 09 Oct 2008)
New Revision: 10765
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.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-2828
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-10-09
10:28:48 UTC (rev 10764)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-10-09
12:19:45 UTC (rev 10765)
@@ -38,6 +38,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2594Test;
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.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
@@ -64,7 +65,7 @@
public static Test suite() {
- TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); //
$NON-NLS-1$
+ TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); //
$NON-NLS-1$ //$NON-NLS-1$
// $JUnit-BEGIN$
suite.addTestSuite(JsfComponentTest.class);
suite.addTestSuite(Jsf20ComponentContentTest.class);
@@ -101,6 +102,7 @@
suite.addTestSuite(JBIDE1805Test.class);
suite.addTestSuite(JsfComponentContentTest.class);
suite.addTestSuite(JBIDE2774Test.class);
+ suite.addTestSuite(JBIDE2828Test.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/JBIDE2828Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java 2008-10-09
12:19:45 UTC (rev 10765)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+* Copyright (c) 2007-2008 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
+*
+* Contributor:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserFactory;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * Test case for jbide-2828
+ *
+ * @author mareshkau
+ *
+ */
+public class JBIDE2828Test extends VpeTest {
+ /**
+ *
+ * @param name
+ */
+ public JBIDE2828Test(String name) {
+ super(name);
+ }
+ public void testJBIDE2828JbossELParser() {
+
+ ELParserFactory jbossParserFactory = ELParserUtil.getJbossFactory();
+
+ assertNotNull("Couldn't get jboss parser factory", jbossParserFactory);
//$NON-NLS-1$
+
+ ELParser elParser = jbossParserFactory.createParser();
+
+ assertNotNull(elParser);
+
+ ELModel elModel1 = elParser.parse("#{faces.context}"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel2 = elParser.parse("faces.context"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel3 = elParser.parse("");//$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel4 = elParser.parse("org.richfaces.SKIN"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel5 = elParser.parse(" jdsfh dskfj lksdjf asjfdsd; dsf;
");//$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ assertNotNull(elModel1);
+ }
+ /**
+ * Test for default parser
+ */
+ public void testJBIDE2828DefaultELParser() {
+
+ ELParserFactory defaultParserFactory = ELParserUtil.getDefaultFactory();
+
+ assertNotNull("Couldn't get jboss parser factory", defaultParserFactory);
//$NON-NLS-1$
+
+ ELParser elParser = defaultParserFactory.createParser();
+
+ assertNotNull(elParser);
+
+ ELModel elModel1 = elParser.parse("#{faces.context}"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel2 = elParser.parse("faces.context"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel3 = elParser.parse("");//$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel4 = elParser.parse("org.richfaces.SKIN"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel5 = elParser.parse(" jdsfh dskfj lksdjf asjfdsd; dsf;
");//$NON-NLS-1$
+ assertEquals("In which expression parser will found
error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ assertNotNull(elModel1);
+ }
+
+}