From f5dd0ce7c8b76b101c2a702a92e2163a5578468e Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Thu, 29 Mar 2018 17:16:58 +0200 Subject: [PATCH] Transition to Junit 5 --- Doc/Sd1/arrays.xml | 15 +- Doc/Sd1/deployment.xml | 6 +- Doc/Sd1/objectsClasses.xml | 10 +- P/Sd1/Array/Distinct/.gitignore | 1 + P/Sd1/Array/Distinct/pom.xml | 133 +++++++---------- .../java/de/hdm_stuttgart/mi/sd1/App.java | 29 ---- .../Distinct/src/main/resources/log4j2.xml | 21 --- .../java/de/hdm_stuttgart/mi/sd1/AppTest.java | 17 --- .../de/hdm_stuttgart/mi/sd1/DistinctTest.java | 30 ++-- P/Sd1/Array/StringArray2Html/.gitignore | 6 +- P/Sd1/Array/StringArray2Html/pom.xml | 36 +++-- .../StringArrayTest.java | 32 ++-- P/Sd1/Array/arraycalcExercise/pom.xml | 32 ++-- .../mi/sd1/fraction/ArrayMethodTest.java | 18 +-- P/Sd1/Array/arraycalcSolution/pom.xml | 35 +++-- .../mi/sd1/store/Arraymethods.java | 2 +- .../mi/sd1/fraction/ArrayMethodTest.java | 16 +- P/Sd1/Array/integerStore/pom.xml | 36 +++-- .../de/hdm_stuttgart/mi/sd1/main/Driver.java | 2 +- .../mi/sd1/fraction/IntStoreTest.java | 6 +- P/Sd1/Array/integerStoreMedianAnswer/pom.xml | 33 +++-- .../de/hdm_stuttgart/mi/sd1/main/Driver.java | 2 +- .../mi/sd1/store/TestSorting.java | 8 +- .../mi/sd1/store/TestStatisticMethods.java | 6 +- P/Sd1/Array/integerStoreSkeleton/pom.xml | 36 ++--- .../de/hdm_stuttgart/mi/sd1/main/Driver.java | 2 +- .../mi/sd1/fraction/IntStoreTest.java | 8 +- P/Sd1/Array/integerStoreStat/pom.xml | 58 +++++--- .../de/hdm_stuttgart/mi/sd1/main/Driver.java | 4 +- .../mi/sd1/fraction/IntStoreTest.java | 7 +- P/Sd1/Array/integerStoreUnbounded/pom.xml | 59 +++++--- .../de/hdm_stuttgart/mi/sd1/main/Driver.java | 4 +- .../mi/sd1/fraction/IntStoreTest.java | 62 ++++---- P/Sd1/Array/marking/pom.xml | 58 +++++--- .../mi/marking/MarkingFrequencies.java | 2 +- .../de/hdm_stuttgart/mi/marking/Marks.java | 2 +- .../de/hdm_stuttgart/mi/marking/AppTest.java | 11 +- P/Sd1/Array/medianCmdLine/pom.xml | 58 +++++--- .../mi/sd1/statistics/main/ErrorState.java | 2 +- .../sd1/statistics/main/InputValidator.java | 2 +- .../mi/sd1/statistics/main/Statistics.java | 2 +- .../mi/sd1/store/TestSorting.java | 24 +-- .../mi/sd1/store/TestStatisticMethods.java | 8 +- .../mi/sd1/store/TestValidation.java | 10 +- P/Sd1/todo.txt | 54 +++++++ .../resources/archetype-resources/pom.xml | 139 +++++++++--------- 46 files changed, 597 insertions(+), 547 deletions(-) delete mode 100644 P/Sd1/Array/Distinct/src/main/java/de/hdm_stuttgart/mi/sd1/App.java delete mode 100644 P/Sd1/Array/Distinct/src/main/resources/log4j2.xml delete mode 100644 P/Sd1/Array/Distinct/src/test/java/de/hdm_stuttgart/mi/sd1/AppTest.java create mode 100644 P/Sd1/todo.txt diff --git a/Doc/Sd1/arrays.xml b/Doc/Sd1/arrays.xml index bce6e8112..9241282c2 100644 --- a/Doc/Sd1/arrays.xml +++ b/Doc/Sd1/arrays.xml @@ -1380,7 +1380,7 @@ final int[] sortedValues = Arrays.copyOf(values, values.length); <para>Like in the previous exercise Junit tests are being prepared but masked by an <interfacename - xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> + xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> annotation.</para> <para>This skeleton project contains:</para> @@ -1402,8 +1402,7 @@ final int[] sortedValues = Arrays.copyOf(values, values.length); <listitem> <para>Like in the previous exercise the Junit tests are - being masked by an <interfacename - xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> + being masked by an <interfacename xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> annotation. After successful implementation they should be enabled for test activation.</para> </listitem> @@ -1778,12 +1777,10 @@ Enter value #1 of 4: 1 <para>All tests would currently fail. Therefore the test class <classname>de.hdm_stuttgart.mi.sda1.console_sum.AppTest</classname> - is being masked by an <interfacename - xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> - annotation:</para> + is being masked by an <interfacename xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> annotation:</para> <programlisting language="java">... -<emphasis role="bold" xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</emphasis> +<emphasis role="bold" xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</emphasis> public class AppTest { /** * empty list @@ -1797,9 +1794,7 @@ public class AppTest { linkend="glo_IDE"/> and complete its implementation of <methodname>de.hdm_stuttgart.mi.sda1.console_sum.App.prettifyOutput(int[] values)</methodname> until all <xref linkend="glo_Junit"/> - tests do succeed. Removing the <interfacename - xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> - line will allow for testing your implementation.</para> + tests do succeed. Removing the <interfacename xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> line will allow for testing your implementation.</para> </listitem> </itemizedlist> </tip> diff --git a/Doc/Sd1/deployment.xml b/Doc/Sd1/deployment.xml index 9e8f30224..56a85becb 100644 --- a/Doc/Sd1/deployment.xml +++ b/Doc/Sd1/deployment.xml @@ -30,16 +30,14 @@ <question> <para>The following Maven project contains a series of yet unimplemented methods and corresponding tests currently being - excluded by an <interfacename - xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> - annotation:</para> + excluded by an <interfacename xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> annotation:</para> <annotation role="make"> <para role="eclipse">Sd1/Array/arraycalcExercise</para> </annotation> <programlisting language="java">... -<emphasis role="bold">@Ignore // Remove me to enable testing your application</emphasis> +<emphasis role="bold">@Disabled // Remove me to enable testing your application</emphasis> @SuppressWarnings("javadoc") public class ArrayMethodTest { diff --git a/Doc/Sd1/objectsClasses.xml b/Doc/Sd1/objectsClasses.xml index 0587d2c8f..260780e0b 100644 --- a/Doc/Sd1/objectsClasses.xml +++ b/Doc/Sd1/objectsClasses.xml @@ -4143,23 +4143,19 @@ long sum = (long)a + b;</programlisting> <para>This Maven archive does include a <xref linkend="glo_Junit"/> test currently being disabled by an - <interfacename - xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> - directive:</para> + <interfacename xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> directive:</para> <programlisting language="java">public class FractionTest { /** * Sums and products of fractions */ - <emphasis role="bold">@Ignore // Remove me after completing your implementation</emphasis> + <emphasis role="bold">@Disabled // Remove me after completing your implementation</emphasis> @Test public void testAdditionMultiply() {</programlisting> <para>The current skeleton will yield a NullPointerException on test execution. After completing your implementation remove - this <interfacename - xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> - directive allowing for test execution.</para> + this <interfacename xlink:href="https://junit.org/junit5/docs/current/api/org/junit/jupiter/api/Disabled.html">@Disabled</interfacename> directive allowing for test execution.</para> </question> <answer> diff --git a/P/Sd1/Array/Distinct/.gitignore b/P/Sd1/Array/Distinct/.gitignore index a1c3ab4d0..29bd96aed 100644 --- a/P/Sd1/Array/Distinct/.gitignore +++ b/P/Sd1/Array/Distinct/.gitignore @@ -2,3 +2,4 @@ /.settings/ .classpath .project +.idea/ diff --git a/P/Sd1/Array/Distinct/pom.xml b/P/Sd1/Array/Distinct/pom.xml index 60666ec29..09f2f2f17 100644 --- a/P/Sd1/Array/Distinct/pom.xml +++ b/P/Sd1/Array/Distinct/pom.xml @@ -1,80 +1,55 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>de.hdm_stuttgart.mi.sd1</groupId> - <artifactId>arraymethods</artifactId> - <version>1.0-SNAPSHOT</version> - <packaging>jar</packaging> - - <name>arraymethods</name> - - <url>https://freedocs.mi.hdm-stuttgart.de/sd1SectToolsOfTheTrade2.html</url> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> - - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>2.9.1</version> - </dependency> - - </dependencies> - - <build> - <plugins> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration /> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>3.1.0</version> - <configuration> - <transformers> - <transformer - implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> - <manifestEntries> - <Main-Class>de.hdm_stuttgart.mi.sd1.App</Main-Class> - </manifestEntries> - </transformer> - </transformers> - </configuration> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - </execution> - </executions> - </plugin> - - </plugins> - </build> -</project> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>de.hdm_stuttgart.mi.sd1</groupId> + <artifactId>arraymethods</artifactId> + <version>1.0</version> + + <name>arraymethods</name> + + <url>https://freedocs.mi.hdm-stuttgart.de/sd1SectToolsOfTheTrade2.html</url> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <dependencies> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>2.11.0</version> + </dependency> + + </dependencies> + + <build> + <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> + </plugin> + + </plugins> + </build> +</project> \ No newline at end of file diff --git a/P/Sd1/Array/Distinct/src/main/java/de/hdm_stuttgart/mi/sd1/App.java b/P/Sd1/Array/Distinct/src/main/java/de/hdm_stuttgart/mi/sd1/App.java deleted file mode 100644 index c6cc15ef4..000000000 --- a/P/Sd1/Array/Distinct/src/main/java/de/hdm_stuttgart/mi/sd1/App.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.hdm_stuttgart.mi.sd1; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - - -/** - * A simple http://logging.apache.org/log4j/2.x demo, - * see file resources/log4j2.xml for configuration options - * and A1.log containing debugging output. - */ - -public class App { - private static Logger log = LogManager.getLogger(App.class); - - /** - * Your application's main entry point. - * - * @param args Yet unused - */ - public static void main( String[] args ) { - System.out.println( "Hello World!" ); - - log.debug("With respect to logging you may want to configure file "); - log.debug("'src/main/resources/log4j2.xml' to suit your needs."); - log.debug("This config file 'log4j2.xml' will result in 'A1.log'"); - log.debug("file containing logging output as well."); - } -} diff --git a/P/Sd1/Array/Distinct/src/main/resources/log4j2.xml b/P/Sd1/Array/Distinct/src/main/resources/log4j2.xml deleted file mode 100644 index 130f87a14..000000000 --- a/P/Sd1/Array/Distinct/src/main/resources/log4j2.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Configuration> - <Appenders> - <File name="A1" fileName="A1.log" append="false"> - <PatternLayout pattern="%t %-5p %c{2} - %m%n"/> - </File> - <Console name="STDOUT" target="SYSTEM_OUT"> - <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/> - </Console> - </Appenders> - <Loggers> - - <!-- You my want to define class or package level per-logger rules --> - <Logger name="de.hdm_stuttgart.mi.sd1.App" level="debug"> - <AppenderRef ref="A1"/> - </Logger> - <Root level="info"> - <AppenderRef ref="STDOUT"/> - </Root> - </Loggers> -</Configuration> \ No newline at end of file diff --git a/P/Sd1/Array/Distinct/src/test/java/de/hdm_stuttgart/mi/sd1/AppTest.java b/P/Sd1/Array/Distinct/src/test/java/de/hdm_stuttgart/mi/sd1/AppTest.java deleted file mode 100644 index b83e8093c..000000000 --- a/P/Sd1/Array/Distinct/src/test/java/de/hdm_stuttgart/mi/sd1/AppTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package de.hdm_stuttgart.mi.sd1; - -import org.junit.Assert; -import org.junit.Test; - -/** - * Unit test for simple App. - */ -public class AppTest { - /** - * Dummy test method - */ - @Test - public void testApp() { - Assert.assertTrue( true ); - } -} diff --git a/P/Sd1/Array/Distinct/src/test/java/de/hdm_stuttgart/mi/sd1/DistinctTest.java b/P/Sd1/Array/Distinct/src/test/java/de/hdm_stuttgart/mi/sd1/DistinctTest.java index 4ae7539a9..ba59dca27 100644 --- a/P/Sd1/Array/Distinct/src/test/java/de/hdm_stuttgart/mi/sd1/DistinctTest.java +++ b/P/Sd1/Array/Distinct/src/test/java/de/hdm_stuttgart/mi/sd1/DistinctTest.java @@ -1,8 +1,8 @@ package de.hdm_stuttgart.mi.sd1; import de.hdm_stuttgart.mi.sd1.array.MyArray; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import java.util.Arrays; @@ -17,28 +17,32 @@ public class DistinctTest { unique(new int[]{12, 6, 1, 4}); unique(new int[]{-99, 4, 333, 17, 0, 3, 55}); } + @Test public void testTwoDuplicate() { - Assert.assertArrayEquals(new int[]{6}, MyArray.distinct(new int[]{6, 6})); + Assertions.assertArrayEquals(new int[]{6}, MyArray.distinct(new int[]{6, 6})); } + @Test public void testThreeDuplicate() { - Assert.assertArrayEquals(new int[]{-1, 6}, MyArray.distinct(new int[]{-1, 6, 6})); - Assert.assertArrayEquals(new int[]{-1, 6}, MyArray.distinct(new int[]{6, -1, 6})); - Assert.assertArrayEquals(new int[]{-1, 6}, MyArray.distinct(new int[]{6, 6, -1})); + Assertions.assertArrayEquals(new int[]{-1, 6}, MyArray.distinct(new int[]{-1, 6, 6})); + Assertions.assertArrayEquals(new int[]{-1, 6}, MyArray.distinct(new int[]{6, -1, 6})); + Assertions.assertArrayEquals(new int[]{-1, 6}, MyArray.distinct(new int[]{6, 6, -1})); } + @Test public void testFourDuplicate() { - Assert.assertArrayEquals(new int[]{-1, 3, 6}, MyArray.distinct(new int[]{-1, 6, 6, 3})); - Assert.assertArrayEquals(new int[]{-1, 3, 6}, MyArray.distinct(new int[]{3, 6, -1, 6})); - Assert.assertArrayEquals(new int[]{-1, 3, 6}, MyArray.distinct(new int[]{6, 6, 3, -1})); + Assertions.assertArrayEquals(new int[]{-1, 3, 6}, MyArray.distinct(new int[]{-1, 6, 6, 3})); + Assertions.assertArrayEquals(new int[]{-1, 3, 6}, MyArray.distinct(new int[]{3, 6, -1, 6})); + Assertions.assertArrayEquals(new int[]{-1, 3, 6}, MyArray.distinct(new int[]{6, 6, 3, -1})); - Assert.assertArrayEquals(new int[]{1, 6}, MyArray.distinct(new int[]{1, 6, 1, 6})); - Assert.assertArrayEquals(new int[]{1, 6}, MyArray.distinct(new int[]{1, 6, 1, 6, 6, 6, 1 ,1, 6})); + Assertions.assertArrayEquals(new int[]{1, 6}, MyArray.distinct(new int[]{1, 6, 1, 6})); + Assertions.assertArrayEquals(new int[]{1, 6}, MyArray.distinct(new int[]{1, 6, 1, 6, 6, 6, 1 ,1, 6})); } + static void unique(final int[] values) { final int[] sortedValues = Arrays.copyOf(values, values.length); Arrays.sort(sortedValues); - Assert.assertArrayEquals(sortedValues, MyArray.distinct(values)); + Assertions.assertArrayEquals(sortedValues, MyArray.distinct(values)); } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/StringArray2Html/.gitignore b/P/Sd1/Array/StringArray2Html/.gitignore index 4e247eee2..7913c9bee 100644 --- a/P/Sd1/Array/StringArray2Html/.gitignore +++ b/P/Sd1/Array/StringArray2Html/.gitignore @@ -1,4 +1,8 @@ +/dependency-reduced-pom.xml +/A1.log /.settings -/target +/.idea +/*.iml /.classpath /.project +/target diff --git a/P/Sd1/Array/StringArray2Html/pom.xml b/P/Sd1/Array/StringArray2Html/pom.xml index 96fd8977b..5e9cce0ae 100644 --- a/P/Sd1/Array/StringArray2Html/pom.xml +++ b/P/Sd1/Array/StringArray2Html/pom.xml @@ -1,5 +1,5 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -16,16 +16,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> @@ -34,24 +34,22 @@ <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration/> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration /> </plugin> </plugins> </build> - - -</project> +</project> \ No newline at end of file diff --git a/P/Sd1/Array/StringArray2Html/src/test/java/de/hdm_stuttgart/mi/sd1/stringarray2html_test/StringArrayTest.java b/P/Sd1/Array/StringArray2Html/src/test/java/de/hdm_stuttgart/mi/sd1/stringarray2html_test/StringArrayTest.java index d0f2933f6..2dc5c665b 100644 --- a/P/Sd1/Array/StringArray2Html/src/test/java/de/hdm_stuttgart/mi/sd1/stringarray2html_test/StringArrayTest.java +++ b/P/Sd1/Array/StringArray2Html/src/test/java/de/hdm_stuttgart/mi/sd1/stringarray2html_test/StringArrayTest.java @@ -1,31 +1,31 @@ package de.hdm_stuttgart.mi.sd1.stringarray2html_test; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.stringarray2html.Stringarray2Html; -@SuppressWarnings("javadoc") public class StringArrayTest { - + @Test public void testnull() { - Assert.assertEquals("", Stringarray2Html.strings2html(null)); - + Assertions.assertEquals("", Stringarray2Html.strings2html(null)); + } + @Test public void testVoid() { - Assert.assertEquals("", Stringarray2Html.strings2html(new String[]{})); - + Assertions.assertEquals("", Stringarray2Html.strings2html(new String[]{})); + } + @Test public void testTwo() { - Assert.assertEquals("<ul>\n" - + " <li>one</li>\n" - + " <li>two</li>\n" - + "</ul>", - Stringarray2Html.strings2html(new String[]{"one", "two"})); - + Assertions.assertEquals("<ul>\n" + + " <li>one</li>\n" + + " <li>two</li>\n" + + "</ul>", + Stringarray2Html.strings2html(new String[]{"one", "two"})); + } - -} +} \ No newline at end of file diff --git a/P/Sd1/Array/arraycalcExercise/pom.xml b/P/Sd1/Array/arraycalcExercise/pom.xml index 868eb5d27..a7046c6c5 100644 --- a/P/Sd1/Array/arraycalcExercise/pom.xml +++ b/P/Sd1/Array/arraycalcExercise/pom.xml @@ -1,5 +1,5 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -12,16 +12,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> @@ -30,20 +30,20 @@ <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration/> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> </plugin> </plugins> diff --git a/P/Sd1/Array/arraycalcExercise/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/ArrayMethodTest.java b/P/Sd1/Array/arraycalcExercise/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/ArrayMethodTest.java index 680e8c571..1ccc11021 100644 --- a/P/Sd1/Array/arraycalcExercise/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/ArrayMethodTest.java +++ b/P/Sd1/Array/arraycalcExercise/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/ArrayMethodTest.java @@ -1,18 +1,18 @@ package de.hdm_stuttgart.mi.sd1.fraction; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; import java.util.Arrays; import de.hdm_stuttgart.mi.sd1.store.Arraymethods; -@Ignore // Remove me to enable testing your application + @SuppressWarnings("javadoc") public class ArrayMethodTest { @@ -96,12 +96,12 @@ public class ArrayMethodTest { "Borrow or rob?"}; for (final String p: palindromes) { - assertTrue(p, Arraymethods.isPalindrome(p)); + assertTrue(Arraymethods.isPalindrome(p), p + " is a palindrome"); } final String[] nonPalindromes = {"Sea", "Test it!"}; for (final String p: nonPalindromes) { - assertFalse(p, Arraymethods.isPalindrome(p)); + assertFalse(Arraymethods.isPalindrome(p), p + " is no palindrome"); } } diff --git a/P/Sd1/Array/arraycalcSolution/pom.xml b/P/Sd1/Array/arraycalcSolution/pom.xml index 0a5e29c71..405aceb89 100644 --- a/P/Sd1/Array/arraycalcSolution/pom.xml +++ b/P/Sd1/Array/arraycalcSolution/pom.xml @@ -1,11 +1,10 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>de.hdm-stuttgart.sd1</groupId> <artifactId>arraycalc</artifactId> <version>2.0</version> - <packaging>jar</packaging> <name>arraycalc</name> <url>https://freedocs.mi.hdm-stuttgart.de</url> @@ -16,16 +15,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> @@ -34,23 +33,23 @@ <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration/> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration /> </plugin> </plugins> </build> -</project> +</project> \ No newline at end of file diff --git a/P/Sd1/Array/arraycalcSolution/src/main/java/de/hdm_stuttgart/mi/sd1/store/Arraymethods.java b/P/Sd1/Array/arraycalcSolution/src/main/java/de/hdm_stuttgart/mi/sd1/store/Arraymethods.java index ab081b795..336488df1 100644 --- a/P/Sd1/Array/arraycalcSolution/src/main/java/de/hdm_stuttgart/mi/sd1/store/Arraymethods.java +++ b/P/Sd1/Array/arraycalcSolution/src/main/java/de/hdm_stuttgart/mi/sd1/store/Arraymethods.java @@ -159,4 +159,4 @@ public class Arraymethods { return false; } } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/arraycalcSolution/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/ArrayMethodTest.java b/P/Sd1/Array/arraycalcSolution/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/ArrayMethodTest.java index 9dd3a4b29..1ccc11021 100644 --- a/P/Sd1/Array/arraycalcSolution/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/ArrayMethodTest.java +++ b/P/Sd1/Array/arraycalcSolution/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/ArrayMethodTest.java @@ -1,16 +1,18 @@ package de.hdm_stuttgart.mi.sd1.fraction; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.assertFalse; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; import java.util.Arrays; import de.hdm_stuttgart.mi.sd1.store.Arraymethods; + @SuppressWarnings("javadoc") public class ArrayMethodTest { @@ -94,12 +96,12 @@ public class ArrayMethodTest { "Borrow or rob?"}; for (final String p: palindromes) { - assertTrue(p, Arraymethods.isPalindrome(p)); + assertTrue(Arraymethods.isPalindrome(p), p + " is a palindrome"); } final String[] nonPalindromes = {"Sea", "Test it!"}; for (final String p: nonPalindromes) { - assertFalse(p, Arraymethods.isPalindrome(p)); + assertFalse(Arraymethods.isPalindrome(p), p + " is no palindrome"); } } diff --git a/P/Sd1/Array/integerStore/pom.xml b/P/Sd1/Array/integerStore/pom.xml index cafbc2dc6..95bd8f7bf 100644 --- a/P/Sd1/Array/integerStore/pom.xml +++ b/P/Sd1/Array/integerStore/pom.xml @@ -1,5 +1,5 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -7,8 +7,6 @@ <artifactId>intstore</artifactId> <version>2.0</version> - <packaging>jar</packaging> - <name>IntegerStore</name> <url>https://freedocs.mi.hdm-stuttgart.de</url> @@ -18,16 +16,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> @@ -36,22 +34,22 @@ <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration/> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> </plugin> </plugins> </build> -</project> +</project> \ No newline at end of file diff --git a/P/Sd1/Array/integerStore/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java b/P/Sd1/Array/integerStore/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java index cdb155078..d9285a880 100644 --- a/P/Sd1/Array/integerStore/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java +++ b/P/Sd1/Array/integerStore/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java @@ -3,7 +3,7 @@ package de.hdm_stuttgart.mi.sd1.main; import de.hdm_stuttgart.mi.sd1.store.BoundedIntegerStore; /** - * Playing with fraction objects, producing some output. + * Playing with bounded stack, producing some output. * */ public class Driver { diff --git a/P/Sd1/Array/integerStore/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java b/P/Sd1/Array/integerStore/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java index 456ff1bcc..fc95e38bf 100644 --- a/P/Sd1/Array/integerStore/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java +++ b/P/Sd1/Array/integerStore/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java @@ -1,8 +1,8 @@ package de.hdm_stuttgart.mi.sd1.fraction; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.store.BoundedIntegerStore; @@ -32,4 +32,4 @@ public class IntStoreTest { assertEquals(v2, store.getValue(1)); assertEquals(v3, store.getValue(2)); } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/integerStoreMedianAnswer/pom.xml b/P/Sd1/Array/integerStoreMedianAnswer/pom.xml index eeee2026c..cdc6d28f8 100644 --- a/P/Sd1/Array/integerStoreMedianAnswer/pom.xml +++ b/P/Sd1/Array/integerStoreMedianAnswer/pom.xml @@ -1,5 +1,5 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>de.hdm-stuttgart.sd1</groupId> @@ -15,16 +15,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> @@ -32,16 +32,23 @@ <build> <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> </plugin> </plugins> </build> -</project> +</project> \ No newline at end of file diff --git a/P/Sd1/Array/integerStoreMedianAnswer/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java b/P/Sd1/Array/integerStoreMedianAnswer/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java index 1d0bdce13..55ee5265b 100644 --- a/P/Sd1/Array/integerStoreMedianAnswer/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java +++ b/P/Sd1/Array/integerStoreMedianAnswer/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java @@ -5,7 +5,7 @@ import java.util.Scanner; import de.hdm_stuttgart.mi.sd1.store.IntegerStore; /** - * Ask a user for inputting sample values and then + * Ask a user for sample input values to * calculate average and median. * */ diff --git a/P/Sd1/Array/integerStoreMedianAnswer/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestSorting.java b/P/Sd1/Array/integerStoreMedianAnswer/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestSorting.java index f3a46f66b..41daf3b31 100644 --- a/P/Sd1/Array/integerStoreMedianAnswer/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestSorting.java +++ b/P/Sd1/Array/integerStoreMedianAnswer/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestSorting.java @@ -1,9 +1,9 @@ package de.hdm_stuttgart.mi.sd1.store; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; @SuppressWarnings("javadoc") public class TestSorting { @@ -83,6 +83,6 @@ public class TestSorting { for (final int i: unsortedValues) { store.addValue(i); } - Assert.assertArrayEquals(sortedValues, store.getValues()); + assertArrayEquals(sortedValues, store.getValues()); } } diff --git a/P/Sd1/Array/integerStoreMedianAnswer/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestStatisticMethods.java b/P/Sd1/Array/integerStoreMedianAnswer/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestStatisticMethods.java index c055f5e8e..f543174d1 100644 --- a/P/Sd1/Array/integerStoreMedianAnswer/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestStatisticMethods.java +++ b/P/Sd1/Array/integerStoreMedianAnswer/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestStatisticMethods.java @@ -1,8 +1,10 @@ package de.hdm_stuttgart.mi.sd1.store; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.store.IntegerStore; diff --git a/P/Sd1/Array/integerStoreSkeleton/pom.xml b/P/Sd1/Array/integerStoreSkeleton/pom.xml index c5311439b..db1493bce 100644 --- a/P/Sd1/Array/integerStoreSkeleton/pom.xml +++ b/P/Sd1/Array/integerStoreSkeleton/pom.xml @@ -1,5 +1,5 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>de.hdm-stuttgart.sd1</groupId> @@ -16,40 +16,40 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> <build> <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration/> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> </plugin> </plugins> </build> -</project> + +</project> \ No newline at end of file diff --git a/P/Sd1/Array/integerStoreSkeleton/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java b/P/Sd1/Array/integerStoreSkeleton/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java index 9b47718eb..bbe088811 100644 --- a/P/Sd1/Array/integerStoreSkeleton/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java +++ b/P/Sd1/Array/integerStoreSkeleton/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java @@ -3,7 +3,7 @@ package de.hdm_stuttgart.mi.sd1.main; import de.hdm_stuttgart.mi.sd1.store.BoundedIntegerStore; /** - * Playing with fraction objects, producing some output. + * Playing with store, producing some output. * */ public class Driver { diff --git a/P/Sd1/Array/integerStoreSkeleton/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java b/P/Sd1/Array/integerStoreSkeleton/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java index aeb11185f..0d101554f 100644 --- a/P/Sd1/Array/integerStoreSkeleton/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java +++ b/P/Sd1/Array/integerStoreSkeleton/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java @@ -1,14 +1,14 @@ package de.hdm_stuttgart.mi.sd1.fraction; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.store.BoundedIntegerStore; @SuppressWarnings("javadoc") -@Ignore +@Disabled public class IntStoreTest { @Test diff --git a/P/Sd1/Array/integerStoreStat/pom.xml b/P/Sd1/Array/integerStoreStat/pom.xml index 9fae115d8..3c341c848 100644 --- a/P/Sd1/Array/integerStoreStat/pom.xml +++ b/P/Sd1/Array/integerStoreStat/pom.xml @@ -1,5 +1,5 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>de.hdm-stuttgart.sd1</groupId> @@ -15,16 +15,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> @@ -33,22 +33,46 @@ <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration/> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>3.1.0</version> + <configuration> + <transformers> + <transformer + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <manifestEntries> + <Main-Class>App</Main-Class> + </manifestEntries> + </transformer> + </transformers> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + </execution> + </executions> </plugin> </plugins> </build> -</project> +</project> \ No newline at end of file diff --git a/P/Sd1/Array/integerStoreStat/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java b/P/Sd1/Array/integerStoreStat/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java index 55ce85c24..63163ec9e 100644 --- a/P/Sd1/Array/integerStoreStat/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java +++ b/P/Sd1/Array/integerStoreStat/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java @@ -3,7 +3,7 @@ package de.hdm_stuttgart.mi.sd1.main; import de.hdm_stuttgart.mi.sd1.store.IntegerStore; /** - * Playing with fraction objects, producing some output. + * Playing with integer store objects, producing some output. * */ public class Driver { @@ -26,4 +26,4 @@ public class Driver { System.out.println("Value " + (i + 1) + ": " + store.getValue(i)); } } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/integerStoreStat/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java b/P/Sd1/Array/integerStoreStat/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java index 851b14bc5..fd534b24a 100644 --- a/P/Sd1/Array/integerStoreStat/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java +++ b/P/Sd1/Array/integerStoreStat/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java @@ -1,8 +1,9 @@ package de.hdm_stuttgart.mi.sd1.fraction; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.store.IntegerStore; @@ -76,4 +77,4 @@ public class IntStoreTest { assertTrue(100_000 <= store.getCapacity()); // Capacity should at least be 100_000 } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/integerStoreUnbounded/pom.xml b/P/Sd1/Array/integerStoreUnbounded/pom.xml index 065f10d78..91632f984 100644 --- a/P/Sd1/Array/integerStoreUnbounded/pom.xml +++ b/P/Sd1/Array/integerStoreUnbounded/pom.xml @@ -1,6 +1,5 @@ - <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -18,16 +17,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> @@ -36,22 +35,46 @@ <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration /> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>3.1.0</version> + <configuration> + <transformers> + <transformer + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <manifestEntries> + <Main-Class>App</Main-Class> + </manifestEntries> + </transformer> + </transformers> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + </execution> + </executions> </plugin> </plugins> </build> -</project> +</project> \ No newline at end of file diff --git a/P/Sd1/Array/integerStoreUnbounded/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java b/P/Sd1/Array/integerStoreUnbounded/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java index fff2ebca8..009f2a278 100644 --- a/P/Sd1/Array/integerStoreUnbounded/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java +++ b/P/Sd1/Array/integerStoreUnbounded/src/main/java/de/hdm_stuttgart/mi/sd1/main/Driver.java @@ -3,7 +3,7 @@ package de.hdm_stuttgart.mi.sd1.main; import de.hdm_stuttgart.mi.sd1.store.IntegerStore; /** - * Playing with fraction objects, producing some output. + * Playing with integer store object, producing some output. * */ public class Driver { @@ -26,4 +26,4 @@ public class Driver { System.out.println("Value " + (i + 1) + ": " + store.getValue(i)); } } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/integerStoreUnbounded/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java b/P/Sd1/Array/integerStoreUnbounded/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java index 8e6eb802b..c9c5a7d86 100644 --- a/P/Sd1/Array/integerStoreUnbounded/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java +++ b/P/Sd1/Array/integerStoreUnbounded/src/test/java/de/hdm_stuttgart/mi/sd1/fraction/IntStoreTest.java @@ -1,49 +1,49 @@ package de.hdm_stuttgart.mi.sd1.fraction; -import static org.junit.Assert.*; - -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.store.IntegerStore; @SuppressWarnings("javadoc") public class IntStoreTest { - @SuppressWarnings("static-method") - @Test - public void testPositiveNegative() { - final int capacity = 3; - IntegerStore store = new IntegerStore(capacity); + @SuppressWarnings("static-method") + @Test + public void testPositiveNegative() { + final int capacity = 3; + IntegerStore store = new IntegerStore(capacity); - assertEquals(capacity, store.getCapacity()); // The store's initial capacity - assertEquals(0, store.getNumValues()); // Store is initially empty + assertEquals(capacity, store.getCapacity()); // The store's initial capacity + assertEquals(0, store.getNumValues()); // Store is initially empty - final int v1 = -17, v2 = 3, v3 = -4, v4 = 7; + final int v1 = -17, v2 = 3, v3 = -4, v4 = 7; - store.addValue(v1); // Add a single value - assertEquals(1, store.getNumValues()); // Store contains one value - assertEquals(v1, store.getValue(0)); // Value should be present at index 0 + store.addValue(v1); // Add a single value + assertEquals(1, store.getNumValues()); // Store contains one value + assertEquals(v1, store.getValue(0)); // Value should be present at index 0 - store.addValue(v2); // Add two more values - store.addValue(v3); + store.addValue(v2); // Add two more values + store.addValue(v3); - assertEquals(capacity, store.getCapacity()); // The store's initial capacity - assertEquals(3, store.getNumValues()); // Store contains three values - assertEquals(v1, store.getValue(0)); // Retrieve all values - assertEquals(v2, store.getValue(1)); - assertEquals(v3, store.getValue(2)); + assertEquals(capacity, store.getCapacity()); // The store's initial capacity + assertEquals(3, store.getNumValues()); // Store contains three values + assertEquals(v1, store.getValue(0)); // Retrieve all values + assertEquals(v2, store.getValue(1)); + assertEquals(v3, store.getValue(2)); - // Now we breach the container's initial capacity - store.addValue(v4); - assertEquals(2 * capacity, store.getCapacity()); // Twice the store's initial capacity + // Now we breach the container's initial capacity + store.addValue(v4); + assertEquals(2 * capacity, store.getCapacity()); // Twice the store's initial capacity - // add 99996 more values - for (int i = 4; i < 100_000; i++) { - store.addValue(i); - } - assertEquals(100_000, store.getNumValues()); - assertTrue(100_000 <= store.getCapacity()); // Capacity should at least be 100_000 + // add 99996 more values + for (int i = 4; i < 100_000; i++) { + store.addValue(i); + } + assertEquals(100_000, store.getNumValues()); + assertTrue(100_000 <= store.getCapacity()); // Capacity should at least be 100_000 - } + } } diff --git a/P/Sd1/Array/marking/pom.xml b/P/Sd1/Array/marking/pom.xml index 292154fc7..fb70bcb77 100644 --- a/P/Sd1/Array/marking/pom.xml +++ b/P/Sd1/Array/marking/pom.xml @@ -15,46 +15,64 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> <build> <plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> + <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>3.0.2</version> + <artifactId>maven-shade-plugin</artifactId> + <version>3.1.0</version> <configuration> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <mainClass>de.hdm_stuttgart.mi.marking.Marks</mainClass> - </manifest> - </archive> + <transformers> + <transformer + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <manifestEntries> + <Main-Class>App</Main-Class> + </manifestEntries> + </transformer> + </transformers> </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + </execution> + </executions> </plugin> </plugins> </build> - </project> diff --git a/P/Sd1/Array/marking/src/main/java/de/hdm_stuttgart/mi/marking/MarkingFrequencies.java b/P/Sd1/Array/marking/src/main/java/de/hdm_stuttgart/mi/marking/MarkingFrequencies.java index 6033ee039..5481d04b4 100644 --- a/P/Sd1/Array/marking/src/main/java/de/hdm_stuttgart/mi/marking/MarkingFrequencies.java +++ b/P/Sd1/Array/marking/src/main/java/de/hdm_stuttgart/mi/marking/MarkingFrequencies.java @@ -14,4 +14,4 @@ public class MarkingFrequencies { System.out.println(" " + (lowestMark + i - 1) + "|" + frequencies[i]); } } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/marking/src/main/java/de/hdm_stuttgart/mi/marking/Marks.java b/P/Sd1/Array/marking/src/main/java/de/hdm_stuttgart/mi/marking/Marks.java index f63644f80..84719d880 100644 --- a/P/Sd1/Array/marking/src/main/java/de/hdm_stuttgart/mi/marking/Marks.java +++ b/P/Sd1/Array/marking/src/main/java/de/hdm_stuttgart/mi/marking/Marks.java @@ -102,4 +102,4 @@ public class Marks { return ret; } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/marking/src/test/java/de/hdm_stuttgart/mi/marking/AppTest.java b/P/Sd1/Array/marking/src/test/java/de/hdm_stuttgart/mi/marking/AppTest.java index a32eabd42..9ef29508d 100644 --- a/P/Sd1/Array/marking/src/test/java/de/hdm_stuttgart/mi/marking/AppTest.java +++ b/P/Sd1/Array/marking/src/test/java/de/hdm_stuttgart/mi/marking/AppTest.java @@ -1,8 +1,7 @@ package de.hdm_stuttgart.mi.marking; -import org.junit.Assert; -import org.junit.Test; - +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * Unit test for simple App. */ @@ -10,15 +9,15 @@ public class AppTest { @Test public void testSingle() { - Assert.assertArrayEquals( + Assertions.assertArrayEquals( new int[]{-3, 1}, Marks.getFrequencies(new int[]{-3})); } @Test public void testMultiple() { - Assert.assertArrayEquals( + Assertions.assertArrayEquals( new int[]{-3, 2, 1, 0, 0, 0, 2, 0, 3}, // smallest value -3 followed by frequencies Marks.getFrequencies(new int[]{-3, 4 , 2, -2, 4, -3, 2, 4})); } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/medianCmdLine/pom.xml b/P/Sd1/Array/medianCmdLine/pom.xml index 2e8ae0a26..a3cd6da34 100644 --- a/P/Sd1/Array/medianCmdLine/pom.xml +++ b/P/Sd1/Array/medianCmdLine/pom.xml @@ -1,5 +1,5 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>de.hdm-stuttgart.sd1</groupId> @@ -16,16 +16,16 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.12</version> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <version>2.9.1</version> + <version>2.11.0</version> </dependency> </dependencies> @@ -34,22 +34,46 @@ <plugins> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration/> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>3.1.0</version> + <configuration> + <transformers> + <transformer + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <manifestEntries> + <Main-Class>App</Main-Class> + </manifestEntries> + </transformer> + </transformers> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + </execution> + </executions> </plugin> </plugins> </build> -</project> +</project> \ No newline at end of file diff --git a/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/ErrorState.java b/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/ErrorState.java index 394dc95aa..da8669ff6 100644 --- a/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/ErrorState.java +++ b/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/ErrorState.java @@ -31,4 +31,4 @@ public enum ErrorState { */ public final int errorCode; -} +} \ No newline at end of file diff --git a/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/InputValidator.java b/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/InputValidator.java index 731038dd4..9e0690f44 100644 --- a/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/InputValidator.java +++ b/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/InputValidator.java @@ -68,4 +68,4 @@ public class InputValidator { public ErrorState getErrorState() { return errorState; } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/Statistics.java b/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/Statistics.java index dbbee4ca1..0adf030ca 100644 --- a/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/Statistics.java +++ b/P/Sd1/Array/medianCmdLine/src/main/java/de/hdm_stuttgart/mi/sd1/statistics/main/Statistics.java @@ -21,4 +21,4 @@ public class Statistics { System.out.println("Your sample's average is: " + store.getAverage()); System.out.println("Your sample's median is: " + store.getMedian()); } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestSorting.java b/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestSorting.java index 215735745..a2b846474 100644 --- a/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestSorting.java +++ b/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestSorting.java @@ -1,9 +1,9 @@ package de.hdm_stuttgart.mi.sd1.store; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.statistics.IntegerStore; @@ -13,13 +13,13 @@ public class TestSorting { @Test public void simpleSort() { final int[] - unsortedValues = {0, -1, 5, 2, 7, 6}, - sortedValues = {-1, 0, 2, 5, 6, 7}; + unsortedValues = {0, -1, 5, 2, 7, 6}, + sortedValues = {-1, 0, 2, 5, 6, 7}; assertEquals(sortedValues.length, unsortedValues.length); final IntegerStore store = new IntegerStore(); - for (final int i: unsortedValues) { + for (final int i : unsortedValues) { store.addValue(i); } assertArrayEquals(sortedValues, store.getValues()); @@ -28,15 +28,15 @@ public class TestSorting { @Test public void duplicateSort() { final int[] - unsortedValues = {0, -7, 3, 2, 3, -4, 3, 4, 5, -7}, - sortedValues = {-7, -7, -4, 0, 2, 3, 3, 3, 4, 5}; - + unsortedValues = {0, -7, 3, 2, 3, -4, 3, 4, 5, -7}, + sortedValues = {-7, -7, -4, 0, 2, 3, 3, 3, 4, 5}; + assertEquals(sortedValues.length, unsortedValues.length); final IntegerStore store = new IntegerStore(); - for (final int i: unsortedValues) { + for (final int i : unsortedValues) { store.addValue(i); } - Assert.assertArrayEquals(sortedValues, store.getValues()); + assertArrayEquals(sortedValues, store.getValues()); } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestStatisticMethods.java b/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestStatisticMethods.java index 0668d0ea3..3ec5876c7 100644 --- a/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestStatisticMethods.java +++ b/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestStatisticMethods.java @@ -1,8 +1,10 @@ package de.hdm_stuttgart.mi.sd1.store; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.statistics.IntegerStore; @@ -92,4 +94,4 @@ public class TestStatisticMethods { assertArrayEquals(new int[] {-3, 0, 2, 4, 6, 7, 7, 7}, store.getValues()); assertTrue(Math.abs(5. - store.getMedian()) < 1.E-50); } -} +} \ No newline at end of file diff --git a/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestValidation.java b/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestValidation.java index 15a884354..410a04d68 100644 --- a/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestValidation.java +++ b/P/Sd1/Array/medianCmdLine/src/test/java/de/hdm_stuttgart/mi/sd1/store/TestValidation.java @@ -1,10 +1,10 @@ package de.hdm_stuttgart.mi.sd1.store; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import de.hdm_stuttgart.mi.sd1.statistics.main.ErrorState; import de.hdm_stuttgart.mi.sd1.statistics.main.InputValidator; @@ -41,4 +41,4 @@ public class TestValidation { assertEquals(ErrorState.NO_INTEGER, inputValidate.getErrorState()); assertTrue(null != inputValidate.getErrorMessage()); } -} +} \ No newline at end of file diff --git a/P/Sd1/todo.txt b/P/Sd1/todo.txt new file mode 100644 index 000000000..b24832f00 --- /dev/null +++ b/P/Sd1/todo.txt @@ -0,0 +1,54 @@ +./Array/medianCmdLine/pom.xml +./Binomial/V1/pom.xml +./Binomial/V3/pom.xml +./Collection/Intro/LookupSet/pom.xml +./CollectionImplement/StringSet/Solution/pom.xml +./ConsoleSum/V1/pom.xml +./ConsoleSum/V3/pom.xml +./CoreClasses/StringMask/pom.xml +./Euler/11/largestproductingrid/pom.xml +./Figure/BaseClass/pom.xml +./Figure/Scale/pom.xml +./Figure/ToString/pom.xml +./Filepath/pom.xml +./Gcd/V1/pom.xml +./HtmlFormatting/Simple/Exercise/pom.xml +./HtmlFormatting/Simple/Solution/pom.xml +./Marks/Solution1/pom.xml +./Marks/Solution2/pom.xml +./Navigation/V2/pom.xml +./NonsenseGenerator/pom.xml +./Prime/V1/pom.xml +./Prime/V2/pom.xml +./Projects/PoorMansGrep/pom.xml +./StringLengthSort/Solution/pom.xml +./SyncTest/pom.xml +./TicTacToe/V1/pom.xml +./TicTacToe/V2/pom.xml +./TicTacToe/V4/pom.xml +./Wc/readFile/pom.xml +./Wc/wc/pom.xml +./WordFrequency1/Solution/pom.xml +./WordFrequency2/Solution1/pom.xml +./WordFrequency2/Solution2/pom.xml +./Wordlist/Solution/pom.xml +./Wordlist/Solution2/pom.xml +./fraction/V05/pom.xml +./fraction/V1/pom.xml +./fraction/V2/pom.xml +./interest/V1/pom.xml +./interest/V2/pom.xml +./leapYear/pom.xml +./loop/answer/pom.xml +./loop/question/pom.xml +./math/V0_5/pom.xml +./math/V0_7/pom.xml +./math/V1/pom.xml +./math/V2/pom.xml +./math/V3/pom.xml +./math/V4/pom.xml +./plot/Basic/pom.xml +./plot/Interface/pom.xml +./rounding/pom.xml +./summing/V1/pom.xml +./summing/V2/pom.xml diff --git a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml index 23ef54bd7..b3640b06d 100644 --- a/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml +++ b/ws/Archetypes/mi-maven-archetype-quickstart/src/main/resources/archetype-resources/pom.xml @@ -1,87 +1,80 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <groupId>${groupId}</groupId> - <artifactId>${artifactId}</artifactId> - <version>${version}</version> - <packaging>jar</packaging> + <groupId>${groupId}</groupId> + <artifactId>${artifactId}</artifactId> + <version>${version}</version> + <packaging>jar</packaging> - <name>${artifactId}</name> + <name>${artifactId}</name> - <url>https://freedocs.mi.hdm-stuttgart.de/sd1SectToolsOfTheTrade2.html</url> + <url>https://freedocs.mi.hdm-stuttgart.de/sd1SectToolsOfTheTrade2.html</url> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - </properties> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> - <dependencies> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-api</artifactId> - <version>5.1.0</version> - <scope>test</scope> - </dependency> + <dependencies> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.1.0</version> + <scope>test</scope> + </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> - <version>5.1.0</version> - <scope>test</scope> - </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>2.11.0</version> + </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-core</artifactId> - <version>2.11.0</version> - </dependency> + </dependencies> - </dependencies> + <build> + <plugins> - <build> - <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>1.8</source> + <target>1.8</target> + </configuration> + </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.7.0</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.0</version> + <configuration/> + </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> - <configuration /> - </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>3.1.0</version> + <configuration> + <transformers> + <transformer + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <manifestEntries> + <Main-Class>${package}.App</Main-Class> + </manifestEntries> + </transformer> + </transformers> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + </execution> + </executions> + </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>3.1.0</version> - <configuration> - <transformers> - <transformer - implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> - <manifestEntries> - <Main-Class>${package}.App</Main-Class> - </manifestEntries> - </transformer> - </transformers> - </configuration> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - </execution> - </executions> - </plugin> - - </plugins> - </build> + </plugins> + </build> </project> -- GitLab