Source code: com/tripi/asp/test/OperatorsTest.java
1 /**
2 * ArrowHead ASP Server
3 * This is a source file for the ArrowHead ASP Server - an 100% Java
4 * VBScript interpreter and ASP server.
5 *
6 * For more information, see http://www.tripi.com/arrowhead
7 *
8 * Copyright (C) 2002 Terence Haddock
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 */
25 package com.tripi.asp.test;
26
27 import com.tripi.asp.AspException;
28 import com.tripi.asp.Constants;
29 import com.tripi.asp.IdentNode;
30 import junit.framework.*;
31 import java.io.IOException;
32
33 /**
34 * The OperatorsTest class contains the unit tests for ASP operators
35 * @author Terence Haddock
36 */
37 public class OperatorsTest extends TestCase
38 {
39 /**
40 * JUnit test suite factory. Returns a test suite containing this
41 * class's tests.
42 * @return new test suite
43 */
44 public static Test suite()
45 {
46 TestSuite suite = new TestSuite("ASP Operators");
47 suite.addTest(new TestSuite(OperatorsTest.class));
48 return suite;
49 }
50
51 /**
52 * Test suite constructor.
53 * @param name test name
54 */
55 public OperatorsTest(String name) throws AspException
56 {
57 super(name);
58 }
59
60 /** Addition test */
61 public void test_add1() throws IOException
62 {
63 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-add1"));
64 }
65
66 /** AND test */
67 public void test_and1() throws IOException
68 {
69 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-and1"));
70 }
71
72 /** Concat test */
73 public void test_concat1() throws IOException
74 {
75 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-concat1"));
76 }
77
78 /** Div test */
79 public void test_div1() throws IOException
80 {
81 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-div1"));
82 }
83
84 /** Equality test */
85 public void test_eq1() throws IOException
86 {
87 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-eq1"));
88 }
89
90 /** EQV test */
91 public void test_eqv1() throws IOException
92 {
93 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-eqv1"));
94 }
95
96 /** EXP test */
97 public void test_exp1() throws IOException
98 {
99 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-exp1"));
100 }
101
102 /** Greater-Than-Equal-To test */
103 public void test_ge1() throws IOException
104 {
105 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-ge1"));
106 }
107
108 /** Greater-Than test */
109 public void test_gt1() throws IOException
110 {
111 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-gt1"));
112 }
113
114 /** IMP test */
115 public void test_imp1() throws IOException
116 {
117 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-imp1"));
118 }
119
120 /** IS test */
121 public void test_is1() throws IOException
122 {
123 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-is1"));
124 }
125
126 /** INTDIV test */
127 public void test_intdiv1() throws IOException
128 {
129 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-intdiv1"));
130 }
131
132 /** Less-Than-Equal-To test */
133 public void test_le1() throws IOException
134 {
135 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-le1"));
136 }
137
138 /** Less-Than test */
139 public void test_lt1() throws IOException
140 {
141 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-lt1"));
142 }
143
144 /** MOD test */
145 public void test_mod1() throws IOException
146 {
147 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-mod1"));
148 }
149
150 /** Multiply test */
151 public void test_multiply1() throws IOException
152 {
153 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-multiply1"));
154 }
155
156 /** Inequality test */
157 public void test_ne1() throws IOException
158 {
159 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-ne1"));
160 }
161
162 /** Negation test */
163 public void test_negation1() throws IOException
164 {
165 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-negation1"));
166 }
167
168 /** NOT test */
169 public void test_not1() throws IOException
170 {
171 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-not1"));
172 }
173
174 /** OR test */
175 public void test_or1() throws IOException
176 {
177 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-or1"));
178 }
179
180 /** XOR test */
181 public void test_xor1() throws IOException
182 {
183 Assert.assertTrue(AspTest.doSimpleTest("operators", "test-xor1"));
184 }
185
186 }