Replaced akka.config with new configuration utility. See #1141 and see #1342

* All default values removed from code and loaded from akka-actor-reference.conf, located in src/main/resources (included in jar)
* Default test configuration included in AkkaSpec instead of using akka.test.conf, avoids problems when running test (in IDE) and forgetting to use -Dakka.mode=test.
* System.properties used first, if availble
* Next step will be to split akka-actor-reference.conf in separate -reference for each module
This commit is contained in:
Patrik Nordwall 2011-11-15 11:34:39 +01:00
parent 80d766b07b
commit 4b8f11ea92
137 changed files with 8689 additions and 1411 deletions

View file

@ -6,37 +6,44 @@ 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 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());
@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());
}
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 shouldEnterForLoop() {
for (@SuppressWarnings("unused")
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 shouldNotEnterForLoop() {
for (@SuppressWarnings("unused")
Object o : Option.none()) {
fail("for-loop entered");
}
}
@Test public void shouldBeSingleton() {
assertSame(Option.none(), Option.none());
}
@Test
public void shouldBeSingleton() {
assertSame(Option.none(), Option.none());
}
}