Compare commits
21
Commits
558fecdac3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f1a57144a | ||
|
|
e5d3a789e6 | ||
|
|
5be306424a | ||
|
|
b587d1a401 | ||
|
|
526e01a80f | ||
|
|
ab99fae9f5 | ||
|
|
d00817dcee | ||
|
|
a15373831e | ||
|
|
de4d66bca7 | ||
|
|
71906bd99c | ||
|
|
4c73ee72ea | ||
|
|
4e82a07929 | ||
|
|
a8cfd4fd56 | ||
|
|
10b1cad5ec | ||
|
|
f064d3835e | ||
|
|
567ced3feb | ||
|
|
6d88ba7850 | ||
|
|
8292f11540 | ||
|
|
4ab6ec6328 | ||
|
|
cf90b62276 | ||
|
|
0821639d89 |
+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
+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>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
public class Beduerftiger {
|
||||
|
||||
public String bFirstName;
|
||||
public String bLastName;
|
||||
public String bNeed;
|
||||
|
||||
public Beduerftiger(){
|
||||
|
||||
}
|
||||
public Beduerftiger(String theFirstName, String theLastName, String theNeed ){
|
||||
this.bFirstName = theFirstName;
|
||||
this.bLastName = theLastName;
|
||||
this.bNeed = theNeed;
|
||||
}
|
||||
}
|
||||
+17
-21
@@ -1,8 +1,4 @@
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import assets.Helpers;
|
||||
|
||||
public class Credentials {
|
||||
|
||||
@@ -19,29 +15,29 @@ public class Credentials {
|
||||
|
||||
public boolean valid(){
|
||||
|
||||
/* String line;
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
try {
|
||||
FileReader fr = new FileReader(passwd.txt);
|
||||
BufferedReader br = new BufferedReader(fr);
|
||||
while ((line = br.readLine()) != null)
|
||||
result.add(line);
|
||||
br.close();
|
||||
String[] lines = Helpers.readTextdatei("src/assets/passwd");
|
||||
String tmp = "";
|
||||
String name = "";
|
||||
String pw = "";
|
||||
for(int i=0; i<lines.length; i++) {
|
||||
|
||||
if(i % 2 == 0){
|
||||
name = lines[i];
|
||||
System.out.println( "NAME: " + name);
|
||||
|
||||
}else {
|
||||
pw= lines[i];
|
||||
System.out.println(pw);
|
||||
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return result.toArray(new String[]{});
|
||||
*/
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CredentialsTest{
|
||||
public void testTwo(){
|
||||
|
||||
Credentials c = new Credentials("hofmannol", "GERONIMO");
|
||||
assertTrue(c.valid());
|
||||
assertEquals("hofmannol", c.login);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
public class Person {
|
||||
|
||||
|
||||
public String name;
|
||||
public String vname;
|
||||
public int age;
|
||||
|
||||
Person(String name, String vname, int age){
|
||||
|
||||
this.name = name;
|
||||
this.vname = vname;
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
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,27 @@
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class TestBeduerftiger {
|
||||
|
||||
@Test
|
||||
public void firstNameChange(){
|
||||
String bfirstName= "Jesus";
|
||||
String result ="Jesus";
|
||||
assertEquals(bfirstName, result);
|
||||
}
|
||||
@Test
|
||||
public void lastNameChange(){
|
||||
String bLastName= "Gottessohn";
|
||||
String result ="Gottessohn";
|
||||
assertEquals(bLastName, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void NeedChange(){
|
||||
String bNeed= "Abendmahl";
|
||||
String result ="Abendmahl";
|
||||
assertEquals(bNeed, result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class TestSpendenBetrag {
|
||||
@Test
|
||||
public void spendenhoeheChange(){
|
||||
SpendenBetrag s = new SpendenBetrag(2000,"Pia", "Korn", "Aarif","Amablabla", "blalba@mail.de");
|
||||
|
||||
assertEquals("Pia", s.firstnameSpender);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void spendenhoeheChange2(){
|
||||
SpendenBetrag t = new SpendenBetrag(2000,"Pia", "Korn", "Aarif","Amablabla", "blalba@mail.de");
|
||||
|
||||
assertEquals(2000, t.spendenhoehe);
|
||||
|
||||
|
||||
}
|
||||
@Test
|
||||
public void spendenhoeheChange3(){
|
||||
SpendenBetrag u = new SpendenBetrag(50,"Lien", "Tra", "Jay","Bay", "Test");
|
||||
|
||||
assertEquals("Jay", u.firstnameBeduerftiger);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user