IN=15451 - schema2beans change: Add ability to store schemaLocation in mdd file BLD200309220100
authorcliffwd@netbeans.org
Fri, 19 Sep 2003 23:22:27 +0000
changeset 1344da1982abd8ed
parent 1343 a4243fbc2d93
child 1345 e7d277b1e004
IN=15451 - schema2beans change: Add ability to store schemaLocation in mdd file
At the request of Michael Ottati, I'm adding a feature to schema2beans to allow
the schemaLocation (used during XML Schema validation) to be preset in the mdd file.
Fix a bug dealing with ordering of elements with the same name.
schema2beans/test/unit/src/data/TestPositions.dtd
schema2beans/test/unit/src/data/TestPositions.java
schema2beans/test/unit/src/data/TestPositions.xml
schema2beans/test/unit/src/data/TestWebApp.mdd
schema2beans/test/unit/src/data/goldenfiles/TestMain/testPositions.pass
schema2beans/test/unit/src/data/goldenfiles/TestMain/testWebApp.pass
     1.1 --- a/schema2beans/test/unit/src/data/TestPositions.dtd	Fri Sep 19 14:32:41 2003 +0000
     1.2 +++ b/schema2beans/test/unit/src/data/TestPositions.dtd	Fri Sep 19 23:22:27 2003 +0000
     1.3 @@ -6,4 +6,4 @@
     1.4  <!ELEMENT menu-item #PCDATA>
     1.5  <!ELEMENT separator ()>
     1.6  
     1.7 -<!ELEMENT foo (name*, separator, name?)>
     1.8 +<!ELEMENT foo (name*, separator, name?, name?)>
     2.1 --- a/schema2beans/test/unit/src/data/TestPositions.java	Fri Sep 19 14:32:41 2003 +0000
     2.2 +++ b/schema2beans/test/unit/src/data/TestPositions.java	Fri Sep 19 23:22:27 2003 +0000
     2.3 @@ -65,6 +65,7 @@
     2.4          Foo foo = menus.getFoo();
     2.5          check(foo.sizeName() == 2, "There are 2 names");
     2.6          check("name2".equals(foo.getName2()), "name2 is in the right spot");
     2.7 +        check("name3".equals(foo.getName3()), "name3 is in the right spot");
     2.8  
     2.9          out("Adding some colors to the menu.");
    2.10          Menu menu = menus.getMenu(0);
     3.1 --- a/schema2beans/test/unit/src/data/TestPositions.xml	Fri Sep 19 14:32:41 2003 +0000
     3.2 +++ b/schema2beans/test/unit/src/data/TestPositions.xml	Fri Sep 19 23:22:27 2003 +0000
     3.3 @@ -20,5 +20,6 @@
     3.4  		<name>name1-2</name>
     3.5  		<separator/>
     3.6  		<name>name2</name>
     3.7 +	    <name>name3</name>
     3.8  	</foo>
     3.9  </menus>
     4.1 --- a/schema2beans/test/unit/src/data/TestWebApp.mdd	Fri Sep 19 14:32:41 2003 +0000
     4.2 +++ b/schema2beans/test/unit/src/data/TestWebApp.mdd	Fri Sep 19 23:22:27 2003 +0000
     4.3 @@ -933,4 +933,5 @@
     4.4  		<bean-name>DispatcherType</bean-name>
     4.5  		<wrapper-class>java.lang.String</wrapper-class>
     4.6  	</meta-element>
     4.7 +	<schemaLocation>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd</schemaLocation>
     4.8  </metaDD>
     5.1 --- a/schema2beans/test/unit/src/data/goldenfiles/TestMain/testPositions.pass	Fri Sep 19 14:32:41 2003 +0000
     5.2 +++ b/schema2beans/test/unit/src/data/goldenfiles/TestMain/testPositions.pass	Fri Sep 19 23:22:27 2003 +0000
     5.3 @@ -12,6 +12,7 @@
     5.4  		name : String[0,n]
     5.5  		separator : Separator
     5.6  		name2 : String[0,1]
     5.7 +		name3 : String[0,1]
     5.8  
     5.9  Compiling
    5.10  Finished compiling: 0
    5.11 @@ -40,11 +41,13 @@
    5.12  out: 		<name>name1-2</name>
    5.13  out: 		<separator/>
    5.14  out: 		<name>name2</name>
    5.15 +out: 		<name>name3</name>
    5.16  out: 	</foo>
    5.17  out: </menus>
    5.18  out: TestPositions - Check to make sure that elements with the same name get put into the right spot
    5.19  out: TestPositions null There are 2 names -> OK
    5.20  out: TestPositions null name2 is in the right spot -> OK
    5.21 +out: TestPositions null name3 is in the right spot -> OK
    5.22  out: TestPositions - Adding some colors to the menu.
    5.23  out: <?xml version='1.0' encoding='UTF-8' ?>
    5.24  out: <menus>
    5.25 @@ -75,6 +78,7 @@
    5.26  out: 		<name>name1-2</name>
    5.27  out: 		<separator/>
    5.28  out: 		<name>name2</name>
    5.29 +out: 		<name>name3</name>
    5.30  out: 	</foo>
    5.31  out: </menus>
    5.32  out: TestPositions null sizeMenuItem=8 -> OK
    5.33 @@ -120,6 +124,7 @@
    5.34  out: 		<name>name1-2</name>
    5.35  out: 		<separator/>
    5.36  out: 		<name>name2</name>
    5.37 +out: 		<name>name3</name>
    5.38  out: 	</foo>
    5.39  out: </menus>
    5.40  out: TestPositions - Removing 7
    5.41 @@ -153,6 +158,7 @@
    5.42  out: 		<name>name1-2</name>
    5.43  out: 		<separator/>
    5.44  out: 		<name>name2</name>
    5.45 +out: 		<name>name3</name>
    5.46  out: 	</foo>
    5.47  out: </menus>
    5.48  out: TestPositions - Replacing menu items with few letters
    5.49 @@ -180,6 +186,7 @@
    5.50  out: 		<name>name1-2</name>
    5.51  out: 		<separator/>
    5.52  out: 		<name>name2</name>
    5.53 +out: 		<name>name3</name>
    5.54  out: 	</foo>
    5.55  out: </menus>
    5.56  Finished running TestPositions: 0
     6.1 --- a/schema2beans/test/unit/src/data/goldenfiles/TestMain/testWebApp.pass	Fri Sep 19 14:32:41 2003 +0000
     6.2 +++ b/schema2beans/test/unit/src/data/goldenfiles/TestMain/testWebApp.pass	Fri Sep 19 23:22:27 2003 +0000
     6.3 @@ -217,7 +217,7 @@
     6.4  out: TestWebApp - creating the bean graph
     6.5  out: TestWebApp - bean graph created
     6.6  out: <?xml version='1.0' encoding='UTF-8' ?>
     6.7 -out: <web-app xmlns='http://java.sun.com/xml/ns/j2ee' version='2.4'>
     6.8 +out: <web-app xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd' version='2.4'>
     6.9  out: 	<description>This is my Web App</description>
    6.10  out: 	<display-name>MyWebApp</display-name>
    6.11  out: 	<distributable>false</distributable>
    6.12 @@ -228,7 +228,7 @@
    6.13  out: </web-app>
    6.14  out: TestWebApp - Setting distributable to true
    6.15  out: <?xml version='1.0' encoding='UTF-8' ?>
    6.16 -out: <web-app xmlns='http://java.sun.com/xml/ns/j2ee' version='2.4'>
    6.17 +out: <web-app xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd' version='2.4'>
    6.18  out: 	<description>This is my Web App</description>
    6.19  out: 	<display-name>MyWebApp</display-name>
    6.20  out: 	<distributable>true</distributable>
    6.21 @@ -239,7 +239,7 @@
    6.22  out: </web-app>
    6.23  out: TestWebApp - Adding filters
    6.24  out: <?xml version='1.0' encoding='UTF-8' ?>
    6.25 -out: <web-app xmlns='http://java.sun.com/xml/ns/j2ee' version='2.4'>
    6.26 +out: <web-app xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd' version='2.4'>
    6.27  out: 	<description>This is my Web App</description>
    6.28  out: 	<display-name>MyWebApp</display-name>
    6.29  out: 	<distributable>true</distributable>
    6.30 @@ -259,7 +259,7 @@
    6.31  out: 	</filter>
    6.32  out: </web-app>
    6.33  out: <?xml version='1.0' encoding='UTF-8' ?>
    6.34 -out: <web-app xmlns='http://java.sun.com/xml/ns/j2ee' version='2.4'>
    6.35 +out: <web-app xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd' version='2.4'>
    6.36  out: 	<description>This is my Web App</description>
    6.37  out: 	<display-name>MyWebApp</display-name>
    6.38  out: 	<distributable>true</distributable>