KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > axi > CyclicModelTest


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.axi;
21
22 import junit.framework.*;
23 import org.netbeans.modules.xml.axi.visitor.DeepAXITreeVisitor;
24
25
26 /**
27  *
28  * @author Samaresh (Samaresh.Panda@Sun.Com)
29  */

30 public class CyclicModelTest extends AbstractTestCase {
31     
32     public static final String JavaDoc SCHEMA_A = "resources/schemaA.xsd";
33     public static final String JavaDoc SCHEMA_B = "resources/schemaB.xsd";
34     public static final String JavaDoc SCHEMA_C = "resources/schemaC.xsd";
35     
36     /**
37      * CyclicModelTest
38      */

39     public CyclicModelTest(String JavaDoc testName) {
40         super(testName, SCHEMA_A, null);
41     }
42     
43     /**
44      * CyclicModelTest
45      */

46     public CyclicModelTest(String JavaDoc testName, String JavaDoc schemaFile, String JavaDoc elementName) {
47         super(testName, schemaFile, elementName);
48     }
49     
50     public static Test suite() {
51         TestSuite suite = new TestSuite(CyclicModelTest.class);
52         return suite;
53     }
54     
55     public void testCyclicModelsNotExpanded() {
56         DeepAXITreeVisitor visitor = new DeepAXITreeVisitor();
57         long startTime = System.currentTimeMillis();
58         visitor.visit(getAXIModel().getRoot());
59         long endTime = System.currentTimeMillis();
60     }
61     
62     public void testCyclicModelsExpanded() throws Exception JavaDoc {
63         AXIModel modelA = getAXIModel();
64         AXIModel modelB = getModel(SCHEMA_B);
65         AXIModel modelC = getModel(SCHEMA_C);
66         DeepAXITreeVisitor visitor = new DeepAXITreeVisitor();
67         visitor.visit(modelA.getRoot());
68         visitor.visit(modelB.getRoot());
69         visitor.visit(modelC.getRoot());
70         modelA.sync();
71         modelB.sync();
72         modelC.sync();
73     }
74 }
75
Popular Tags