package jmetest.renderer.loader;

import com.jme.app.SimpleGame;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.model.XMLparser.SAXReader;
import com.jme.scene.model.XMLparser.XMLWriter;
import com.jme.scene.Node;

import java.io.*;


/**
 *
 * Test class for XML loading/writting with jME
 * Started Date: May 30, 2004
 * @author Jack Lindamood
 */
public class TestXMLLoader extends SimpleGame{


    public static void main(String[] args){
        new TestXMLLoader().start();
    }

    protected void simpleInitGame() {
        lightState.get(0).setSpecular(new ColorRGBA(1,1,1,1));

        SAXReader r=new SAXReader();
        try {
            r.loadXML(new File("CVS root/data/XML docs/newSampleScene.xml").toURL().openStream());
        } catch (IOException e) {
            System.out.println("bad File exception" + e.getCause() + "*" + e.getMessage());
        }
        Node mi1=r.fetchCopy();
//        rootNode.attachChild(mi1);
        ByteArrayOutputStream BO=new ByteArrayOutputStream();
        XMLWriter rr=new XMLWriter(BO);
        try {
            rr.writeScene(mi1);
        } catch (IOException e) {
            e.printStackTrace();
        }
        r.loadXML(new ByteArrayInputStream(BO.toByteArray()));
        Node mi2=r.fetchCopy();
        rootNode.attachChild(mi2);
        System.out.print(BO);
    }
}

@@ -624,24 +624,47 @@
 AXReader();%0A
+        Node mi1=null;%0A
         try 
@@ -669,32 +669,36 @@
 y %7B%0A            
+mi1=
 r.loadXML(new Fi
@@ -705,17 +705,8 @@
 le(%22
-CVS root/
 data
@@ -899,40 +899,8 @@
   %7D%0A
-        Node mi1=r.fetchCopy();%0A
 //  
@@ -928,24 +928,25 @@
 Child(mi1);%0A
+%0A
         Byte
@@ -1158,16 +1158,46 @@
       %7D%0A
+        System.out.print(BO);%0A
         
@@ -1322,37 +1322,8 @@
 2);%0A
-        System.out.print(BO);
 %0A   

Cleaned up the test class.