From 380239090ae7ab82535d8e68460fd6255ae0abfb Mon Sep 17 00:00:00 2001 From: Sergey Isterin Date: Wed, 24 Oct 2018 08:19:46 -0700 Subject: [PATCH] use assertj-core 3.11.1 --- .../org/assertj/swing/junit/runner/FolderCreator.java | 11 ++++++++--- .../junit/runner/FolderCreator_createFolder_Test.java | 3 +-- .../swing/testng/listener/OutputDirectory.java | 4 +--- .../OutputDirectory_createIfNecessary_Test.java | 4 +--- assertj-swing/pom.xml | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/assertj-swing-junit/src/main/java/org/assertj/swing/junit/runner/FolderCreator.java b/assertj-swing-junit/src/main/java/org/assertj/swing/junit/runner/FolderCreator.java index ee8806d9..c4a94c78 100644 --- a/assertj-swing-junit/src/main/java/org/assertj/swing/junit/runner/FolderCreator.java +++ b/assertj-swing-junit/src/main/java/org/assertj/swing/junit/runner/FolderCreator.java @@ -18,8 +18,8 @@ import static org.assertj.core.util.Strings.quote; import java.io.File; - -import org.assertj.core.api.exception.RuntimeIOException; +import java.io.IOException; +import java.io.UncheckedIOException; /** * Understands creation of folders. @@ -38,7 +38,12 @@ File createFolder(File parent, String name, boolean deleteIfExists) { imageFolder.mkdir(); return imageFolder; } catch (Exception e) { - throw new RuntimeIOException(concat("Unable to create directory ", quote(name)), e); + String message = concat("Unable to create directory ", quote(name)); + + if (e instanceof IOException) { + throw new UncheckedIOException(message, (IOException) e); + } + throw new RuntimeException(message, e); } } } diff --git a/assertj-swing-junit/src/test/java/org/assertj/swing/junit/runner/FolderCreator_createFolder_Test.java b/assertj-swing-junit/src/test/java/org/assertj/swing/junit/runner/FolderCreator_createFolder_Test.java index e9da1eac..775cf114 100644 --- a/assertj-swing-junit/src/test/java/org/assertj/swing/junit/runner/FolderCreator_createFolder_Test.java +++ b/assertj-swing-junit/src/test/java/org/assertj/swing/junit/runner/FolderCreator_createFolder_Test.java @@ -20,7 +20,6 @@ import java.io.File; import java.io.IOException; -import org.assertj.core.api.exception.RuntimeIOException; import org.easymock.EasyMock; import org.fest.mocks.EasyMockTemplate; import org.junit.BeforeClass; @@ -81,7 +80,7 @@ protected void codeToTest() { try { creator.createFolder(f, "hello", true); fail("expecting exception"); - } catch (RuntimeIOException e) { + } catch (RuntimeException e) { assertThat(e).hasMessage("Unable to create directory 'hello'"); assertThat(e.getCause()).isSameAs(error); } diff --git a/assertj-swing-testng/src/main/java/org/assertj/swing/testng/listener/OutputDirectory.java b/assertj-swing-testng/src/main/java/org/assertj/swing/testng/listener/OutputDirectory.java index c6d2354b..f54ec4ad 100644 --- a/assertj-swing-testng/src/main/java/org/assertj/swing/testng/listener/OutputDirectory.java +++ b/assertj-swing-testng/src/main/java/org/assertj/swing/testng/listener/OutputDirectory.java @@ -16,8 +16,6 @@ import static org.assertj.swing.util.Strings.isNullOrEmpty; import java.io.File; - -import org.assertj.core.api.exception.RuntimeIOException; import org.testng.ITestContext; /** @@ -47,6 +45,6 @@ void createIfNecessary() { return; if (f.mkdirs()) return; - throw new RuntimeIOException(concat("Unable to create output directory ", path)); + throw new RuntimeException(concat("Unable to create output directory ", path)); } } diff --git a/assertj-swing-testng/src/test/java/org/assertj/swing/testng/listener/OutputDirectory_createIfNecessary_Test.java b/assertj-swing-testng/src/test/java/org/assertj/swing/testng/listener/OutputDirectory_createIfNecessary_Test.java index 5bdb4b36..99a6a5cc 100644 --- a/assertj-swing-testng/src/test/java/org/assertj/swing/testng/listener/OutputDirectory_createIfNecessary_Test.java +++ b/assertj-swing-testng/src/test/java/org/assertj/swing/testng/listener/OutputDirectory_createIfNecessary_Test.java @@ -21,8 +21,6 @@ import static org.easymock.classextension.EasyMock.createMock; import java.io.File; - -import org.assertj.core.api.exception.RuntimeIOException; import org.fest.mocks.EasyMockTemplate; import org.junit.After; import org.junit.Before; @@ -95,7 +93,7 @@ protected void codeToTest() { }.run(); } - @Test(expected = RuntimeIOException.class) + @Test(expected = RuntimeException.class) public void should_Throw_Error_If_Output_Folder_Cannot_Be_Created() { File folder = newFolder(unwritablePath); assertThat(folder.setReadOnly()).isTrue(); diff --git a/assertj-swing/pom.xml b/assertj-swing/pom.xml index 8e8fb060..376a933f 100644 --- a/assertj-swing/pom.xml +++ b/assertj-swing/pom.xml @@ -68,7 +68,7 @@ org.assertj assertj-core - 3.8.0 + 3.11.1