X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Ffile%2FIOHelperTest.java;h=07069680bd71e192a9a8093e72712c7ec5cc41d6;hb=965adace2b47642e2ca84f499cc32683c12059c6;hp=f9faa76997962c6ad99ed51414e3cb8594fba365;hpb=b34ba4499cfbca09bc794a810e460bf1c86dcd34;p=svjatoslav_commons.git diff --git a/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java b/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java index f9faa76..0706968 100755 --- a/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java +++ b/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java @@ -1,7 +1,7 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * Copyright ©2012-2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License * or later as published by the Free Software Foundation. @@ -9,29 +9,30 @@ package eu.svjatoslav.commons.file; +import org.junit.Assert; +import org.junit.Test; + import java.io.File; import java.io.IOException; -import junit.framework.TestCase; - -import org.junit.Test; +public class IOHelperTest { -public class IOHelperTest extends TestCase { + public static final String UTF_8 = "UTF-8"; - @Test - public void testOverwriteFileIfContentDiffers() throws IOException { - final File file = new File("overrideTest.txt"); + @Test + public void testOverwriteFileIfContentDiffers() throws IOException { + final File file = new File("overrideTest.txt"); - assertTrue(IOHelper.overwriteFileIfContentDiffers(file, - "aoa".getBytes())); + Assert.assertTrue(IOHelper.overwriteFileIfContentDiffers(file, + "aoa".getBytes(UTF_8))); - assertFalse(IOHelper.overwriteFileIfContentDiffers(file, - "aoa".getBytes())); + Assert.assertFalse(IOHelper.overwriteFileIfContentDiffers(file, + "aoa".getBytes(UTF_8))); - assertTrue(IOHelper.overwriteFileIfContentDiffers(file, - "1234".getBytes())); + Assert.assertTrue(IOHelper.overwriteFileIfContentDiffers(file, + "1234".getBytes(UTF_8))); - file.delete(); - } + file.delete(); + } }