< prev index next >

jdk/test/javax/xml/bind/marshal/8134111/UnmarshalTest.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 8134111
  27  * @summary test that elements without namespace is ignored by unmarshaller
  28  *          when elementFormDefault is set to QUALIFIED.
  29  * @compile testTypes/package-info.java testTypes/Root.java
  30  *          testTypes/WhenType.java testTypes/ObjectFactory.java
  31  * @modules java.xml.bind



  32  * @run testng/othervm UnmarshalTest
  33  */
  34 
  35 import java.io.StringReader;
  36 import javax.xml.bind.JAXBContext;
  37 import javax.xml.bind.Unmarshaller;
  38 import org.testng.annotations.Test;
  39 import static org.testng.Assert.assertNull;
  40 import org.xml.sax.InputSource;
  41 import testTypes.Root;
  42 
  43 public class UnmarshalTest {
  44 
  45     @Test
  46     public void unmarshalUnexpectedNsTest() throws Exception {
  47         JAXBContext context;
  48         Unmarshaller unm;
  49         // Create JAXB context from testTypes package
  50         context = JAXBContext.newInstance("testTypes");
  51         // Create unmarshaller from JAXB context


   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 8134111
  27  * @summary test that elements without namespace is ignored by unmarshaller
  28  *          when elementFormDefault is set to QUALIFIED.


  29  * @modules java.xml.bind
  30  * @compile UnmarshalTest.java
  31  *          testTypes/package-info.java testTypes/Root.java
  32  *          testTypes/WhenType.java testTypes/ObjectFactory.java
  33  * @run testng/othervm UnmarshalTest
  34  */
  35 
  36 import java.io.StringReader;
  37 import javax.xml.bind.JAXBContext;
  38 import javax.xml.bind.Unmarshaller;
  39 import org.testng.annotations.Test;
  40 import static org.testng.Assert.assertNull;
  41 import org.xml.sax.InputSource;
  42 import testTypes.Root;
  43 
  44 public class UnmarshalTest {
  45 
  46     @Test
  47     public void unmarshalUnexpectedNsTest() throws Exception {
  48         JAXBContext context;
  49         Unmarshaller unm;
  50         // Create JAXB context from testTypes package
  51         context = JAXBContext.newInstance("testTypes");
  52         // Create unmarshaller from JAXB context
< prev index next >