// Path: segment/src/main/java/net/loomchild/segment/util/Util.java
// public static Reader getReader(InputStream inputStream) {
// 	try {
// 		Reader reader = new InputStreamReader(inputStream, "utf-8");
// 		return reader;
// 	} catch (UnsupportedEncodingException e) {
// 		throw new IORuntimeException(e);
// 	}
// }
// 
// Path: segment/src/main/java/net/loomchild/segment/util/Util.java
// public static InputStream getResourceStream(String name) {
// 	InputStream inputStream = Util.class.getClassLoader()
// 			.getResourceAsStream(name);
// 	if (inputStream == null) {
// 		throw new ResourceNotFoundException(name);
// 	}
// 	return inputStream;
// }
// 
// Path: segment/src/main/java/net/loomchild/segment/util/XmlException.java
// public class XmlException extends RuntimeException {
// 
// 	private static final long serialVersionUID = -143693366659133245L;
// 
// 	public XmlException(String message) {
// 		super(message);
// 	}
// 
// 	public XmlException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	public XmlException(Throwable cause) {
// 		super(cause);
// 	}
// 
// }


import static net.loomchild.segment.util.Util.getReader;
import static net.loomchild.segment.util.Util.getResourceStream;
import java.io.BufferedReader;
import junit.framework.TestCase;
import net.loomchild.segment.util.XmlException;
package net.loomchild.segment.srx.io;




public class SrxVersionTest extends TestCase {

	public static final String SRX_1_DOCUMENT_NAME = "net/loomchild/segment/res/test/example1.srx";
	public static final String SRX_2_DOCUMENT_NAME = "net/loomchild/segment/res/test/example2.srx";
	public static final String NO_SRX_DOCUMENT_NAME = "net/loomchild/segment/res/test/some.xml";
	public static final String SRX_NOVERSION_DOCUMENT_NAME = "net/loomchild/segment/res/test/invalid.srx";

	public void testGetSrxVersion() {
		BufferedReader reader = new BufferedReader(
				getReader(getResourceStream(SRX_1_DOCUMENT_NAME)));
		SrxVersion version = SrxVersion.parse(reader);
		assertEquals(SrxVersion.VERSION_1_0, version);

		reader = new BufferedReader(
				getReader(getResourceStream(SRX_2_DOCUMENT_NAME)));
		version = SrxVersion.parse(reader);
		assertEquals(SrxVersion.VERSION_2_0, version);

		try {
// Path: segment/src/main/java/net/loomchild/segment/util/Util.java
// public static Reader getReader(InputStream inputStream) {
// 	try {
// 		Reader reader = new InputStreamReader(inputStream, "utf-8");
// 		return reader;
// 	} catch (UnsupportedEncodingException e) {
// 		throw new IORuntimeException(e);
// 	}
// }
// 
// Path: segment/src/main/java/net/loomchild/segment/util/Util.java
// public static InputStream getResourceStream(String name) {
// 	InputStream inputStream = Util.class.getClassLoader()
// 			.getResourceAsStream(name);
// 	if (inputStream == null) {
// 		throw new ResourceNotFoundException(name);
// 	}
// 	return inputStream;
// }
// 
// Path: segment/src/main/java/net/loomchild/segment/util/XmlException.java
// public class XmlException extends RuntimeException {
// 
// 	private static final long serialVersionUID = -143693366659133245L;
// 
// 	public XmlException(String message) {
// 		super(message);
// 	}
// 
// 	public XmlException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// 
// 	public XmlException(Throwable cause) {
// 		super(cause);
// 	}
// 
// }


// Path: segment/src/test/java/net/loomchild/segment/srx/io/SrxVersionTest.java
import static net.loomchild.segment.util.Util.getReader;
import static net.loomchild.segment.util.Util.getResourceStream;
import java.io.BufferedReader;
import junit.framework.TestCase;
import net.loomchild.segment.util.XmlException;

package net.loomchild.segment.srx.io;




public class SrxVersionTest extends TestCase {

	public static final String SRX_1_DOCUMENT_NAME = "net/loomchild/segment/res/test/example1.srx";
	public static final String SRX_2_DOCUMENT_NAME = "net/loomchild/segment/res/test/example2.srx";
	public static final String NO_SRX_DOCUMENT_NAME = "net/loomchild/segment/res/test/some.xml";
	public static final String SRX_NOVERSION_DOCUMENT_NAME = "net/loomchild/segment/res/test/invalid.srx";

	public void testGetSrxVersion() {
		BufferedReader reader = new BufferedReader(
				getReader(getResourceStream(SRX_1_DOCUMENT_NAME)));
		SrxVersion version = SrxVersion.parse(reader);
		assertEquals(SrxVersion.VERSION_1_0, version);

		reader = new BufferedReader(
				getReader(getResourceStream(SRX_2_DOCUMENT_NAME)));
		version = SrxVersion.parse(reader);
		assertEquals(SrxVersion.VERSION_2_0, version);

		try {
			reader = new BufferedReader(