incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svanteschub...@apache.org
Subject svn commit: r1795827 - in /incubator/odf/trunk: odfdom/src/test/java/org/odftoolkit/odfdom/doc/ odfdom/src/test/java/org/odftoolkit/odfdom/utils/ simple/src/test/java/org/odftoolkit/simple/ simple/src/test/java/org/odftoolkit/simple/meta/ simple/src/te...
Date Mon, 22 May 2017 16:06:16 GMT
Author: svanteschubert
Date: Mon May 22 16:06:16 2017
New Revision: 1795827

URL: http://svn.apache.org/viewvc?rev=1795827&view=rev
Log:
#ODFTOOLKIT-453# Temporary test files moved into build directory. Patched by Ian Cunningham

Modified:
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/ChartTemplateTest.java
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/GraphicsTemplateTest.java
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/PresentationTemplateTest.java
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/SpreadsheetTemplateTest.java
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/TextTemplateTest.java
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/utils/ResourceUtilities.java
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/ChartTemplateTest.java
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/GraphicsTemplateTest.java
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/PresentationTemplateTest.java
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetTemplateTest.java
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/TextTemplateTest.java
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/meta/OfficeMetaTest.java
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/utils/ResourceUtilities.java

Modified: incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/ChartTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/ChartTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/ChartTemplateTest.java (original)
+++ incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/ChartTemplateTest.java Mon May 22 16:06:16 2017
@@ -1,5 +1,5 @@
 /************************************************************************
-* 
+*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
@@ -21,7 +21,6 @@
 package org.odftoolkit.odfdom.doc;
 
 import java.io.File;
-
 import org.junit.Assert;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -45,7 +44,7 @@ public class ChartTemplateTest {
 	@Test
 	public void testSavingAChartTemplate() throws Exception {
 		OdfDocument document = OdfDocument.loadDocument(ResourceUtilities.getAbsolutePath(TEST_CHART_TEMPLATE));
-		File destination = File.createTempFile("odfdom-test", ".otc");
+		File destination = File.createTempFile("odfdom-test", ".otc", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again
@@ -62,7 +61,7 @@ public class ChartTemplateTest {
 
 		Assert.assertEquals(OdfDocument.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
 				document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("odfdom-test", ".otc");
+		File destination = File.createTempFile("odfdom-test", ".otc", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again

Modified: incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/GraphicsTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/GraphicsTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/GraphicsTemplateTest.java (original)
+++ incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/GraphicsTemplateTest.java Mon May 22 16:06:16 2017
@@ -21,9 +21,9 @@
 package org.odftoolkit.odfdom.doc;
 
 import java.io.File;
-
 import org.junit.Assert;
 import org.junit.Test;
+import org.odftoolkit.odfdom.utils.ResourceUtilities;
 
 /**
  * Test class for template aspects of graphics.
@@ -42,7 +42,7 @@ public class GraphicsTemplateTest {
 	@Test
 	public void testSavingAGraphicsTemplate() throws Exception {
 		OdfDocument document = OdfDocument.loadDocument(this.getClass().getResourceAsStream(TEST_GRAPHICS_TEMPLATE));
-		File destination = File.createTempFile("odfdom-test", ".otg");
+		File destination = File.createTempFile("odfdom-test", ".otg", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again
@@ -55,7 +55,7 @@ public class GraphicsTemplateTest {
 		OdfDocument document = OdfGraphicsDocument.newGraphicsTemplateDocument();
 		Assert.assertEquals(OdfDocument.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
 		Assert.assertEquals(OdfDocument.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("odfdom-test", ".otg");
+		File destination = File.createTempFile("odfdom-test", ".otg", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again

Modified: incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/PresentationTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/PresentationTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/PresentationTemplateTest.java (original)
+++ incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/PresentationTemplateTest.java Mon May 22 16:06:16 2017
@@ -21,9 +21,9 @@
 package org.odftoolkit.odfdom.doc;
 
 import java.io.File;
-
 import org.junit.Assert;
 import org.junit.Test;
+import org.odftoolkit.odfdom.utils.ResourceUtilities;
 
 /**
  * Test class for template aspects of presentations.
@@ -42,7 +42,7 @@ public class PresentationTemplateTest {
 	@Test
 	public void testSavingAPresentationTemplate() throws Exception {
 		OdfDocument document = OdfDocument.loadDocument(this.getClass().getResourceAsStream(TEST_PRESENTATION));
-		File destination = File.createTempFile("odfdom-test", ".otp");
+		File destination = File.createTempFile("odfdom-test", ".otp", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again
@@ -56,7 +56,7 @@ public class PresentationTemplateTest {
 		Assert.assertEquals(OdfDocument.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
 		Assert.assertEquals(OdfDocument.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
 
-		File destination = File.createTempFile("odfdom-test", ".otp");
+		File destination = File.createTempFile("odfdom-test", ".otp", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again

Modified: incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/SpreadsheetTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/SpreadsheetTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/SpreadsheetTemplateTest.java (original)
+++ incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/SpreadsheetTemplateTest.java Mon May 22 16:06:16 2017
@@ -21,9 +21,9 @@
 package org.odftoolkit.odfdom.doc;
 
 import java.io.File;
-
 import org.junit.Assert;
 import org.junit.Test;
+import org.odftoolkit.odfdom.utils.ResourceUtilities;
 
 /**
  * Test class for template aspects of calc documents.
@@ -42,7 +42,7 @@ public class SpreadsheetTemplateTest {
 	@Test
 	public void testSavingASpreadsheetTemplate() throws Exception {
 		OdfDocument document = OdfDocument.loadDocument(this.getClass().getResourceAsStream(TEST_SPREADSHEET_TEMPLATE));
-		File destination = File.createTempFile("odfdom-test", ".ots");
+		File destination = File.createTempFile("odfdom-test", ".ots", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again
@@ -55,7 +55,7 @@ public class SpreadsheetTemplateTest {
 		OdfDocument document = OdfSpreadsheetDocument.newSpreadsheetTemplateDocument();
 		Assert.assertEquals(OdfDocument.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
 		Assert.assertEquals(OdfDocument.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("odfdom-test", ".ots");
+		File destination = File.createTempFile("odfdom-test", ".ots", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again

Modified: incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/TextTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/TextTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/TextTemplateTest.java (original)
+++ incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/doc/TextTemplateTest.java Mon May 22 16:06:16 2017
@@ -21,13 +21,13 @@
 package org.odftoolkit.odfdom.doc;
 
 import java.io.File;
-
 import org.junit.Assert;
 import org.junit.Test;
+import org.odftoolkit.odfdom.utils.ResourceUtilities;
 
 /**
  * Test class for template aspects of calc documents.
- * 
+ *
  * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
  */
 public class TextTemplateTest {
@@ -44,7 +44,7 @@ public class TextTemplateTest {
 	@Test
 	public void testSavingATextTemplate() throws Exception {
 		OdfDocument document = OdfDocument.loadDocument(this.getClass().getResourceAsStream(TEST_TEXT_TEMPLATE));
-		File destination = File.createTempFile("odfdom-test", ".ott");
+		File destination = File.createTempFile("odfdom-test", ".ott", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again
@@ -60,7 +60,7 @@ public class TextTemplateTest {
 				document.getMediaTypeString());
 		Assert.assertEquals(OdfDocument.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
 				document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("odfdom-test", ".ott");
+		File destination = File.createTempFile("odfdom-test", ".ott", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again
@@ -77,7 +77,7 @@ public class TextTemplateTest {
 				document.getMediaTypeString());
 		Assert.assertEquals(OdfDocument.OdfMediaType.TEXT_MASTER.getMediaTypeString(),
 				document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("odfdom-test", ".ott");
+		File destination = File.createTempFile("odfdom-test", ".ott", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again
@@ -94,7 +94,7 @@ public class TextTemplateTest {
 				document.getMediaTypeString());
 		Assert.assertEquals(OdfDocument.OdfMediaType.TEXT_WEB.getMediaTypeString(),
 				document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("odfdom-test", ".ott");
+		File destination = File.createTempFile("odfdom-test", ".ott", ResourceUtilities.getTempTestDirectory());
 		document.save(destination);
 
 		// load again

Modified: incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/utils/ResourceUtilities.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/utils/ResourceUtilities.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/utils/ResourceUtilities.java (original)
+++ incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/utils/ResourceUtilities.java Mon May 22 16:06:16 2017
@@ -27,11 +27,11 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import org.odftoolkit.odfdom.pkg.rdfa.Util;
 
+
 /** Test utility class providing resources for the test in- and output */
 public final class ResourceUtilities {
 
@@ -65,7 +65,7 @@ public final class ResourceUtilities {
 	public static URI getURI(String relativeFilePath) throws URISyntaxException {
 		String filePath = "file:" + ResourceUtilities.class.getClassLoader().getResource(relativeFilePath).getPath();
 		filePath = Util.toExternalForm(new URI(filePath));
-		return new URI(filePath);		
+		return new URI(filePath);
 	}
 
 	/** The relative path of the test file will be used to determine an absolute
@@ -100,7 +100,7 @@ public final class ResourceUtilities {
 		return new File(filepath);
 	}
 
-	/** 
+	/**
 	 * @return the absolute path of the test output folder, which is usually <code>target/test-classes/</code>.
 	 */
 	public static String getTestOutputFolder() {
@@ -110,6 +110,12 @@ public final class ResourceUtilities {
 		} catch (URISyntaxException ex) {
 			Logger.getLogger(ResourceUtilities.class.getName()).log(Level.SEVERE, null, ex);
 		}
-		return testFolder;		
+		return testFolder;
+	}
+
+	public static File getTempTestDirectory() {
+		File tempDir = new File(ResourceUtilities.getTestOutputFolder() + "temp");
+		tempDir.mkdir(); //if it already exist no problem
+ 		return tempDir;
 	}
 }

Modified: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/ChartTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/ChartTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/ChartTemplateTest.java (original)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/ChartTemplateTest.java Mon May 22 16:06:16 2017
@@ -1,155 +1,157 @@
-/* 
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package org.odftoolkit.simple;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test class for template aspects of chart.
- */
-public class ChartTemplateTest {
-	
-	private static final Logger LOG = Logger.getLogger(ChartTemplateTest.class.getName());
-	private static final String TEST_CHART_TEMPLATE = "/chartTestTemplate.otc";
-
-	@Test
-	public void testLoadingAChartTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_CHART_TEMPLATE));
-		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
-				document.getMediaTypeString());
-	}
-
-	@Test
-	public void testSavingAChartTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_CHART_TEMPLATE));
-		File destination = File.createTempFile("simple-test", ".otc");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-	}
-
-	@Test
-	public void testNewChartTemplate() throws Exception {
-		Document document = ChartDocument.newChartTemplateDocument();
-		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
-				document.getMediaTypeString());
-
-		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
-				document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("simple-test", ".otc");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-		Assert.assertTrue(document instanceof ChartDocument);
-	}
-
-	@Test
-	public void testSwitchingOdfChartDocument() throws Exception {
-		ChartDocument document = ChartDocument.newChartDocument();
-		document.changeMode(ChartDocument.OdfMediaType.CHART_TEMPLATE);
-		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
-				document.getPackage().getMediaTypeString());
-
-		document = ChartDocument.newChartTemplateDocument();
-		document.changeMode(ChartDocument.OdfMediaType.CHART);
-		Assert.assertEquals(Document.OdfMediaType.CHART.getMediaTypeString(), document.getPackage().getMediaTypeString());
-	}
-	
-	@Test
-	public void testGetOdfMediaType() throws Exception {
-		
-		try {
-			Document.OdfMediaType chartType = ChartDocument.OdfMediaType.getOdfMediaType("CHART");
-			Assert.assertEquals("CHART", chartType.name());
-			Assert.assertEquals("application/vnd.oasis.opendocument.chart", chartType.getMediaTypeString());
-			Assert.assertEquals("odc", chartType.getSuffix());
-		} catch (Exception e) {
-			LOG.log(Level.SEVERE, e.getMessage(), e);
-			Assert.fail(e.getMessage());
-		}
-
-	}
-	
-	@Test
-	public void testGetMediaTypeString() throws Exception {
-		try {
-			ChartDocument.OdfMediaType odfMediaTypeChart = ChartDocument.OdfMediaType.valueOf(ChartDocument.OdfMediaType.class, ChartDocument.OdfMediaType.CHART.name());
-			String MediaType = odfMediaTypeChart.getMediaTypeString();
-			Assert.assertEquals("application/vnd.oasis.opendocument.chart", MediaType);
-		} catch (Exception e) {
-			LOG.log(Level.SEVERE, e.getMessage(), e);
-			Assert.fail(e.getMessage());
-		}
-		
-	}
-	
-	@Test
-	public void testLoadDocumentInputStream() throws Exception {
-		try {
-			InputStream inStream = this.getClass().getResourceAsStream(TEST_CHART_TEMPLATE);
-			ChartDocument chardoc = ChartDocument.loadDocument(inStream);
-			Assert.assertNotNull(chardoc);
-		} catch (Exception e) {
-			LOG.log(Level.SEVERE, e.getMessage(), e);
-			Assert.fail(e.getMessage());
-		}
-
-	}
-	
-	@Test
-	public void testLoadDocumentFilePath() throws Exception {
-		try {
-			String filePath = this.getClass().getResource(TEST_CHART_TEMPLATE).getPath();
-			ChartDocument chardoc = ChartDocument.loadDocument(filePath);
-			Assert.assertNotNull(chardoc);
-		} catch (Exception e) {
-			LOG.log(Level.SEVERE, e.getMessage(), e);
-			Assert.fail(e.getMessage());
-		}
-		
-	}
-	
-	@Test
-	public void testLoadDocumentFile() throws Exception {
-		try {
-			String filePath = this.getClass().getResource(TEST_CHART_TEMPLATE).getPath();
-			File filedoc = new File(filePath);
-			Assert.assertNotNull(filedoc);
-			ChartDocument chardoc = ChartDocument.loadDocument(filedoc);
-			Assert.assertNotNull(chardoc);
-		} catch (Exception e) {
-			LOG.log(Level.SEVERE, e.getMessage(), e);
-			Assert.fail(e.getMessage());
-		}
-		
-	}
-}
+/* 
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+package org.odftoolkit.simple;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.odftoolkit.simple.utils.ResourceUtilities;
+
+
+/**
+ * Test class for template aspects of chart.
+ */
+public class ChartTemplateTest {
+	
+	private static final Logger LOG = Logger.getLogger(ChartTemplateTest.class.getName());
+	private static final String TEST_CHART_TEMPLATE = "/chartTestTemplate.otc";
+
+	@Test
+	public void testLoadingAChartTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_CHART_TEMPLATE));
+		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
+				document.getMediaTypeString());
+	}
+
+	@Test
+	public void testSavingAChartTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_CHART_TEMPLATE));
+		File destination = File.createTempFile("simple-test", ".otc", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+	}
+
+	@Test
+	public void testNewChartTemplate() throws Exception {
+		Document document = ChartDocument.newChartTemplateDocument();
+		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
+				document.getMediaTypeString());
+
+		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
+				document.getPackage().getMediaTypeString());
+		File destination = File.createTempFile("simple-test", ".otc", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+		Assert.assertTrue(document instanceof ChartDocument);
+	}
+
+	@Test
+	public void testSwitchingOdfChartDocument() throws Exception {
+		ChartDocument document = ChartDocument.newChartDocument();
+		document.changeMode(ChartDocument.OdfMediaType.CHART_TEMPLATE);
+		Assert.assertEquals(Document.OdfMediaType.CHART_TEMPLATE.getMediaTypeString(),
+				document.getPackage().getMediaTypeString());
+
+		document = ChartDocument.newChartTemplateDocument();
+		document.changeMode(ChartDocument.OdfMediaType.CHART);
+		Assert.assertEquals(Document.OdfMediaType.CHART.getMediaTypeString(), document.getPackage().getMediaTypeString());
+	}
+	
+	@Test
+	public void testGetOdfMediaType() throws Exception {
+		
+		try {
+			Document.OdfMediaType chartType = ChartDocument.OdfMediaType.getOdfMediaType("CHART");
+			Assert.assertEquals("CHART", chartType.name());
+			Assert.assertEquals("application/vnd.oasis.opendocument.chart", chartType.getMediaTypeString());
+			Assert.assertEquals("odc", chartType.getSuffix());
+		} catch (Exception e) {
+			LOG.log(Level.SEVERE, e.getMessage(), e);
+			Assert.fail(e.getMessage());
+		}
+
+	}
+	
+	@Test
+	public void testGetMediaTypeString() throws Exception {
+		try {
+			ChartDocument.OdfMediaType odfMediaTypeChart = ChartDocument.OdfMediaType.valueOf(ChartDocument.OdfMediaType.class, ChartDocument.OdfMediaType.CHART.name());
+			String MediaType = odfMediaTypeChart.getMediaTypeString();
+			Assert.assertEquals("application/vnd.oasis.opendocument.chart", MediaType);
+		} catch (Exception e) {
+			LOG.log(Level.SEVERE, e.getMessage(), e);
+			Assert.fail(e.getMessage());
+		}
+		
+	}
+	
+	@Test
+	public void testLoadDocumentInputStream() throws Exception {
+		try {
+			InputStream inStream = this.getClass().getResourceAsStream(TEST_CHART_TEMPLATE);
+			ChartDocument chardoc = ChartDocument.loadDocument(inStream);
+			Assert.assertNotNull(chardoc);
+		} catch (Exception e) {
+			LOG.log(Level.SEVERE, e.getMessage(), e);
+			Assert.fail(e.getMessage());
+		}
+
+	}
+	
+	@Test
+	public void testLoadDocumentFilePath() throws Exception {
+		try {
+			String filePath = this.getClass().getResource(TEST_CHART_TEMPLATE).getPath();
+			ChartDocument chardoc = ChartDocument.loadDocument(filePath);
+			Assert.assertNotNull(chardoc);
+		} catch (Exception e) {
+			LOG.log(Level.SEVERE, e.getMessage(), e);
+			Assert.fail(e.getMessage());
+		}
+		
+	}
+	
+	@Test
+	public void testLoadDocumentFile() throws Exception {
+		try {
+			String filePath = this.getClass().getResource(TEST_CHART_TEMPLATE).getPath();
+			File filedoc = new File(filePath);
+			Assert.assertNotNull(filedoc);
+			ChartDocument chardoc = ChartDocument.loadDocument(filedoc);
+			Assert.assertNotNull(chardoc);
+		} catch (Exception e) {
+			LOG.log(Level.SEVERE, e.getMessage(), e);
+			Assert.fail(e.getMessage());
+		}
+		
+	}
+}

