01: package org.mvel.tests.main;
02:
03: /**
04: * Tests to ensure MVEL fails when it should.
05: */
06: public class FailureTests extends AbstractTest {
07: public void testUnknownToken() {
08: testForFailure("someUnknownToken");
09: }
10:
11: public void testIncompleteStatement() {
12: testForFailure("1 +");
13: }
14:
15: private void testForFailure(String ex) {
16: try {
17: test(ex);
18:
19: } catch (Throwable e) {
20: e.printStackTrace();
21: return;
22: }
23:
24: throw new AssertionError();
25:
26: }
27: }
|