@Test
	public void testWriteLegacyFromScratch() {
		//Reset schemas
		try {
			PageXmlInputOutput.setAdditionalSchemaLocation(null, null);
		} catch (NoSchemasException e1) {
			e1.printStackTrace();
		}
		
		Page pageFromScratch = new Page();
		
		//Try to write without conversion
		PageWriter writer;
		try {
			writer = PageXmlInputOutput.getWriter(new XmlFormatVersion("2009-03-16"));
		} catch (UnsupportedSchemaVersionException e) {
			fail(e.getMessage());
			return;
		}
		try {
			writer.write(pageFromScratch, new FileTarget(fromScratchLegacyOutputFile));
			fail("Exception was expected");
		} catch (UnsupportedFormatVersionException e) {
			//Expected
		}
		
		//Convert and try to save again
		try {
			pageFromScratch.setFormatVersion(PageXmlInputOutput.getInstance().getFormatModel(new XmlFormatVersion("2009-03-16")));
		} catch (UnsupportedFormatVersionException e) {
			e.printStackTrace();
		}
		try {
			writer.write(pageFromScratch, new FileTarget(fromScratchLegacyOutputFile));
		} catch (UnsupportedFormatVersionException e) {
			e.printStackTrace();
			fail(e.getMessage());
		}
		
		assertTrue(fromScratchLegacyOutputFile.exists());
	}