Last change
on this file since 80 was 80, checked in by ra33, 16 years ago |
Added some more unit tests
Did a bunch of refactoring
AND added a few new features... @b @v were the most significant
|
File size:
879 bytes
|
Line | |
---|
1 | package org.expeditee.simple;
|
---|
2 |
|
---|
3 | import org.expeditee.items.Text;
|
---|
4 | import org.expeditee.simple.Context;
|
---|
5 |
|
---|
6 | import junit.framework.TestCase;
|
---|
7 |
|
---|
8 | public class ContextTest extends TestCase {
|
---|
9 |
|
---|
10 | private Context context;
|
---|
11 |
|
---|
12 | protected void setUp() throws Exception {
|
---|
13 | super.setUp();
|
---|
14 | context = new Context();
|
---|
15 | try {
|
---|
16 | context.getPrimitives().setValue("$i.test", "5");
|
---|
17 | context.getPrimitives().set("$r.test", "$i.test");
|
---|
18 | context.getPointers().setObject("$ip.test", new Text(1, "test"));
|
---|
19 | context.getPointers().set("$ip.test2", "$ip.test");
|
---|
20 | } catch (Exception e) {
|
---|
21 | }
|
---|
22 | }
|
---|
23 |
|
---|
24 | public void testSize() {
|
---|
25 | assertEquals(context.size(), 4);
|
---|
26 | }
|
---|
27 |
|
---|
28 | public void testClear() {
|
---|
29 | context.clear();
|
---|
30 | assertEquals(context.size(), 0);
|
---|
31 | }
|
---|
32 |
|
---|
33 | public void testEqualValues() {
|
---|
34 | try {
|
---|
35 | assertTrue(context.equalValues("$i.test", "$r.Test"));
|
---|
36 | } catch (Exception e) {
|
---|
37 |
|
---|
38 | }
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.