diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..7b2e5fa --- /dev/null +++ b/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + tanel + boot3 + jar + 1.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-parent + 1.5.2.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + \ No newline at end of file diff --git a/src/main/java/rihard/JooneVorrand2.java b/src/main/java/rihard/JooneVorrand2.java new file mode 100644 index 0000000..9de1879 --- /dev/null +++ b/src/main/java/rihard/JooneVorrand2.java @@ -0,0 +1,8 @@ +package rihard; +//liidesfn kaust +public interface JooneVorrand2{ + + + public double f(double a, double b); + +} \ No newline at end of file diff --git a/src/main/java/rihard/Joonefunktsioon2.java b/src/main/java/rihard/Joonefunktsioon2.java new file mode 100644 index 0000000..df68900 --- /dev/null +++ b/src/main/java/rihard/Joonefunktsioon2.java @@ -0,0 +1,21 @@ +package rihard; + +public class Joonefunktsioon2 implements JooneVorrand2{ + + double a; + double b; + + public Joonefunktsioon2(double a, double b){ + + this.a=a; + this.b=b; + + } + + public double f(double x, double b){ + + return (a*b); + + } + +} \ No newline at end of file diff --git a/src/main/java/rihard/Rakendus.java b/src/main/java/rihard/Rakendus.java new file mode 100644 index 0000000..b98ef1d --- /dev/null +++ b/src/main/java/rihard/Rakendus.java @@ -0,0 +1,42 @@ +package rihard; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.beans.factory.annotation.Autowired; +import javax.servlet.http.HttpSession; + +@RestController +@SpringBootApplication +public class Rakendus{ + + + public static double arvuta(JooneVorrand2 fn, double arv1, double arv2){ + + return fn.f(arv1, arv2); + + } + + + @RequestMapping("/joon2") + public String vabaliige(double a, double b){ + + JooneVorrand2 vabaliige=new Joonefunktsioon2(a, b); + + return "S = "+(arvuta(vabaliige, a, b)); + + } + + + + + public static void main(String[] args) { + System.getProperties().put("server.port", 4213); + SpringApplication.run(Rakendus.class, args); + } +} + +//scl enable rh-maven33 bash +//mvn package +//java -jar target/boot3-1.0-SNAPSHOT.jar \ No newline at end of file diff --git a/src/main/java/tanel/JooneVorrand2.java b/src/main/java/tanel/JooneVorrand2.java new file mode 100644 index 0000000..feee4db --- /dev/null +++ b/src/main/java/tanel/JooneVorrand2.java @@ -0,0 +1,7 @@ +package tanel; +public interface JooneVorrand2{ + + + public double f(double a, double b); + +} \ No newline at end of file diff --git a/src/main/java/tanel/Joonefunktsioon2.java b/src/main/java/tanel/Joonefunktsioon2.java new file mode 100644 index 0000000..23efe39 --- /dev/null +++ b/src/main/java/tanel/Joonefunktsioon2.java @@ -0,0 +1,21 @@ +package tanel; + +public class Joonefunktsioon2 implements JooneVorrand2{ + + double a; + double b; + + public Joonefunktsioon2(double a, double b){ + + this.a=a; + this.b=b; + + } + + public double f(double x, double b){ + + return ((a*b)/2); + + } + +} \ No newline at end of file diff --git a/src/main/java/tanel/Rakendus.java b/src/main/java/tanel/Rakendus.java new file mode 100644 index 0000000..566ff3a --- /dev/null +++ b/src/main/java/tanel/Rakendus.java @@ -0,0 +1,42 @@ +package tanel; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.beans.factory.annotation.Autowired; +import javax.servlet.http.HttpSession; + +@RestController +@SpringBootApplication +public class Rakendus{ + + + public static double arvuta(JooneVorrand2 fn, double arv1, double arv2){ + + return fn.f(arv1, arv2); + + } + + + @RequestMapping("/joon2") + public String vabaliige(double a, double b){ + + JooneVorrand2 vabaliige=new Joonefunktsioon2(a, b); + + return "S = "+(arvuta(vabaliige, a, b)); + + } + + + + + public static void main(String[] args) { + System.getProperties().put("server.port", 8768); + SpringApplication.run(Rakendus.class, args); + } +} + +//scl enable rh-maven33 bash +//mvn package +//java -jar target/boot3-1.0-SNAPSHOT.jar \ No newline at end of file diff --git a/src/main/resources/public/arvutus.html b/src/main/resources/public/arvutus.html new file mode 100644 index 0000000..51da5c5 --- /dev/null +++ b/src/main/resources/public/arvutus.html @@ -0,0 +1,31 @@ + + + + + + +

