MCPcopy Create free account
hub / github.com/akeranen/the-one / setUpUsing

Method setUpUsing

test/ExternalMovementTest.java:51–79  ·  view source on GitHub ↗
(String[] input)

Source from the content-addressed store, hash-verified

49 private SimClock clock;
50
51 protected void setUpUsing(String[] input) throws Exception {
52 super.setUp();
53 ExternalMovement.reset();
54 TestSettings ts = new TestSettings();
55 ts.putSetting(MovementModel.MOVEMENT_MODEL_NS + "." +
56 MovementModel.WORLD_SIZE, "1000,1000");
57 File outFile = File.createTempFile("eMovementTest", ".tmp");
58 outFile.deleteOnExit();
59 PrintWriter pw = new PrintWriter(outFile);
60
61 for (String s : input) {
62 pw.println(s);
63 }
64
65 pw.close();
66
67 ts.putSetting(ExternalMovement.EXTERNAL_MOVEMENT_NS + "." +
68 ExternalMovement.MOVEMENT_FILE_S, outFile.getAbsolutePath());
69
70 MovementModel emProto = (MovementModel)
71 ts.createIntializedObject("movement.ExternalMovement");
72
73 TestUtils utils = new TestUtils(null, null, ts);
74 h1 = utils.createHost(emProto, "h1");
75 h2 = utils.createHost(emProto, "h2");
76 h3 = utils.createHost(emProto, "h3");
77 clock = SimClock.getInstance();
78 clock.setTime(0);
79 }
80
81 public void testMovement() throws Exception {
82 setUpUsing(INPUT);

Callers 2

testMovementMethod · 0.95
testStationaryMethod · 0.95

Calls 8

resetMethod · 0.95
putSettingMethod · 0.95
createHostMethod · 0.95
getInstanceMethod · 0.95
closeMethod · 0.65
setUpMethod · 0.45
setTimeMethod · 0.45

Tested by

no test coverage detected