moved tests from akka-actor to new module akka-actor-tests to fix circular dependencies between testkit and akka-actor
This commit is contained in:
parent
71a32c719a
commit
0abf51d878
41 changed files with 14 additions and 11 deletions
|
|
@ -0,0 +1,42 @@
|
|||
package akka.japi;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class JavaAPITestBase {
|
||||
|
||||
@Test public void shouldCreateSomeString() {
|
||||
Option<String> o = Option.some("abc");
|
||||
assertFalse(o.isEmpty());
|
||||
assertTrue(o.isDefined());
|
||||
assertEquals("abc", o.get());
|
||||
}
|
||||
|
||||
@Test public void shouldCreateNone() {
|
||||
Option<String> o1 = Option.none();
|
||||
assertTrue(o1.isEmpty());
|
||||
assertFalse(o1.isDefined());
|
||||
|
||||
Option<Float> o2 = Option.none();
|
||||
assertTrue(o2.isEmpty());
|
||||
assertFalse(o2.isDefined());
|
||||
}
|
||||
|
||||
@Test public void shouldEnterForLoop() {
|
||||
for(String s : Option.some("abc")) {
|
||||
return;
|
||||
}
|
||||
fail("for-loop not entered");
|
||||
}
|
||||
|
||||
@Test public void shouldNotEnterForLoop() {
|
||||
for(Object o : Option.none()) {
|
||||
fail("for-loop entered");
|
||||
}
|
||||
}
|
||||
|
||||
@Test public void shouldBeSingleton() {
|
||||
assertSame(Option.none(), Option.none());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue