2 changed files with 99 additions and 0 deletions
@ -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()); |
|||
} |
|||
} |
@ -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…
Reference in new issue