Modified: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/GraphicsTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/GraphicsTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/GraphicsTemplateTest.java (original)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/GraphicsTemplateTest.java Mon May 22 16:06:16 2017
@@ -1,79 +1,80 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
- *
- * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
- * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.odftoolkit.simple;
-
-import java.io.File;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test class for template aspects of graphics.
- * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
- */
-public class GraphicsTemplateTest {
-
-	private static final String TEST_GRAPHICS_TEMPLATE = "/graphicTestTemplate.otg";
-
-	@Test
-	public void testLoadingAGraphicsTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_GRAPHICS_TEMPLATE));
-		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
-	}
-
-	@Test
-	public void testSavingAGraphicsTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_GRAPHICS_TEMPLATE));
-		File destination = File.createTempFile("simple-test", ".otg");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), loadedDocument.getMediaTypeString());
-	}
-
-	@Test
-	public void testNewGraphicsTemplate() throws Exception {
-		Document document = GraphicsDocument.newGraphicsTemplateDocument();
-		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
-		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("simple-test", ".otg");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-		Assert.assertTrue(document instanceof GraphicsDocument);
-	}
-
-	@Test
-	public void testSwitchingOdfGraphicsDocument() throws Exception {
-		GraphicsDocument document = GraphicsDocument.newGraphicsDocument();
-		document.changeMode(GraphicsDocument.OdfMediaType.GRAPHICS_TEMPLATE);
-		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-
-		document = GraphicsDocument.newGraphicsTemplateDocument();
-		document.changeMode(GraphicsDocument.OdfMediaType.GRAPHICS);
-		Assert.assertEquals(Document.OdfMediaType.GRAPHICS.getMediaTypeString(),
-				document.getPackage().getMediaTypeString());
-	}
-}
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ *
+ * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.odftoolkit.simple;
+
+import java.io.File;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.odftoolkit.simple.utils.ResourceUtilities;
+
+/**
+ * Test class for template aspects of graphics.
+ * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
+ */
+public class GraphicsTemplateTest {
+
+	private static final String TEST_GRAPHICS_TEMPLATE = "/graphicTestTemplate.otg";
+
+	@Test
+	public void testLoadingAGraphicsTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_GRAPHICS_TEMPLATE));
+		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
+	}
+
+	@Test
+	public void testSavingAGraphicsTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_GRAPHICS_TEMPLATE));
+		File destination = File.createTempFile("simple-test", ".otg", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), loadedDocument.getMediaTypeString());
+	}
+
+	@Test
+	public void testNewGraphicsTemplate() throws Exception {
+		Document document = GraphicsDocument.newGraphicsTemplateDocument();
+		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
+		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		File destination = File.createTempFile("simple-test", ".otg", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+		Assert.assertTrue(document instanceof GraphicsDocument);
+	}
+
+	@Test
+	public void testSwitchingOdfGraphicsDocument() throws Exception {
+		GraphicsDocument document = GraphicsDocument.newGraphicsDocument();
+		document.changeMode(GraphicsDocument.OdfMediaType.GRAPHICS_TEMPLATE);
+		Assert.assertEquals(Document.OdfMediaType.GRAPHICS_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+
+		document = GraphicsDocument.newGraphicsTemplateDocument();
+		document.changeMode(GraphicsDocument.OdfMediaType.GRAPHICS);
+		Assert.assertEquals(Document.OdfMediaType.GRAPHICS.getMediaTypeString(),
+				document.getPackage().getMediaTypeString());
+	}
+}

Modified: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/PresentationTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/PresentationTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/PresentationTemplateTest.java (original)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/PresentationTemplateTest.java Mon May 22 16:06:16 2017
@@ -1,80 +1,82 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
- *
- * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
- * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.odftoolkit.simple;
-
-import java.io.File;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test class for template aspects of presentations.
- * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
- */
-public class PresentationTemplateTest {
-
-	private static final String TEST_PRESENTATION = "/presentationTestTemplate.otp";
-
-	@Test
-	public void testLoadingAPresentationTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_PRESENTATION));
-		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
-	}
-
-	@Test
-	public void testSavingAPresentationTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_PRESENTATION));
-		File destination = File.createTempFile("simple-test", ".otp");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), loadedDocument.getMediaTypeString());
-	}
-
-	@Test
-	public void testNewPresentationTemplate() throws Exception {
-		Document document = PresentationDocument.newPresentationTemplateDocument();
-		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
-		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-
-		File destination = File.createTempFile("simple-test", ".otp");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-		Assert.assertTrue(document instanceof PresentationDocument);
-	}
-
-	@Test
-	public void testSwitchingOdfPresentationDocument() throws Exception {
-		PresentationDocument document = PresentationDocument.newPresentationDocument();
-		document.changeMode(PresentationDocument.OdfMediaType.PRESENTATION_TEMPLATE);
-		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-
-		document = PresentationDocument.newPresentationTemplateDocument();
-		document.changeMode(PresentationDocument.OdfMediaType.PRESENTATION);
-		Assert.assertEquals(Document.OdfMediaType.PRESENTATION.getMediaTypeString(),
-				document.getPackage().getMediaTypeString());
-	}
-}
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ *
+ * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.odftoolkit.simple;
+
+import java.io.File;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.odftoolkit.simple.utils.ResourceUtilities;
+
+
+/**
+ * Test class for template aspects of presentations.
+ * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
+ */
+public class PresentationTemplateTest {
+
+	private static final String TEST_PRESENTATION = "/presentationTestTemplate.otp";
+
+	@Test
+	public void testLoadingAPresentationTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_PRESENTATION));
+		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
+	}
+
+	@Test
+	public void testSavingAPresentationTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_PRESENTATION));
+		File destination = File.createTempFile("simple-test", ".otp", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), loadedDocument.getMediaTypeString());
+	}
+
+	@Test
+	public void testNewPresentationTemplate() throws Exception {
+		Document document = PresentationDocument.newPresentationTemplateDocument();
+		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
+		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+
+		File destination = File.createTempFile("simple-test", ".otp", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+		Assert.assertTrue(document instanceof PresentationDocument);
+	}
+
+	@Test
+	public void testSwitchingOdfPresentationDocument() throws Exception {
+		PresentationDocument document = PresentationDocument.newPresentationDocument();
+		document.changeMode(PresentationDocument.OdfMediaType.PRESENTATION_TEMPLATE);
+		Assert.assertEquals(Document.OdfMediaType.PRESENTATION_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+
+		document = PresentationDocument.newPresentationTemplateDocument();
+		document.changeMode(PresentationDocument.OdfMediaType.PRESENTATION);
+		Assert.assertEquals(Document.OdfMediaType.PRESENTATION.getMediaTypeString(),
+				document.getPackage().getMediaTypeString());
+	}
+}

Modified: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetTemplateTest.java (original)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/SpreadsheetTemplateTest.java Mon May 22 16:06:16 2017
@@ -1,79 +1,80 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
- *
- * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
- * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.odftoolkit.simple;
-
-import java.io.File;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test class for template aspects of calc documents.
- * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
- */
-public class SpreadsheetTemplateTest {
-
-	private static final String TEST_SPREADSHEET_TEMPLATE = "/spreadsheetTestTemplate.ots";
-
-	@Test
-	public void testLoadingASpreadsheetTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_SPREADSHEET_TEMPLATE));
-		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
-	}
-
-	@Test
-	public void testSavingASpreadsheetTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_SPREADSHEET_TEMPLATE));
-		File destination = File.createTempFile("simple-test", ".ots");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), loadedDocument.getMediaTypeString());
-	}
-
-	@Test
-	public void testNewSpreadsheetTemplate() throws Exception {
-		Document document = SpreadsheetDocument.newSpreadsheetTemplateDocument();
-		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
-		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("simple-test", ".ots");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-		Assert.assertTrue(document instanceof SpreadsheetDocument);
-	}
-
-	@Test
-	public void testSwitchingOdfSpreadsheetDocument() throws Exception {
-		SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
-		document.changeMode(SpreadsheetDocument.OdfMediaType.SPREADSHEET_TEMPLATE);
-		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-
-		document = SpreadsheetDocument.newSpreadsheetTemplateDocument();
-		document.changeMode(SpreadsheetDocument.OdfMediaType.SPREADSHEET);
-		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET.getMediaTypeString(),
-				document.getPackage().getMediaTypeString());
-	}
-}
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ *
+ * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.odftoolkit.simple;
+
+import java.io.File;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.odftoolkit.simple.utils.ResourceUtilities;
+
+/**
+ * Test class for template aspects of calc documents.
+ * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
+ */
+public class SpreadsheetTemplateTest {
+
+	private static final String TEST_SPREADSHEET_TEMPLATE = "/spreadsheetTestTemplate.ots";
+
+	@Test
+	public void testLoadingASpreadsheetTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_SPREADSHEET_TEMPLATE));
+		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
+	}
+
+	@Test
+	public void testSavingASpreadsheetTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_SPREADSHEET_TEMPLATE));
+		File destination = File.createTempFile("simple-test", ".ots", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), loadedDocument.getMediaTypeString());
+	}
+
+	@Test
+	public void testNewSpreadsheetTemplate() throws Exception {
+		Document document = SpreadsheetDocument.newSpreadsheetTemplateDocument();
+		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getMediaTypeString());
+		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		File destination = File.createTempFile("simple-test", ".ots", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+		Assert.assertTrue(document instanceof SpreadsheetDocument);
+	}
+
+	@Test
+	public void testSwitchingOdfSpreadsheetDocument() throws Exception {
+		SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
+		document.changeMode(SpreadsheetDocument.OdfMediaType.SPREADSHEET_TEMPLATE);
+		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+
+		document = SpreadsheetDocument.newSpreadsheetTemplateDocument();
+		document.changeMode(SpreadsheetDocument.OdfMediaType.SPREADSHEET);
+		Assert.assertEquals(Document.OdfMediaType.SPREADSHEET.getMediaTypeString(),
+				document.getPackage().getMediaTypeString());
+	}
+}

