Compare commits

...
8 Commits
Author SHA1 Message Date
blckxsepia 2f1a57144a .drone.yml befüllt mit Bedürftiger & Test neu
continuous-integration/drone/push Build is passing
2018-12-20 16:57:43 +01:00
esheteda67206 e5d3a789e6 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	.idea/misc.xml
2018-12-20 16:52:13 +01:00
esheteda67206 5be306424a added TestAccount 2018-12-20 16:51:58 +01:00
amadoubahaa68134 b587d1a401 Spender Klasse fertig 2018-12-20 16:49:10 +01:00
esheteda67206 526e01a80f added Account, Person and TestAccount
continuous-integration/drone/push Build is failing
2018-12-20 16:48:53 +01:00
esheteda67206 ab99fae9f5 added account&person and account test
continuous-integration/drone/push Build is failing
2018-12-20 16:47:03 +01:00
blckxsepia d00817dcee .drone.yml befüllt mit Bedürftiger & Test
continuous-integration/drone/push Build is passing
2018-12-20 16:42:02 +01:00
blckxsepia a15373831e .drone.yml erstellt 2018-12-20 16:32:32 +01:00
11 changed files with 105 additions and 18 deletions
+19
View File
@@ -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
-12
View File
@@ -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>
+2 -2
View File
@@ -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>
+1 -1
View File
@@ -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
View File
@@ -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;
}
+1 -1
View File
@@ -16,7 +16,7 @@ public class CredentialsTest{
public void testTwo(){
Credentials c = new Credentials("hofmannol", "GERONIMO");
assertTrue(c.valid());
assertEquals("hofmannol", c.login);
}
@Test
+1
View File
@@ -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
View File
@@ -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;
}
+52
View File
@@ -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);
}
}
+19
View File
@@ -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);
}
}
+1
View File
@@ -12,4 +12,5 @@ public class TestKorndoerfer {
}
}