diff --git a/Doc/Sd1/arrays.xml b/Doc/Sd1/arrays.xml index c330903fc495f29de4f141d8e9463af56fa43a83..7b85a668be296268b939e74cff3da814cf30349b 100644 --- a/Doc/Sd1/arrays.xml +++ b/Doc/Sd1/arrays.xml @@ -1099,11 +1099,31 @@ public class Driver { <para role="eclipse">Sd1/ConsoleSum/V1</para> </annotation> - <para>All tests will currently fail. Import this project - into Eclipse and complete its implementation of + <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> + + <programlisting language="java">... +<emphasis role="bold" xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</emphasis> +public class AppTest { + /** + * empty list + */ + @Test + public void testEmptyList() { + Assert.assertEquals("0", App.prettifyOutput(new int[0])); + } ...</programlisting> + + <para>Import this project into Eclipse and complete its + implementation of <code>de.hdm_stuttgart.mi.sda1.console_sum.App.prettifyOutput(int[] values)</code> until all <xref linkend="glo_Junit"/> tests - do succeed.</para> + 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> </listitem> </itemizedlist> </tip> @@ -1134,27 +1154,10 @@ public class Driver { <para role="eclipse">Sd1/Array/integerStoreSkeleton</para> </annotation> - <para>The above link contains a file - <filename>project.zip</filename>. You may import this project into - your <xref linkend="glo_Soft_Eclipse"/> workspace by:</para> - - <itemizedlist> - <listitem> - <para>Creating an empty directory e.g. - <quote>myProject</quote>.</para> - </listitem> - - <listitem> - <para>Unzip <filename>project.zip</filename> into - <quote>myProject</quote>.</para> - </listitem> - - <listitem> - <para>Choose File-->Import-->Maven-->Existing maven - projects in <xref linkend="glo_Soft_Eclipse"/> and navigate to - the <quote>myProject</quote> folder to import it.</para> - </listitem> - </itemizedlist> + <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> + annotation.</para> <para>This skeleton project contains:</para> @@ -1174,8 +1177,11 @@ public class Driver { </listitem> <listitem> - <para>The tests will initially fail. After successful - implementation they should however run successfully.</para> + <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> + annotation. After successful implementation they should be + enabled for test activation.</para> </listitem> </itemizedlist> </question> diff --git a/Doc/Sd1/deployment.xml b/Doc/Sd1/deployment.xml index 1674529207252839fb24a9318915edb251739451..a0affaad6bb9a77ab829cb39addebf443a41af01 100644 --- a/Doc/Sd1/deployment.xml +++ b/Doc/Sd1/deployment.xml @@ -30,7 +30,20 @@ <para>The Maven Java project archive <link xlink:href="Ref/api/P/Array/arraycalcExercise/eclipse.zip">eclipse.zip</link> contains a series of yet unimplemented methods and corresponding - tests. The following hints may help you completing the + tests currently being excluded by an <interfacename + xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> + annotation:</para> + + <programlisting language="java">... +<emphasis role="bold">@Ignore // Remove me to enable testing your application</emphasis> +@SuppressWarnings("javadoc") +public class ArrayMethodTest { + + @Test + public void testFindIndex(){ + assertEquals(Arraymethods.findIndex(new int[]{1, 3, -3, 5}, -3), 2);...</programlisting> + + <para>The following hints may help you completing the implementation</para> <glosslist> diff --git a/Doc/Sda1/dom.xml b/Doc/Sda1/dom.xml index e5a18925ad8fd284d1b3293ba116b9f07550a23c..8ba2fba7e7f446d05a459b29138b637766e440bb 100644 --- a/Doc/Sda1/dom.xml +++ b/Doc/Sda1/dom.xml @@ -81,8 +81,8 @@ <itemizedlist> <listitem> - <para>The <acronym xlink:href="https://www.w3.org/DOM">DOM</acronym> is - formulated in an Interface Definition Language (<abbrev + <para>The <acronym xlink:href="https://www.w3.org/DOM">DOM</acronym> + is formulated in an Interface Definition Language (<abbrev xlink:href="https://en.wikipedia.org/wiki/Interface_description_language">IDL</abbrev>)</para> </listitem> @@ -674,8 +674,11 @@ Document contains 15 elements and 3 attributes.</programlisting> <listitem> <para>A unit test class - <classname>de.hdm_stuttgart.mi.javastreams.Java8FunctionalTest</classname>. - This is your place to actually start working.</para> + <classname>de.hdm_stuttgart.mi.javastreams.Java8FunctionalTest</classname> + currently being masked by an <interfacename + xlink:href="http://junit.sourceforge.net/javadoc/org/junit/Ignore.html">@Ignore</interfacename> + annotation to be removed for enabling tests. This is your + place to actually start working.</para> </listitem> </orderedlist> @@ -1125,8 +1128,8 @@ public class Article2Html { <callout arearefs="programlisting_catalog2html_glue_serialize" xml:id="programlisting_catalog2html_glue_serialize_co"> <para>Serialize the completed HTML <acronym - xlink:href="https://www.w3.org/DOM">DOM</acronym> tree to the - output stream.</para> + xlink:href="https://www.w3.org/DOM">DOM</acronym> tree to + the output stream.</para> </callout> </calloutlist> </answer> @@ -1299,22 +1302,22 @@ public class Article2Html { <para><xref linkend="domTreeTraversal"/> demonstrated the possibility to traverse trees solely by using <acronym - xlink:href="https://www.w3.org/DOM">DOM</acronym> Method calls. Though this - approach is possible it will in general not lead to stable applications. - Real world examples are often based on large XML documents with complex - hierarchical structures. Thus using this rather primitive approach will - foster deeply nested method calls being necessary to access desired node - sets. In addition changing the conceptional schema will require rewriting - large code portions..</para> + xlink:href="https://www.w3.org/DOM">DOM</acronym> Method calls. Though + this approach is possible it will in general not lead to stable + applications. Real world examples are often based on large XML documents + with complex hierarchical structures. Thus using this rather primitive + approach will foster deeply nested method calls being necessary to access + desired node sets. In addition changing the conceptional schema will + require rewriting large code portions..</para> <para>As we already know from <abbrev xlink:href="https://www.w3.org/Style/XSL">XSL</abbrev> transformations <code>Xpath</code> allows to address node sets inside a XML tree. The role - of <acronym xlink:href="https://www.w3.org/TR/xpath">XPath</acronym> can be - compared to SQL queries when working with relational databases. <acronym - xlink:href="https://www.w3.org/TR/xpath">XPath</acronym> may also be used - within <xref linkend="glo_Java"/> code. As a first example we show an - image filename extracting application operating on XHTML documents. The + of <acronym xlink:href="https://www.w3.org/TR/xpath">XPath</acronym> can + be compared to SQL queries when working with relational databases. + <acronym xlink:href="https://www.w3.org/TR/xpath">XPath</acronym> may also + be used within <xref linkend="glo_Java"/> code. As a first example we show + an image filename extracting application operating on XHTML documents. The following example contains three <tag class="starttag">img</tag> elements:</para> @@ -1573,8 +1576,8 @@ public class Article2Html { xlink:href="http://www.cafeconleche.org/books/bible2/chapters/ch17.html">starts-with()</link> testing for the <code>http</code> or <code>https</code> protocol definition part of an <abbrev - xlink:href="https://www.ietf.org/rfc/rfc1738.txt">URL</abbrev>. A - possible output for the above example reads:</para> + xlink:href="https://www.ietf.org/rfc/rfc1738.txt">URL</abbrev>. + A possible output for the above example reads:</para> <programlisting language="none">xpath.CheckUrl (CheckUrl.java:51) - Protocol 'ftp' not yet implemented ftp://inexistent.com/q.png, HTTP Status: null 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 9dd3a4b29fbce8bab75b0e4c1993b4f1c8df23fe..680e8c571707b8e348f02bb57665c9ec3eb2acf8 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,5 +1,6 @@ package de.hdm_stuttgart.mi.sd1.fraction; +import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.assertArrayEquals; @@ -11,6 +12,7 @@ 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 { 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 69649f73e5efeff3912632a99d49f7a0da9f6de2..aeb11185f1c3bf5d4a678396c1c4b28c8ae35ea3 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 @@ -2,11 +2,13 @@ package de.hdm_stuttgart.mi.sd1.fraction; import static org.junit.Assert.*; +import org.junit.Ignore; import org.junit.Test; import de.hdm_stuttgart.mi.sd1.store.BoundedIntegerStore; @SuppressWarnings("javadoc") +@Ignore public class IntStoreTest { @Test diff --git a/P/Sd1/ConsoleSum/V1/src/test/java/de/hdm_stuttgart/mi/sda1/console_sum/AppTest.java b/P/Sd1/ConsoleSum/V1/src/test/java/de/hdm_stuttgart/mi/sda1/console_sum/AppTest.java index 6a6492b201aa5f559a8aa5bfbc583a920b4aa4c1..e8540accbca96fa3d7339ba416f21c7dea4962ec 100644 --- a/P/Sd1/ConsoleSum/V1/src/test/java/de/hdm_stuttgart/mi/sda1/console_sum/AppTest.java +++ b/P/Sd1/ConsoleSum/V1/src/test/java/de/hdm_stuttgart/mi/sda1/console_sum/AppTest.java @@ -1,11 +1,13 @@ package de.hdm_stuttgart.mi.sda1.console_sum; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; /** * Unit test for simple App. */ +@Ignore public class AppTest { /** * empty list diff --git a/P/Sda1/Streams/Template/src/test/java/de/hdm_stuttgart/mi/javastreams/Java8FunctionalTest.java b/P/Sda1/Streams/Template/src/test/java/de/hdm_stuttgart/mi/javastreams/Java8FunctionalTest.java index 8edfdd587690d66d7b96cd21edc18c3559fd040a..afbd1aced95d224dffcb9b1397f78d93412d6689 100644 --- a/P/Sda1/Streams/Template/src/test/java/de/hdm_stuttgart/mi/javastreams/Java8FunctionalTest.java +++ b/P/Sda1/Streams/Template/src/test/java/de/hdm_stuttgart/mi/javastreams/Java8FunctionalTest.java @@ -10,6 +10,7 @@ import java.util.stream.Collectors; import org.hamcrest.Matchers; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import com.google.common.collect.ImmutableList; @@ -20,6 +21,7 @@ import de.hdm_stuttgart.mi.javastreams.Student.Sex; /** * Testing functional queries. */ +@Ignore // Remove me to enable testing public class Java8FunctionalTest { final List<Student> roster = Student.createRoster(); diff --git a/P/Sda2/account/.gitignore b/P/Sda2/account/.gitignore index 06864be7f267fe4ed9d21a7429642bd0c6b8c081..77f8e849fcdc95cbd4645d443fab4b44735130a1 100644 --- a/P/Sda2/account/.gitignore +++ b/P/Sda2/account/.gitignore @@ -2,4 +2,5 @@ /.settings/ .classpath .project -dependency-reduced-pom.xml \ No newline at end of file +dependency-reduced-pom.xml +/A1.log diff --git a/P/Sda2/account/src/main/resources/log4j.properties b/P/Sda2/account/src/main/resources/log4j.properties deleted file mode 100644 index a81103b6e4443b267790f46db3b8f2930af696e3..0000000000000000000000000000000000000000 --- a/P/Sda2/account/src/main/resources/log4j.properties +++ /dev/null @@ -1,15 +0,0 @@ -#Set root logger level to DEBUG and its only appender to A1. -log4j.rootLogger=DEBUG, A1 - -# A1 is set to be a ConsoleAppender. -log4j.appender.A1=org.apache.log4j.ConsoleAppender - -# A1 uses PatternLayout comforting Eclipse's debugger. -log4j.appender.A1.layout=org.apache.log4j.PatternLayout -log4j.appender.A1.layout.ConversionPattern=%p: %m at %c.%M(%C{1}.java:%L)%n - -# Activate per-class or package logging rules if required. For example -# reducing logging to INFO level for class de.hdm-stuttgart.mi.sda2.account.App -# can be achieved by un-commenting the following line: - -#log4j.logger.de.hdm-stuttgart.mi.sda2.account.App.parse.Group=INFO diff --git a/P/Sda2/account/src/main/resources/log4j2.xml b/P/Sda2/account/src/main/resources/log4j2.xml new file mode 100644 index 0000000000000000000000000000000000000000..276bc7c624e1a4db7e0601024fd80044e02f0955 --- /dev/null +++ b/P/Sda2/account/src/main/resources/log4j2.xml @@ -0,0 +1,21 @@ +<?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.employeecompany.App" level="debug"> + <AppenderRef ref="A1"/> + </Logger> + <Root level="info"> + <AppenderRef ref="STDOUT"/> + </Root> + </Loggers> +</Configuration> \ No newline at end of file