BAEL-1852 moved the code into junit-5 module (#4915)

* BAEL-1852 moved the code into junit-5 module

* BAEL-1852 removed junit-abstract module from parent-modules
This commit is contained in:
Predrag Maric
2018-08-07 14:42:57 +02:00
committed by GitHub
parent a17637b88a
commit ddc106ccd9
13 changed files with 31 additions and 90 deletions
@@ -0,0 +1,17 @@
/**
*
*/
package com.baeldung.abstractclass.abstractmethod;
/**
* When method calls abstract method.
*/
public abstract class AbstractMethodCalling {
public abstract String abstractFunc();
public String defaultImpl() {
String res = abstractFunc();
return (res == null) ? "Default" : (res + " Default");
}
}
@@ -0,0 +1,14 @@
package com.baeldung.abstractclass.indepedentmethod;
/**
* Test Independent Method
*
*/
public abstract class AbstractIndependent {
public abstract int abstractFunc();
public String defaultImpl() {
return "DEFAULT-1";
}
}
@@ -0,0 +1,10 @@
package com.baeldung.abstractclass.indepedentmethod;
public class ConcreteImpl extends AbstractIndependent {
@Override
public int abstractFunc() {
return 4;
}
}
@@ -0,0 +1,22 @@
package com.baeldung.abstractclass.instancefields;
/**
* Test Independent Method
*/
public abstract class AbstractInstanceFields {
protected int count;
private boolean active = false;
public abstract int abstractFunc();
public String testFunc() {
String response;
if (count > 5) {
response = "Overflow";
} else {
response = active ? "Added" : "Blocked";
}
return response;
}
}
@@ -0,0 +1,17 @@
package com.baeldung.abstractclass.privatemethod;
import java.time.LocalDateTime;
public abstract class AbstractPrivateMethods {
public abstract int abstractFunc();
public String defaultImpl() {
return getCurrentDateTime() + "DEFAULT-1";
}
private String getCurrentDateTime() {
return LocalDateTime.now()
.toString();
}
}