Modified: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/TextTemplateTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/TextTemplateTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/TextTemplateTest.java (original)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/TextTemplateTest.java Mon May 22 16:06:16 2017
@@ -1,141 +1,142 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
- *
- * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
- *
- * Use is subject to license terms.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
- * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.odftoolkit.simple;
-
-import java.io.File;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test class for template aspects of calc documents.
- * 
- * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
- */
-public class TextTemplateTest {
-
-	private static final String TEST_TEXT_TEMPLATE = "/textTestTemplate.ott";
-
-	@Test
-	public void testLoadingATextTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_TEXT_TEMPLATE));
-		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
-				document.getMediaTypeString());
-	}
-
-	@Test
-	public void testSavingATextTemplate() throws Exception {
-		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_TEXT_TEMPLATE));
-		File destination = File.createTempFile("simple-test", ".ott");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-	}
-
-	@Test
-	public void testNewTextTemplate() throws Exception {
-		Document document = TextDocument.newTextTemplateDocument();
-		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
-				document.getMediaTypeString());
-		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
-				document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("simple-test", ".ott");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-		Assert.assertTrue(document instanceof TextDocument);
-	}
-
-	@Test
-	public void testNewTextMaster() throws Exception {
-		Document document = TextDocument.newTextMasterDocument();
-		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(),
-				document.getMediaTypeString());
-		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(),
-				document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("simple-test", ".ott");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-		Assert.assertTrue(document instanceof TextDocument);
-	}
-
-	@Test
-	public void testNewTextWeb() throws Exception {
-		Document document = TextDocument.newTextWebDocument();
-		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(),
-				document.getMediaTypeString());
-		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(),
-				document.getPackage().getMediaTypeString());
-		File destination = File.createTempFile("simple-test", ".ott");
-		document.save(destination);
-
-		// load again
-		Document loadedDocument = Document.loadDocument(destination);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(),
-				loadedDocument.getMediaTypeString());
-		Assert.assertTrue(document instanceof TextDocument);
-	}
-
-	@Test
-	public void testSwitchingOdfTextDocument() throws Exception {
-		TextDocument document = TextDocument.newTextDocument();
-		document.changeMode(TextDocument.OdfMediaType.TEXT_TEMPLATE);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		document.changeMode(TextDocument.OdfMediaType.TEXT_WEB);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		document.changeMode(TextDocument.OdfMediaType.TEXT_MASTER);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(), document.getPackage().getMediaTypeString());
-
-		document = TextDocument.newTextTemplateDocument();
-		document.changeMode(TextDocument.OdfMediaType.TEXT);
-		Assert.assertEquals(Document.OdfMediaType.TEXT.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		document.changeMode(TextDocument.OdfMediaType.TEXT_MASTER);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		document.changeMode(TextDocument.OdfMediaType.TEXT_WEB);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(), document.getPackage().getMediaTypeString());
-
-		document = TextDocument.newTextMasterDocument();
-		document.changeMode(TextDocument.OdfMediaType.TEXT);
-		Assert.assertEquals(Document.OdfMediaType.TEXT.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		document.changeMode(TextDocument.OdfMediaType.TEXT_TEMPLATE);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		document.changeMode(TextDocument.OdfMediaType.TEXT_WEB);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(), document.getPackage().getMediaTypeString());
-
-		document = TextDocument.newTextWebDocument();
-		document.changeMode(TextDocument.OdfMediaType.TEXT);
-		Assert.assertEquals(Document.OdfMediaType.TEXT.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		document.changeMode(TextDocument.OdfMediaType.TEXT_TEMPLATE);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
-		document.changeMode(TextDocument.OdfMediaType.TEXT_MASTER);
-		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(), document.getPackage().getMediaTypeString());
-	}
-}
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ *
+ * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.odftoolkit.simple;
+
+import java.io.File;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.odftoolkit.simple.utils.ResourceUtilities;
+
+/**
+ * Test class for template aspects of calc documents.
+ * 
+ * @author <a href="mailto:fhopf@odftoolkit.org">Florian Hopf</a>
+ */
+public class TextTemplateTest {
+
+	private static final String TEST_TEXT_TEMPLATE = "/textTestTemplate.ott";
+
+	@Test
+	public void testLoadingATextTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_TEXT_TEMPLATE));
+		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
+				document.getMediaTypeString());
+	}
+
+	@Test
+	public void testSavingATextTemplate() throws Exception {
+		Document document = Document.loadDocument(this.getClass().getResourceAsStream(TEST_TEXT_TEMPLATE));
+		File destination = File.createTempFile("simple-test", ".ott", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+	}
+
+	@Test
+	public void testNewTextTemplate() throws Exception {
+		Document document = TextDocument.newTextTemplateDocument();
+		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
+				document.getMediaTypeString());
+		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
+				document.getPackage().getMediaTypeString());
+		File destination = File.createTempFile("simple-test", ".ott", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+		Assert.assertTrue(document instanceof TextDocument);
+	}
+
+	@Test
+	public void testNewTextMaster() throws Exception {
+		Document document = TextDocument.newTextMasterDocument();
+		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(),
+				document.getMediaTypeString());
+		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(),
+				document.getPackage().getMediaTypeString());
+		File destination = File.createTempFile("simple-test", ".ott", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+		Assert.assertTrue(document instanceof TextDocument);
+	}
+
+	@Test
+	public void testNewTextWeb() throws Exception {
+		Document document = TextDocument.newTextWebDocument();
+		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(),
+				document.getMediaTypeString());
+		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(),
+				document.getPackage().getMediaTypeString());
+		File destination = File.createTempFile("simple-test", ".ott", ResourceUtilities.getTempTestDirectory());
+		document.save(destination);
+
+		// load again
+		Document loadedDocument = Document.loadDocument(destination);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(),
+				loadedDocument.getMediaTypeString());
+		Assert.assertTrue(document instanceof TextDocument);
+	}
+
+	@Test
+	public void testSwitchingOdfTextDocument() throws Exception {
+		TextDocument document = TextDocument.newTextDocument();
+		document.changeMode(TextDocument.OdfMediaType.TEXT_TEMPLATE);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		document.changeMode(TextDocument.OdfMediaType.TEXT_WEB);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		document.changeMode(TextDocument.OdfMediaType.TEXT_MASTER);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(), document.getPackage().getMediaTypeString());
+
+		document = TextDocument.newTextTemplateDocument();
+		document.changeMode(TextDocument.OdfMediaType.TEXT);
+		Assert.assertEquals(Document.OdfMediaType.TEXT.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		document.changeMode(TextDocument.OdfMediaType.TEXT_MASTER);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		document.changeMode(TextDocument.OdfMediaType.TEXT_WEB);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(), document.getPackage().getMediaTypeString());
+
+		document = TextDocument.newTextMasterDocument();
+		document.changeMode(TextDocument.OdfMediaType.TEXT);
+		Assert.assertEquals(Document.OdfMediaType.TEXT.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		document.changeMode(TextDocument.OdfMediaType.TEXT_TEMPLATE);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		document.changeMode(TextDocument.OdfMediaType.TEXT_WEB);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_WEB.getMediaTypeString(), document.getPackage().getMediaTypeString());
+
+		document = TextDocument.newTextWebDocument();
+		document.changeMode(TextDocument.OdfMediaType.TEXT);
+		Assert.assertEquals(Document.OdfMediaType.TEXT.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		document.changeMode(TextDocument.OdfMediaType.TEXT_TEMPLATE);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_TEMPLATE.getMediaTypeString(), document.getPackage().getMediaTypeString());
+		document.changeMode(TextDocument.OdfMediaType.TEXT_MASTER);
+		Assert.assertEquals(Document.OdfMediaType.TEXT_MASTER.getMediaTypeString(), document.getPackage().getMediaTypeString());
+	}
+}

