01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307
20: * USA
21: *
22: *
23: * $ID$
24: */
25: package com.bostechcorp.cbesb.common.mdl;
26:
27: import java.io.File;
28:
29: import com.bostechcorp.cbesb.common.mdl.IMDLDocument;
30: import com.bostechcorp.cbesb.common.mdl.MDLParser;
31: import com.bostechcorp.cbesb.common.mdl.impl.MDLDocumentImpl;
32:
33: import junit.framework.TestCase;
34:
35: public class TestProcessNamespaceURI extends TestCase {
36: File mdlFile5 = new File("target/test-data/in/fixed1.mdl");
37:
38: IMDLDocument mdlDoc5 = new MDLDocumentImpl();
39:
40: protected void setUp() throws Exception {
41: super .setUp();
42: mdlDoc5 = MDLParser.load(mdlFile5);
43: }
44:
45: protected void tearDown() throws Exception {
46: super .tearDown();
47: }
48:
49: /**
50: * test get/set namespaceURI
51: * All MDL tags must be qualified with the MDL namespace.
52: * If we set namespaceURI,then the old namespaceURI must be
53: * covered by the one we set,and if we get namespaceURI now,
54: * we will get the new one
55: */
56: public void testNamespaceURI() {
57: String namespaceURI = mdlDoc5.getTargetNamespace();
58: assertNotNull(namespaceURI);
59: assertEquals("http://www.bostechcorp.com/fixed1", namespaceURI);
60:
61: String newNamespaceURI = "http://www.bostechcorp.com/new";
62: mdlDoc5.setTargetNamespace(newNamespaceURI);
63: assertNotNull(mdlDoc5.getTargetNamespace());
64: assertEquals(newNamespaceURI, mdlDoc5.getTargetNamespace());
65: }
66: }
|