KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > adl > conform > TestReferences


1 /***
2  * Fractal ADL Parser
3  * Copyright (C) 2002-2004 France Telecom R&D
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: Eric.Bruneton@rd.francetelecom.com
20  *
21  * Author: Eric Bruneton
22  */

23
24 package org.objectweb.fractal.adl.conform;
25
26 import org.objectweb.fractal.adl.ADLException;
27 import org.objectweb.fractal.adl.Definition;
28 import org.objectweb.fractal.adl.Loader;
29 import org.objectweb.fractal.adl.components.ComponentLoader;
30 import org.objectweb.fractal.adl.xml.XMLLoader;
31
32 public class TestReferences extends Test {
33
34   public Loader l;
35   
36   public TestReferences (final String JavaDoc name) {
37     super(name);
38   }
39
40   protected void setUp () {
41     ComponentLoader compLoader = new ComponentLoader();
42     compLoader.clientLoader = new XMLLoader(false);
43     l = compLoader;
44   }
45   
46   public void test1 () throws ADLException {
47     l.load("REF1", null);
48     Definition d2 = l.load("REF2", null);
49     Definition d3 = l.load("REF3", null);
50     compare(d2, d3);
51   }
52
53   public void test2 () throws ADLException {
54     Definition d1 = l.load("REF4", null);
55     Definition d2 = l.load("REF5", null);
56     compare(d1, d2);
57   }
58   
59   public void test3 () throws ADLException {
60     Definition d1 = l.load("REF6", null);
61     Definition d2 = l.load("REF7", null);
62     compare(d1, d2);
63   }
64   
65   public void test4 () throws ADLException {
66     l.load("REF8", null);
67     Definition d2 = l.load("REF9", null);
68     Definition d3 = l.load("REF10", null);
69     compare(d2, d3);
70   }
71   
72   public void test5 () throws ADLException {
73     Definition d1 = l.load("REF11", null);
74     Definition d2 = l.load("REF12", null);
75     compare(d1, d2);
76   }
77   
78   public void test6 () throws ADLException {
79     Definition d1 = l.load("REF13", null);
80     Definition d2 = l.load("REF14", null);
81     compare(d1, d2);
82   }
83   
84   public void test7 () throws ADLException {
85     l.load("REF15", null);
86     Definition d2 = l.load("REF16", null);
87     Definition d3 = l.load("REF17", null);
88     compare(d2, d3);
89   }
90   
91   public void test8 () throws ADLException {
92     try {
93       l.load("REF18", null);
94       fail();
95     } catch (ADLException e) {
96     }
97   }
98   
99   public void test9 () throws ADLException {
100     try {
101       l.load("REF19", null);
102       fail();
103     } catch (ADLException e) {
104     }
105   }
106 }
107
Popular Tags