From 9f0e4faad65a95b150a031c6d5efdc1868e84001 Mon Sep 17 00:00:00 2001 From: Carolin Brandt Date: Mon, 20 Jun 2022 16:32:55 +0200 Subject: [PATCH 1/2] Add test for LinkType.setOutputType --- .../maven_nar/cpptasks/compiler/TestLinkType.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/com/github/maven_nar/cpptasks/compiler/TestLinkType.java b/src/test/java/com/github/maven_nar/cpptasks/compiler/TestLinkType.java index 79bbc3807..ad44978be 100644 --- a/src/test/java/com/github/maven_nar/cpptasks/compiler/TestLinkType.java +++ b/src/test/java/com/github/maven_nar/cpptasks/compiler/TestLinkType.java @@ -64,4 +64,16 @@ public void testIsPluginTrue() { type.setOutputType(pluginType); assertTrue(type.isPluginModule()); } + + public void testSetOutputType() throws Exception { + try { + final LinkType type = new LinkType(); + final OutputTypeEnum pluginType = new OutputTypeEnum(); + pluginType.setValue("executable"); + type.setOutputType(null); + TestCase.fail("testSetOutputType should have thrown IllegalArgumentException"); + } catch (IllegalArgumentException expected) { + TestCase.assertEquals("outputType", expected.getMessage()); + } + } } From 5e62c9c4af329aaf02fe209d863e0fe5af08cddf Mon Sep 17 00:00:00 2001 From: Carolin Brandt Date: Tue, 7 Feb 2023 14:05:08 +0100 Subject: [PATCH 2/2] remove unused variable --- .../com/github/maven_nar/cpptasks/compiler/TestLinkType.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/java/com/github/maven_nar/cpptasks/compiler/TestLinkType.java b/src/test/java/com/github/maven_nar/cpptasks/compiler/TestLinkType.java index ad44978be..c5cb53753 100644 --- a/src/test/java/com/github/maven_nar/cpptasks/compiler/TestLinkType.java +++ b/src/test/java/com/github/maven_nar/cpptasks/compiler/TestLinkType.java @@ -68,8 +68,6 @@ public void testIsPluginTrue() { public void testSetOutputType() throws Exception { try { final LinkType type = new LinkType(); - final OutputTypeEnum pluginType = new OutputTypeEnum(); - pluginType.setValue("executable"); type.setOutputType(null); TestCase.fail("testSetOutputType should have thrown IllegalArgumentException"); } catch (IllegalArgumentException expected) {