### Eclipse Workspace Patch 1.0
#P magnolia-core
Index: src/test/java/info/magnolia/cms/core/ie/MagnoliaV2FilterTest.java
===================================================================
RCS file: src/test/java/info/magnolia/cms/core/ie/MagnoliaV2FilterTest.java
diff -N src/test/java/info/magnolia/cms/core/ie/MagnoliaV2FilterTest.java
--- src/test/java/info/magnolia/cms/core/ie/MagnoliaV2FilterTest.java	10 Mar 2009 09:32:07 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,98 +0,0 @@
-package info.magnolia.cms.core.ie;
-
-import info.magnolia.cms.core.ie.filters.MagnoliaV2Filter;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.util.Iterator;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.custommonkey.xmlunit.DetailedDiff;
-import org.custommonkey.xmlunit.Diff;
-import org.custommonkey.xmlunit.Difference;
-import org.custommonkey.xmlunit.XMLTestCase;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * Test MagnoliaV2Filter behaviour, fixed bugs, etc...
- *
- * Loosely based on DataTransporterTest.java
- * @author hpaluch
- *
- */
-public class MagnoliaV2FilterTest extends XMLTestCase {
-
-	private static Logger log = LoggerFactory.getLogger(MagnoliaV2FilterTest.class);
-
-	
-	/**
-	 * Test bogus sv:value creation while replacing MetaData jcr:primary block
-	 * See http://jira.magnolia-cms.com/browse/MAGNOLIA-2653 for details.
-	 * @throws Exception
-	 */
-	public void testBogusMetaElement() throws Exception {
-	final String INPUT_XML_FILE = "/test-v2-filter.xml";
-    File inputFile = new File(getClass().getResource(INPUT_XML_FILE).getFile());
-    File outputFile = File.createTempFile("v2filter-out-", ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
-    OutputStream os = new FileOutputStream(outputFile);
-
-    // simulate DataTransporter Formatting
-    OutputFormat outputFormat = new OutputFormat();
-    outputFormat.setPreserveSpace(false); // this is ok, doesn't affect text nodes??
-    outputFormat.setIndenting(true);
-    outputFormat.setIndent(2 /*INDENT_VALUE*/);
-    outputFormat.setLineWidth(120); // need to be set after setIndenting()!
-
-
-    
-	 XMLSerializer xmlSerializer =new XMLSerializer(os,outputFormat);
-			      
-    
-    //XMLReader inputXmlReader = XMLReaderFactory.createXMLReader(org.apache.xerces.parsers.SAXParser.class.getName());
-    XMLReader v2Reader = XMLReaderFactory.createXMLReader(org.apache.xerces.parsers.SAXParser.class.getName());
-
-    MagnoliaV2Filter v2Filter = new MagnoliaV2Filter(v2Reader);
-    v2Filter.setContentHandler(xmlSerializer);
-    InputStream is = new FileInputStream(inputFile);
-    v2Filter.parse(new InputSource(is));
-    //System.err.println("Output in: "+outputFile.getAbsolutePath());
-
-    IOUtils.closeQuietly(is);
-    IOUtils.closeQuietly(os);
-    
-    // XXX: Fixme - UTF-8!
-    Reader expectedReader = new FileReader(new File(getClass()
-            .getResource(INPUT_XML_FILE)
-            .getFile()));
-    Reader actualReader = new FileReader(outputFile);
-
-    DetailedDiff xmlDiff = new DetailedDiff(new Diff(expectedReader, actualReader));
-
-        IOUtils.closeQuietly(expectedReader);
-        IOUtils.closeQuietly(actualReader);        
-
-        for (Iterator iter = xmlDiff.getAllDifferences().iterator(); iter.hasNext();) {
-            Difference d = (Difference) iter.next();
-            log.warn(d.getControlNodeDetail().getXpathLocation()+" expected: '" + d.getControlNodeDetail().getValue()+"'");
-            log.warn(d.getTestNodeDetail().getXpathLocation()+" actual:   '" + d.getTestNodeDetail().getValue()+"'");
-
-        }
-
-        assertTrue("Document "+outputFile.getAbsolutePath()+" is not formatted as expected", xmlDiff.identical());
-        outputFile.delete(); // Delete working file on success (keep for diagnostits on error )
-    
-    
-	}
-	
-}
Index: src/test/resources/test-v2-filter.xml
===================================================================
RCS file: src/test/resources/test-v2-filter.xml
diff -N src/test/resources/test-v2-filter.xml
--- src/test/resources/test-v2-filter.xml	10 Mar 2009 08:19:22 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<sv:node sv:name="Test" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mgnl="http://www.magnolia.info/jcr/mgnl"
-  xmlns:rep="internal" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
-  xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xs="http://www.w3.org/2001/XMLSchema"
-  xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:jcrfn="http://www.jcp.org/jcr/xpath-functions/1.0">
-  <sv:property sv:name="jcr:primaryType" sv:type="Name">
-    <sv:value>mgnl:content</sv:value>
-  </sv:property>
-  <sv:property sv:name="jcr:mixinTypes" sv:type="Name">
-    <sv:value>mix:lockable</sv:value>
-  </sv:property>
-  <sv:property sv:name="jcr:uuid" sv:type="String">
-    <sv:value>244d8eeb-c9bc-46e2-8efb-79f8729f512c</sv:value>
-  </sv:property>
-  <sv:property sv:name="jcr:created" sv:type="Date">
-    <sv:value>2009-03-09T12:20:25.822+01:00</sv:value>
-  </sv:property>
-  <sv:property sv:name="title" sv:type="String">
-    <sv:value>test</sv:value>
-  </sv:property>
-  <sv:property sv:name="type" sv:type="String">
-    <sv:value>folder</sv:value>
-  </sv:property>
-  <sv:node sv:name="MetaData">
-    <sv:property sv:name="jcr:primaryType" sv:type="Name">
-      <sv:value>mgnl:metaData</sv:value>
-    </sv:property>
-    <sv:property sv:name="jcr:created" sv:type="Date">
-      <sv:value>2009-03-09T12:20:25.822+01:00</sv:value>
-    </sv:property>
-    <sv:property sv:name="mgnl:authorid" sv:type="String">
-      <sv:value>superuser</sv:value>
-    </sv:property>
-    <sv:property sv:name="mgnl:creationdate" sv:type="Date">
-      <sv:value>2009-03-09T12:20:25.827+01:00</sv:value>
-    </sv:property>
-    <sv:property sv:name="mgnl:lastmodified" sv:type="Date">
-      <sv:value>2009-03-09T12:20:45.232+01:00</sv:value>
-    </sv:property>
-  </sv:node>
-</sv:node>