Arvutamine

+ + + +

+
Vastuse koht
+ + \ No newline at end of file diff --git a/src/main/resources/public/tervitus.html b/src/main/resources/public/tervitus.html new file mode 100644 index 0000000..6e33dc4 --- /dev/null +++ b/src/main/resources/public/tervitus.html @@ -0,0 +1,35 @@ + + + + + + +

Kolmnurga pindala arvutamine

+

+ Sisesta alus
+
+ Sisesta korgus
+ +
+ +

+
Vastus:
+ + \ No newline at end of file diff --git a/src/main/resources/public/tervitus.txt b/src/main/resources/public/tervitus.txt new file mode 100644 index 0000000..0f039ab --- /dev/null +++ b/src/main/resources/public/tervitus.txt @@ -0,0 +1 @@ +Tere \ No newline at end of file diff --git "a/src/main/resources/public/\303\274lesanne.txt" "b/src/main/resources/public/\303\274lesanne.txt" new file mode 100644 index 0000000..2af98d1 --- /dev/null +++ "b/src/main/resources/public/\303\274lesanne.txt" @@ -0,0 +1 @@ +TEE TERVITUS.TXT'ST HTML FILE, MIS KÄIB KÜSIMAS GEOM KESKMISEST ARVE JA KUVAB VASTUSE. 2X GET \ No newline at end of file diff --git a/src/test/java/rihard/EsimeneTest.java b/src/test/java/rihard/EsimeneTest.java new file mode 100644 index 0000000..e2b781b --- /dev/null +++ b/src/test/java/rihard/EsimeneTest.java @@ -0,0 +1,20 @@ +package rihard; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class EsimeneTest{ + + + + + @Test + public void test1(){ + + Rakendus r=new Rakendus(); + assertEquals("S = 6.0", r.vabaliige(3, 2)); + + } + +} diff --git a/src/test/java/tanel/EsimeneTest.java b/src/test/java/tanel/EsimeneTest.java new file mode 100644 index 0000000..67b43bd --- /dev/null +++ b/src/test/java/tanel/EsimeneTest.java @@ -0,0 +1,20 @@ +package tanel; + +import org.junit.*; +import static org.junit.Assert.*; + + +public class EsimeneTest{ + + + + + @Test + public void test1(){ + + Rakendus r=new Rakendus(); + assertEquals("S = 6.0", r.vabaliige(3, 4)); + + } + +} diff --git a/target/boot3-1.0-SNAPSHOT.jar b/target/boot3-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..4b6f25a Binary files /dev/null and b/target/boot3-1.0-SNAPSHOT.jar differ diff --git a/target/boot3-1.0-SNAPSHOT.jar.original b/target/boot3-1.0-SNAPSHOT.jar.original new file mode 100644 index 0000000..fb15a37 Binary files /dev/null and b/target/boot3-1.0-SNAPSHOT.jar.original differ diff --git a/target/classes/public/arvutus.html b/target/classes/public/arvutus.html new file mode 100644 index 0000000..51da5c5 --- /dev/null +++ b/target/classes/public/arvutus.html @@ -0,0 +1,31 @@ + + + + + + +

Arvutamine

+ + + +

+
Vastuse koht
+ + \ No newline at end of file diff --git a/target/classes/public/tervitus.html b/target/classes/public/tervitus.html new file mode 100644 index 0000000..6e33dc4 --- /dev/null +++ b/target/classes/public/tervitus.html @@ -0,0 +1,35 @@ + + + + + + +

Kolmnurga pindala arvutamine

+

+ Sisesta alus
+
+ Sisesta korgus
+ +
+ +

