Author: mareshkau
Date: 2008-10-11 09:26:44 -0400 (Sat, 11 Oct 2008)
New Revision: 10782
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java
Log:
=JBIDE-2828
Modified:
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 2008-10-11
01:14:05 UTC (rev 10781)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java 2008-10-11
13:26:44 UTC (rev 10782)
@@ -30,8 +30,10 @@
public JBIDE2828Test(String name) {
super(name);
}
- public void testJBIDE2828JbossELParser() {
+ public void testJBIDE2828JbossELParser() throws Throwable {
+ setException(null);
+
ELParserFactory jbossParserFactory = ELParserUtil.getJbossFactory();
assertNotNull("Couldn't get jboss parser factory", jbossParserFactory);
//$NON-NLS-1$
@@ -40,23 +42,20 @@
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);
+ checkELParser(elParser);
+
+ if(getException()!=null) {
+
+ throw getException();
+ }
}
/**
* Test for default parser
*/
- public void testJBIDE2828DefaultELParser() {
+ public void testJBIDE2828DefaultELParser() throws Throwable {
+ setException(null);
+
ELParserFactory defaultParserFactory = ELParserUtil.getDefaultFactory();
assertNotNull("Couldn't get jboss parser factory", defaultParserFactory);
//$NON-NLS-1$
@@ -65,17 +64,29 @@
assertNotNull(elParser);
+ checkELParser(elParser);
+
+ if(getException()!=null) {
+
+ throw getException();
+ }
+ }
+ /**
+ * Checks el parser
+ */
+ private void checkELParser(ELParser 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);
+ assertEquals("There shouldn't be
errors",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+
+ ELModel elModel2 = elParser.parse("#{org.richfaces.SKIN}"); //$NON-NLS-1$
+ assertNotNull(elModel2);
+ assertEquals("There shouldn't be
errors",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+
+ ELModel elModel3 = elParser.parse("#{klsjdf lsaijf aslkjd; sikjfd}");
//$NON-NLS-1$
+ assertNotNull(elModel3);
+ assertTrue("There should be errorrs",
elParser.getSyntaxErrors().size()>0); //$NON-NLS-1$
+
}
}
Show replies by date