diff --git a/.github/.keep b/.github/.keep new file mode 100644 index 0000000..e69de29 diff --git a/TD04/.mvn/jvm.config b/TD04/.mvn/jvm.config new file mode 100644 index 0000000..e69de29 diff --git a/TD04/.mvn/maven.config b/TD04/.mvn/maven.config new file mode 100644 index 0000000..e69de29 diff --git a/TD04/pom.xml b/TD04/pom.xml new file mode 100644 index 0000000..a74ef37 --- /dev/null +++ b/TD04/pom.xml @@ -0,0 +1,21 @@ + + 4.0.0 + fr.ivars + TD04 + jar + 1.0-SNAPSHOT + + 1.8 + 1.8 + fr.ivars + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + \ No newline at end of file diff --git a/TD04/src/main/java/fr/ivars/App.java b/TD04/src/main/java/fr/ivars/App.java new file mode 100644 index 0000000..b806b8b --- /dev/null +++ b/TD04/src/main/java/fr/ivars/App.java @@ -0,0 +1,22 @@ +package fr.ivars; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println(hello()); + } + + public static String hello() { + return "Hello World!" ; + } + + public static String hello(String param) { + return param ; + } + +} diff --git a/TD04/src/test/java/fr/ivars/AppTest.java b/TD04/src/test/java/fr/ivars/AppTest.java new file mode 100644 index 0000000..6fc37f9 --- /dev/null +++ b/TD04/src/test/java/fr/ivars/AppTest.java @@ -0,0 +1,45 @@ +package fr.ivars; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Test the return with empty parameter + */ + public void testHelloEmptyParameter() + { + assertEquals("Hello World!", App.hello()); + } + + /** + * Test the return with a parameter + */ + public void testHelloParameter() + { + assertEquals("Hello JMB!", App.hello("Hello JMB!")); + } +}