+
Vastus:
+ + \ No newline at end of file diff --git a/target/classes/public/tervitus.txt b/target/classes/public/tervitus.txt new file mode 100644 index 0000000..0f039ab --- /dev/null +++ b/target/classes/public/tervitus.txt @@ -0,0 +1 @@ +Tere \ No newline at end of file diff --git "a/target/classes/public/\303\274lesanne.txt" "b/target/classes/public/\303\274lesanne.txt" new file mode 100644 index 0000000..2af98d1 --- /dev/null +++ "b/target/classes/public/\303\274lesanne.txt" @@ -0,0 +1 @@ +TEE TERVITUS.TXT'ST HTML FILE, MIS KÄIB KÜSIMAS GEOM KESKMISEST ARVE JA KUVAB VASTUSE. 2X GET \ No newline at end of file diff --git a/target/classes/rihard/JooneVorrand2.class b/target/classes/rihard/JooneVorrand2.class new file mode 100644 index 0000000..37fbff2 Binary files /dev/null and b/target/classes/rihard/JooneVorrand2.class differ diff --git a/target/classes/rihard/Joonefunktsioon2.class b/target/classes/rihard/Joonefunktsioon2.class new file mode 100644 index 0000000..f3854da Binary files /dev/null and b/target/classes/rihard/Joonefunktsioon2.class differ diff --git a/target/classes/rihard/Rakendus.class b/target/classes/rihard/Rakendus.class new file mode 100644 index 0000000..db5e754 Binary files /dev/null and b/target/classes/rihard/Rakendus.class differ diff --git a/target/classes/tanel/JooneVorrand2.class b/target/classes/tanel/JooneVorrand2.class new file mode 100644 index 0000000..d60dcdb Binary files /dev/null and b/target/classes/tanel/JooneVorrand2.class differ diff --git a/target/classes/tanel/Joonefunktsioon2.class b/target/classes/tanel/Joonefunktsioon2.class new file mode 100644 index 0000000..5a7dee9 Binary files /dev/null and b/target/classes/tanel/Joonefunktsioon2.class differ diff --git a/target/classes/tanel/Rakendus.class b/target/classes/tanel/Rakendus.class new file mode 100644 index 0000000..9ebdb6d Binary files /dev/null and b/target/classes/tanel/Rakendus.class differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..14e0a59 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Mon Mar 13 13:38:31 EET 2017 +version=1.0-SNAPSHOT +groupId=tanel +artifactId=boot3 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..ba66121 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,3 @@ +/home/tanelmaas/2. semester/Javakaust/KODUTÖÖD/t09tervikveeb/src/main/java/tanel/Rakendus.java +/home/tanelmaas/2. semester/Javakaust/KODUTÖÖD/t09tervikveeb/src/main/java/tanel/JooneVorrand2.java +/home/tanelmaas/2. semester/Javakaust/KODUTÖÖD/t09tervikveeb/src/main/java/tanel/Joonefunktsioon2.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..d57adfb --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +/home/tanelmaas/2. semester/Javakaust/KODUTÖÖD/t09tervikveeb/src/test/java/tanel/EsimeneTest.java diff --git a/target/surefire-reports/TEST-rihard.EsimeneTest.xml b/target/surefire-reports/TEST-rihard.EsimeneTest.xml new file mode 100644 index 0000000..d44026e --- /dev/null +++ b/target/surefire-reports/TEST-rihard.EsimeneTest.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-tanel.EsimeneTest.xml b/target/surefire-reports/TEST-tanel.EsimeneTest.xml new file mode 100644 index 0000000..d33b7fc --- /dev/null +++ b/target/surefire-reports/TEST-tanel.EsimeneTest.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/rihard.EsimeneTest.txt b/target/surefire-reports/rihard.EsimeneTest.txt new file mode 100644 index 0000000..3637f0c --- /dev/null +++ b/target/surefire-reports/rihard.EsimeneTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: rihard.EsimeneTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec - in rihard.EsimeneTest diff --git a/target/surefire-reports/tanel.EsimeneTest.txt b/target/surefire-reports/tanel.EsimeneTest.txt new file mode 100644 index 0000000..6284769 --- /dev/null +++ b/target/surefire-reports/tanel.EsimeneTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: tanel.EsimeneTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec - in tanel.EsimeneTest diff --git a/target/test-classes/rihard/EsimeneTest.class b/target/test-classes/rihard/EsimeneTest.class new file mode 100644 index 0000000..820c5a8 Binary files /dev/null and b/target/test-classes/rihard/EsimeneTest.class differ diff --git a/target/test-classes/tanel/EsimeneTest.class b/target/test-classes/tanel/EsimeneTest.class new file mode 100644 index 0000000..9cebe00 Binary files /dev/null and b/target/test-classes/tanel/EsimeneTest.class differ