/*
 * Copyright, 2004-2005 Sun Microsystems, Inc. All Rights Reserved.
 *
 * Software is licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may
 * obtain a copy of the License at:
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations.
 *
 *    Sun supports and benefits from the global community of open source
 * developers, and thanks the community for its important contributions and
 * open standards-based technology, which Sun has adopted into many of its
 * products.
 *
 *    Please note that portions of Software may be provided with notices and
 * open source licenses from such communities and third parties that govern the
 * use of those portions, and any licenses granted hereunder do not alter any
 * rights and obligations you may have under such open source licenses,
 * however, the disclaimer of warranty and limitation of liability provisions
 * in this License will apply to all Software in this distribution.
 *
 *    You acknowledge that the Software is not designed, licensed or intended
 * for use in the design, construction, operation or maintenance of any nuclear
 * facility.
 *
 * Apache License
 * Version 2.0, January 2004
 * http://www.apache.org/licenses/
 *
 */

package com.sun.japex.jdsl.xml.bind.unmarhsal;

import com.sun.japex.TestCase;
import javax.xml.stream.XMLInputFactory;
import com.sun.japex.jdsl.xml.bind.unmarhsal.BaseUnmarshallerDriver;

public class JAXBSunSJSXPStAXDriver extends BaseUnmarshallerDriver {
    XMLInputFactory _factory;
        
    public void initializeDriver() {
        super.initializeDriver();
        
        try {
            _factory = new com.sun.xml.stream.ZephyrParserFactory();
        } 
        catch (Exception e) {
            e.printStackTrace();
        }
    }
            
    public void run(TestCase testCase) {
        try {
            _inputStream.reset();
            _unmarshaller.unmarshal(_factory.createXMLStreamReader(_inputStream));
        } 
        catch (Exception e) {
            e.printStackTrace();
        }
    } 
}

@@ -1629,19 +1629,17 @@
 marhsal;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -1661,17 +1661,16 @@
 estCase;
-%0D
 %0Aimport 
@@ -1702,17 +1702,57 @@
 Factory;
-%0D
+%0Aimport javax.xml.stream.XMLStreamReader;
 %0Aimport 
@@ -1816,11 +1816,9 @@
 ver;
-%0D%0A%0D
+%0A
 %0Apub
@@ -1882,17 +1882,16 @@
 Driver %7B
-%0D
 %0A    XML
@@ -1912,17 +1912,16 @@
 factory;
-%0D
 %0A       
@@ -1913,33 +1913,32 @@
 actory;%0A        
-%0D
 %0A    public void
@@ -1958,17 +1958,16 @@
 iver() %7B
-%0D
 %0A       
@@ -1992,17 +1992,16 @@
 river();
-%0D
 %0A       
@@ -1997,25 +1997,24 @@
 ();%0A        
-%0D
 %0A        try
@@ -2007,33 +2007,32 @@
   %0A        try %7B
-%0D
 %0A            _fa
@@ -2084,17 +2084,16 @@
 ctory();
-%0D
 %0A       
@@ -2087,33 +2087,32 @@
 ry();%0A        %7D 
-%0D
 %0A        catch (
@@ -2117,33 +2117,32 @@
  (Exception e) %7B
-%0D
 %0A            e.p
@@ -2150,33 +2150,32 @@
 intStackTrace();
-%0D
 %0A        %7D%0D%0A    
@@ -2172,16 +2172,14 @@
    %7D
-%0D
 %0A    %7D
-%0D
 %0A   
@@ -2187,17 +2187,16 @@
         
-%0D
 %0A    pub
@@ -2224,25 +2224,24 @@
  testCase) %7B
-%0D
 %0A        try
@@ -2242,17 +2242,16 @@
    try %7B
-%0D
 %0A       
@@ -2276,17 +2276,16 @@
 reset();
-%0D
 %0A       
@@ -2293,32 +2293,33 @@
     
-_unmarshaller.unmarshal(
+XMLStreamReader reader = 
 _fac
@@ -2358,19 +2358,90 @@
 tStream)
+;%0A            _unmarshaller.unmarshal(reader);%0A            reader.close(
 );
-%0D
 %0A       
@@ -2443,17 +2443,16 @@
       %7D 
-%0D
 %0A       
@@ -2473,17 +2473,16 @@
 ion e) %7B
-%0D
 %0A       
@@ -2506,17 +2506,16 @@
 Trace();
-%0D
 %0A       
@@ -2520,17 +2520,14 @@
    %7D
-%0D
 %0A    %7D 
-%0D
 %0A%7D
-%0D
 %0A

Call XMLStreamReader.close() after unmarshalling the document.