KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > addressing > AnyContentTypeTest


1 /*
2  * Copyright 2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16  
17 package org.apache.axis2.addressing;
18
19 import junit.framework.TestCase;
20
21 import javax.xml.namespace.QName JavaDoc;
22
23
24 public class AnyContentTypeTest extends TestCase {
25     private AnyContentType anyContentType;
26
27     public static void main(String JavaDoc[] args) {
28         junit.textui.TestRunner.run(AnyContentTypeTest.class);
29     }
30
31     /*
32      * @see TestCase#setUp()
33      */

34     protected void setUp() throws Exception JavaDoc {
35         super.setUp();
36         anyContentType = new AnyContentType();
37     }
38
39     public void testAddAndGetReferenceValue() {
40         System.out.println("Testing by putting more than 5 values in this. (this is initialized for 5)");
41         for (int i = 0; i < 10; i++) {
42             anyContentType.addReferenceValue(new QName JavaDoc("http://www.opensouce.lk/" + i, "" + i), "value " + i * 100);
43         }
44
45         for (int i = 0; i < 10; i++) {
46             String JavaDoc value = anyContentType.getReferenceValue(new QName JavaDoc("http://www.opensouce.lk/" + i, "" + i));
47             assertEquals("Input value differs from what is taken out from AnyContentType", value, "value " + i * 100);
48         }
49
50     }
51
52
53 }
54
Popular Tags