package com.infomancers.tests;
import com.infomancers.collections.iterators.TreeIterators;
import com.infomancers.collections.tree.DOMAdapter;
import com.infomancers.collections.tree.TreeAdapter;
import junit.framework.Assert;
import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Iterator;
/**
* Created by IntelliJ IDEA.
* User: aviadbd
* Date: Jul 20, 2007
* Time: 12:52:56 PM
* To change this template use File | Settings | File Templates.
*/
public class TreeTests {
@Test
public void simpleDomPrefix() throws ParserConfigurationException, IOException, SAXException {
String xml = "Hello!";
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(new ByteArrayInputStream(xml.getBytes()));
TreeAdapter adapter = new DOMAdapter(doc);
Iterator