package org.springframework.social.eventbrite.api;

import static org.junit.Assert.*;
import static org.custommonkey.xmlunit.XMLAssert.*;


import java.io.StringWriter;

import javax.xml.bind.JAXB;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.ValidationEvent;
import javax.xml.bind.ValidationEventHandler;

import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.custommonkey.xmlunit.XMLAssert;
import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Before;
import org.junit.Test;


public class EventSearchResultsTest {

	@Before
	public void setUp() throws Exception {}

	@Test
	public void testSerialization() throws Exception {
		XMLUnit.setIgnoreWhitespace(true);
		
		EventSearchResults r = 
				JAXB.unmarshal(getClass().getResourceAsStream("/EventSearchResults.xml"), 
						EventSearchResults.class);
		StringWriter sw = new StringWriter();
		JAXB.marshal(r, sw);
		String expected = 
				IOUtils.toString(getClass().getResourceAsStream("/EventSearchResults.xml"), "UTF-8");
		String actual = sw.toString();
		//System.out.println(expected);
		System.out.println(actual);
		assertXMLEqual(expected, actual);
		
		
	}
	
	
	private static final Logger log = Logger.getLogger(EventSearchResultsTest.class);

}

@@ -49,42 +49,8 @@
 i;%0A%0A
-import static org.junit.Assert.*;%0A
 impo
@@ -98,11 +98,23 @@
 ert.
-*;%0A
+assertXMLEqual;
 %0A%0Aim
@@ -172,201 +172,8 @@
 AXB;
-%0Aimport javax.xml.bind.JAXBContext;%0Aimport javax.xml.bind.JAXBException;%0Aimport javax.xml.bind.Unmarshaller;%0Aimport javax.xml.bind.ValidationEvent;%0Aimport javax.xml.bind.ValidationEventHandler;
 %0A%0Aim
@@ -244,51 +244,8 @@
 er;%0A
-import org.custommonkey.xmlunit.XMLAssert;%0A
 impo

Remove warnings.