|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| package org.jconfig.utils; |
|
8 |
| |
|
9 |
| import java.io.IOException; |
|
10 |
| |
|
11 |
| import junit.framework.TestCase; |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| public class ExtensionGraphTest extends TestCase { |
|
16 |
| |
|
17 |
| |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
0
| public ExtensionGraphTest(String arg0) {
|
|
22 |
0
| super(arg0);
|
|
23 |
| } |
|
24 |
| |
|
25 |
0
| public static void main(String[] args) {
|
|
26 |
0
| junit.textui.TestRunner.run(ExtensionGraphTest.class);
|
|
27 |
| } |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
0
| public void testCheck1() throws IOException {
|
|
33 |
0
| ExtensionGraph eg = new ExtensionGraph();
|
|
34 |
0
| eg.addExtension("A","B");
|
|
35 |
0
| eg.addExtension("B","C");
|
|
36 |
0
| eg.addExtension("C","A");
|
|
37 |
0
| boolean ret = eg.checkDependencies("A");
|
|
38 |
0
| assertTrue(ret);
|
|
39 |
| } |
|
40 |
| |
|
41 |
0
| public void testCheck2() throws IOException {
|
|
42 |
0
| ExtensionGraph eg = new ExtensionGraph();
|
|
43 |
0
| eg.addExtension("A","B");
|
|
44 |
0
| eg.addExtension("C","A");
|
|
45 |
0
| boolean ret = eg.checkDependencies("A");
|
|
46 |
0
| assertTrue(!ret);
|
|
47 |
| } |
|
48 |
| |
|
49 |
0
| public void testCheck3() throws IOException {
|
|
50 |
0
| ExtensionGraph eg = new ExtensionGraph();
|
|
51 |
0
| eg.addExtension("A","B");
|
|
52 |
0
| eg.addExtension("B","A");
|
|
53 |
0
| boolean ret = eg.checkDependencies("A");
|
|
54 |
0
| assertTrue(ret);
|
|
55 |
| } |
|
56 |
| |
|
57 |
| } |