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

Method testGetRemainingByteCount

test/ConnectionTest.java:108–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 }
107
108 public void testGetRemainingByteCount() {
109 double STEP = 0.1;
110 int transferred;
111
112 assertEquals(size[0], c[0].getRemainingByteCount());
113 assertEquals(size[1], c[1].getRemainingByteCount());
114
115 clock.setTime(START_TIME + STEP);
116 for (int i=0; i<this.conCount; i++) {
117 transferred = (int)Math.ceil(STEP * speed[i]);
118 assertEquals("index " + i,
119 size[i] - transferred, c[i].getRemainingByteCount());
120 }
121
122 clock.setTime(START_TIME + STEP * 5);
123 for (int i=0; i<this.conCount; i++) {
124 transferred = (int)Math.ceil(STEP * 5 * speed[i]);
125 assertEquals("index " + i,
126 size[i] - transferred,
127 c[i].getRemainingByteCount());
128 }
129 }
130
131 public void testIsMessageTransferred() {
132 assertFalse(c[0].isMessageTransferred()); /* takes 1.0 seconds */

Callers

nothing calls this directly

Calls 2

getRemainingByteCountMethod · 0.45
setTimeMethod · 0.45

Tested by

no test coverage detected