From: Hiram C. <ch...@us...> - 2002-04-30 06:11:38
|
User: chirino Date: 02/04/29 23:11:36 Modified: src/main/org/jboss/test/jbossmq/test SelectorParserUnitTestCase.java Log: Some more selector tesst.. one of these fail. Revision Changes Path 1.6 +44 -1 jbosstest/src/main/org/jboss/test/jbossmq/test/SelectorParserUnitTestCase.java Index: SelectorParserUnitTestCase.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/jbossmq/test/SelectorParserUnitTestCase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- SelectorParserUnitTestCase.java 30 Apr 2002 03:26:41 -0000 1.5 +++ SelectorParserUnitTestCase.java 30 Apr 2002 06:11:34 -0000 1.6 @@ -13,6 +13,7 @@ import junit.framework.Test; import junit.framework.TestCase; +import javax.jms.*; import org.jboss.mq.selectors.Identifier; import org.jboss.mq.selectors.Operator; import org.jboss.mq.selectors.SelectorParser; @@ -25,7 +26,7 @@ @author Sco...@jb... @author d_j...@us... - @version $Revision: 1.5 $ + @version $Revision: 1.6 $ * (david jencks) Used constructor of SelectorParser taking a stream * to avoid reInit npe in all tests. Changed to JBossTestCase and logging. @@ -177,6 +178,48 @@ assertTrue("is false", !bool.booleanValue()); } + public void testInvalidSelector() throws Exception + { + getLog().debug("parse(definitely not a message selector!)"); + try { + Object result = parser.parse("definitely not a message selector!", identifierMap); + getLog().debug("result -> "+result); + fail("Should throw an Exception.\n"); + } catch (Exception e) { + } + } + + /** + * Test diffent syntax for approximate numeric literal (+6.2, -95.7, 7.) + */ + public void testApproximateNumericLiteral1() { + try { + getLog().debug("parse(average = +6.2)"); + Object result = parser.parse("average = +6.2", identifierMap); + getLog().debug("result -> "+result); + } catch (Exception e) { + fail(""+e); + } + } + + public void testApproximateNumericLiteral2() { + try { + getLog().debug("parse(average = -95.7)"); + Object result = parser.parse("average = -95.7", identifierMap); + getLog().debug("result -> "+result); + } catch (Exception e) { + fail(""+e); + } + } + public void testApproximateNumericLiteral3() { + try { + getLog().debug("parse(average = 7.)"); + Object result = parser.parse("average = 7.", identifierMap); + getLog().debug("result -> "+result); + } catch (Exception e) { + fail(""+e); + } + } public static void main(java.lang.String[] args) { junit.textui.TestRunner.run(SelectorParserUnitTestCase.class); |