Compare commits
8
Commits
de4d66bca7
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f1a57144a | ||
|
|
e5d3a789e6 | ||
|
|
5be306424a | ||
|
|
b587d1a401 | ||
|
|
526e01a80f | ||
|
|
ab99fae9f5 | ||
|
|
d00817dcee | ||
|
|
a15373831e |
+19
@@ -0,0 +1,19 @@
|
||||
pipeline:
|
||||
build:
|
||||
image: anapsix/alpine-java:8_jdk
|
||||
commands:
|
||||
- mkdir -p droneout
|
||||
- javac -cp droneout:jars/hamcrest-core-1.3.jar:jars/junit-4.12.jar -d droneout src/Beduerftiger.java
|
||||
- javac -cp droneout:jars/hamcrest-core-1.3.jar:jars/junit-4.12.jar -d droneout src/TestBeduerftiger.java
|
||||
- javac -cp droneout:jars/hamcrest-core-1.3.jar:jars/junit-4.12.jar -d droneout src/Person.java
|
||||
- javac -cp droneout:jars/hamcrest-core-1.3.jar:jars/junit-4.12.jar -d droneout src/Account.java
|
||||
- javac -cp droneout:jars/hamcrest-core-1.3.jar:jars/junit-4.12.jar -d droneout src/TestAccount.java
|
||||
|
||||
|
||||
|
||||
test:
|
||||
image: anapsix/alpine-java:8_jdk
|
||||
commands:
|
||||
- java -cp droneout:jars/hamcrest-core-1.3.jar:jars/junit-4.12.jar org.junit.runner.JUnitCore TestBeduerftiger
|
||||
- java -cp droneout:jars/hamcrest-core-1.3.jar:jars/junit-4.12.jar org.junit.runner.JUnitCore TestAccount
|
||||
|
||||
Generated
-12
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="jars" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
+2
-2
@@ -3,7 +3,7 @@
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="false" project-jdk-name="10" project-jdk-type="JavaSDK">
|
||||
<output url="file://$USER_HOME$/gitchareswe" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="true" project-jdk-name="10" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/../gitchareswe" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+1
-1
@@ -2,7 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/ChareSWE.iml" filepath="$PROJECT_DIR$/.idea/ChareSWE.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/ChareSWE.iml" filepath="$PROJECT_DIR$/ChareSWE.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
+6
-2
@@ -2,10 +2,14 @@ public class Account {
|
||||
public Person owner;
|
||||
public String email;
|
||||
|
||||
|
||||
Account(Person owner, String email){
|
||||
this.owner = owner;
|
||||
this.email = email;
|
||||
}
|
||||
public void accountErstellen(Person p, String e_email){
|
||||
|
||||
|
||||
this.owner = p;
|
||||
this.email = e_email;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CredentialsTest{
|
||||
public void testTwo(){
|
||||
|
||||
Credentials c = new Credentials("hofmannol", "GERONIMO");
|
||||
assertTrue(c.valid());
|
||||
assertEquals("hofmannol", c.login);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -6,6 +6,7 @@ public class Person {
|
||||
public int age;
|
||||
|
||||
Person(String name, String vname, int age){
|
||||
|
||||
this.name = name;
|
||||
this.vname = vname;
|
||||
this.age = age;
|
||||
|
||||
@@ -3,17 +3,20 @@ public class Spender extends Person{
|
||||
private int amount;
|
||||
|
||||
public Spender (String fname, String lname, int age, int summe){
|
||||
|
||||
super(fname, lname, age);
|
||||
this.amount = summe;
|
||||
}
|
||||
|
||||
public void betragSetzen(int summe){
|
||||
|
||||
if(summe > 0){
|
||||
amount = summe;
|
||||
}
|
||||
}
|
||||
|
||||
public int getAmount(){
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class TestAccount {
|
||||
|
||||
|
||||
@Test
|
||||
public void test1(){
|
||||
|
||||
// Arrange
|
||||
Person p = new Person("Hans","Georg", 12);
|
||||
|
||||
|
||||
// Act
|
||||
Account a = new Account(p, "fdfdf");
|
||||
|
||||
// Assert
|
||||
assertEquals("Georg", a.owner.vname);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testM2(){
|
||||
// Arrange
|
||||
Person p = new Person("Hans","Georg", 12);
|
||||
|
||||
|
||||
// Act
|
||||
Account a = new Account(p, "fdfdf");
|
||||
|
||||
// Assert
|
||||
assertEquals("Georg", a.owner.vname);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3(){
|
||||
// Arrange
|
||||
Person p = new Person("Hans","Georg", 12);
|
||||
|
||||
|
||||
// Act
|
||||
Account a = new Account(p, "fdfdf");
|
||||
|
||||
// Assert
|
||||
assertEquals(12, a.owner.age);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class TestClass {
|
||||
|
||||
@Test
|
||||
public void test1(){
|
||||
// arrange
|
||||
Person p = new Person("Dani", "Estade", 18);
|
||||
|
||||
Spender s = new Spender( "titi", "nase", 22 , 33);
|
||||
|
||||
//act
|
||||
assertEquals("titi", s.name);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,4 +12,5 @@ public class TestKorndoerfer {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user