X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=svjatoslav_commons.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Ffile%2FIOHelperTest.java;h=b03a3e5b22736aef49fc63115b3d73d31e30e24c;hp=055379e3ad9eda33429c367d9266aba429487ca7;hb=b8bd1e820265fc15c39c1ee8c06289ea8b8e2c1c;hpb=26f09b1ebcafae67855b55ad588d5332a107d202 diff --git a/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java b/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java old mode 100644 new mode 100755 index 055379e..b03a3e5 --- a/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java +++ b/src/test/java/eu/svjatoslav/commons/file/IOHelperTest.java @@ -1,37 +1,38 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. + * modify it under the terms of version 3 of the GNU Lesser General Public License + * or later as published by the Free Software Foundation. */ 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(); + } }