Browse Source

Erstellen, implementieren und erweitern der jeweils spezifischen abstrakten Testklassen

- ASimpleStackTest
- ASimpleActivictyStackTest
vollständige_und_weitere_testate
chris 3 years ago
parent
commit
b51c7f09a9
  1. 58
      SimpleActivityStack/src/testat/ASimpleActivityStackTest.java
  2. 41
      SimpleActivityStack/src/testat/ASimpleStackTest.java

58
SimpleActivityStack/src/testat/ASimpleActivityStackTest.java

@ -0,0 +1,58 @@
package testat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
/**
*
* @author cm
*
*/
public abstract class ASimpleActivityStackTest extends ASimpleStackTestBase<SimpleActivity> {
@Override
protected void init() {
s1 = new SimpleActivity("s1");
s2 = new SimpleActivity("s2");
s3 = new SimpleActivity("s3");
s4 = new SimpleActivity("s4");
s5 = new SimpleActivity("s5");
s6 = new SimpleActivity("s6", "negativ", false);
s7 = new SimpleActivity("s7", "negativ", false);
s8 = new SimpleActivity("s8", "negativ", false);
s9 = new SimpleActivity("s9", "negativ", false);
s10 = new SimpleActivity("s10", "negativ", false);
act1 = new IAction<SimpleActivity>() {
@Override
public void execute(SimpleActivity e) {
temp1 = temp1 || e.isActive();
}
};
act2 = new IAction<SimpleActivity>() {
@Override
public void execute(SimpleActivity e) {
temp2 = temp2 && e.isActive();
}
};
}
@Test
public void testPushActivity_1() {
sstack.push(s1);
assertEquals(true, sstack.contains(s1));
assertEquals(true, sstack.get(0).isActive());
}
@Test
public void testPushActivity_2() {
sstack.push(s6);
assertEquals(true, sstack.contains(s6));
assertEquals(true, sstack.get(0).isActive());
}
}

41
SimpleActivityStack/src/testat/ASimpleStackTest.java

@ -0,0 +1,41 @@
package testat;
/**
*
* @author cm
*
*/
public abstract class ASimpleStackTest extends ASimpleStackTestBase<String> {
@Override
protected void init() {
s1 = "T-s1";
s2 = "T-s2";
s3 = "T-s3";
s4 = "T-s4";
s5 = "T-s5";
s6 = "T-s6";
s7 = "T-s7";
s8 = "T-s8";
s9 = "T-s9";
s10 = "T-s10";
act1 = new IAction<String>() {
@Override
public void execute(String e) {
temp1 = temp1 || e.contains("T");
}
};
act2 = new IAction<String>() {
@Override
public void execute(String e) {
temp2 = temp2 && e.contains("T");
}
};
}
}
Loading…
Cancel
Save