Modified: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/meta/OfficeMetaTest.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/meta/OfficeMetaTest.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/meta/OfficeMetaTest.java (original)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/meta/OfficeMetaTest.java Mon May 22 16:06:16 2017
@@ -1,4 +1,4 @@
-/* 
+/*
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
@@ -20,15 +20,11 @@ under the License.
 package org.odftoolkit.simple.meta;
 
 import java.io.File;
-import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.List;
-
 import junit.framework.Assert;
-
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.odftoolkit.odfdom.dom.attribute.meta.MetaValueTypeAttribute.Value;
@@ -224,7 +220,7 @@ public class OfficeMetaTest {
 		fMetadata.setUserDefinedData(names.get(2), Value.BOOLEAN.toString(),
 				"false");
 		writeAndReload();
-                
+
 		// test get
 		Assert.assertEquals(names, fMetadata.getUserDefinedDataNames());
 		Assert.assertEquals(Value.STRING.toString(), fMetadata.getUserDefinedDataType(names.get(0)));
@@ -269,7 +265,7 @@ public class OfficeMetaTest {
 		Assert.assertNull(fMetadata.getPrintDate());
 		Assert.assertNotNull(fMetadata.getUserDefinedDataNames());
 	}
-	
+
 	@Test
 	public void testReadDocumentMeta() throws Exception {
 		// create a new empty document
@@ -288,9 +284,9 @@ public class OfficeMetaTest {
 		Assert.assertNotNull(meta.getLanguage());
 		textDoc.close();
 	}
-        
+
     private void writeAndReload() throws Exception {
-        File persistedDocument = File.createTempFile(getClass().getName(), ".odt");
+        File persistedDocument = File.createTempFile(getClass().getName(), ".odt", ResourceUtilities.getTempTestDirectory());
         persistedDocument.deleteOnExit();
 	doc.save(persistedDocument);
 	Thread.sleep(100);
@@ -298,5 +294,5 @@ public class OfficeMetaTest {
 	metadom = doc.getMetaDom();
 	fMetadata = new Meta(metadom);
     }
-        
+
 }

Modified: incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/utils/ResourceUtilities.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/utils/ResourceUtilities.java?rev=1795827&r1=1795826&r2=1795827&view=diff
==============================================================================
--- incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/utils/ResourceUtilities.java (original)
+++ incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/utils/ResourceUtilities.java Mon May 22 16:06:16 2017
@@ -31,6 +31,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 import org.odftoolkit.odfdom.pkg.rdfa.Util;
 
+
 /** Test utility class providing resources for the test in- and output */
 public final class ResourceUtilities {
 	private ResourceUtilities() {
@@ -39,7 +40,7 @@ public final class ResourceUtilities {
 	/**
 	 * The relative path of the test file will be resolved and the absolute will
 	 * be returned
-	 * 
+	 *
 	 * @param relativeFilePath
 	 *            Path of the test resource relative to
 	 *            <code>src/test/resource/</code>.
@@ -64,7 +65,7 @@ public final class ResourceUtilities {
 	/**
 	 * The relative path of the test file will be resolved and the absolute will
 	 * be returned
-	 * 
+	 *
 	 * @param relativeFilePath
 	 *            Path of the test resource relative to
 	 *            <code>src/test/resource/</code>.
@@ -81,7 +82,7 @@ public final class ResourceUtilities {
 	/**
 	 * The relative path of the test file will be used to determine an absolute
 	 * path to a temporary directory in the output directory.
-	 * 
+	 *
 	 * @param relativeFilePath
 	 *            Path of the test resource relative to
 	 *            <code>src/test/resource/</code>.
@@ -96,7 +97,7 @@ public final class ResourceUtilities {
 	/**
 	 * The Input of the test file will be resolved and the absolute will be
 	 * returned
-	 * 
+	 *
 	 * @param relativeFilePath
 	 *            Path of the test resource relative to
 	 *            <code>src/test/resource/</code>.
@@ -109,7 +110,7 @@ public final class ResourceUtilities {
 	/**
 	 * Relative to the test output directory a test file will be returned
 	 * dependent on the relativeFilePath provided.
-	 * 
+	 *
 	 * @param relativeFilePath
 	 *            Path of the test output resource relative to
 	 *            <code>target/test-classes/</code>.
@@ -138,4 +139,10 @@ public final class ResourceUtilities {
 		}
 		return testFolder;
 	}
+
+	public static File getTempTestDirectory() {
+		File tempDir = new File(ResourceUtilities.getTestOutputFolder() +"temp");
+		tempDir.mkdir(); //if it already exist no problem
+		return tempDir;
+	}
 }



Mime
View raw message