Improve code / xml formatting, #54
This commit is contained in:
@@ -67,23 +67,23 @@ public class OkHttpEngineTest {
|
||||
assertThat(response).isEqualTo("TEST RESPONSE");
|
||||
}
|
||||
|
||||
// @Test(expected = IOException.class)
|
||||
// public void close_shouldCloseInputStream() throws Exception {
|
||||
// engine.sendRequest(new Tile(1, 2, new Integer(3).byteValue()));
|
||||
// engine.close();
|
||||
// // Calling read after the stream is closed should throw an exception.
|
||||
// InputStream responseStream = engine.read();
|
||||
// responseStream.read();
|
||||
// }
|
||||
// @Test(expected = IOException.class)
|
||||
// public void close_shouldCloseInputStream() throws Exception {
|
||||
// engine.sendRequest(new Tile(1, 2, new Integer(3).byteValue()));
|
||||
// engine.close();
|
||||
// // Calling read after the stream is closed should throw an exception.
|
||||
// InputStream responseStream = engine.read();
|
||||
// responseStream.read();
|
||||
// }
|
||||
//
|
||||
// @Test(expected = IOException.class)
|
||||
// public void requestCompleted_shouldCloseInputStream() throws Exception {
|
||||
// engine.sendRequest(new Tile(1, 2, new Integer(3).byteValue()));
|
||||
// engine.requestCompleted(true);
|
||||
// // Calling read after the stream is closed should throw an exception.
|
||||
// InputStream responseStream = engine.read();
|
||||
// responseStream.read();
|
||||
// }
|
||||
// @Test(expected = IOException.class)
|
||||
// public void requestCompleted_shouldCloseInputStream() throws Exception {
|
||||
// engine.sendRequest(new Tile(1, 2, new Integer(3).byteValue()));
|
||||
// engine.requestCompleted(true);
|
||||
// // Calling read after the stream is closed should throw an exception.
|
||||
// InputStream responseStream = engine.read();
|
||||
// responseStream.read();
|
||||
// }
|
||||
|
||||
@Test
|
||||
public void requestCompleted_shouldReturnValueGiven() throws Exception {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class KeyMapTest {
|
||||
Assert.assertTrue(it == it2);
|
||||
}
|
||||
|
||||
/* replace the items with itself */
|
||||
/* replace the items with itself */
|
||||
for (Item it : items) {
|
||||
Item it2 = map2.put(it);
|
||||
Assert.assertTrue(it == it2);
|
||||
|
||||
@@ -41,9 +41,9 @@ public class RTreeTest {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
// return val + "/"
|
||||
// + Arrays.toString(min) + "/"
|
||||
// + Arrays.toString(max);
|
||||
// return val + "/"
|
||||
// + Arrays.toString(min) + "/"
|
||||
// + Arrays.toString(max);
|
||||
return String.valueOf(val);
|
||||
}
|
||||
}
|
||||
@@ -82,8 +82,8 @@ public class RTreeTest {
|
||||
|
||||
min[0] = 0;
|
||||
min[1] = 0;
|
||||
// max[0] = 4;
|
||||
// max[1] = 4;
|
||||
// max[0] = 4;
|
||||
// max[1] = 4;
|
||||
|
||||
final ArrayList<Item> results = new ArrayList<Item>();
|
||||
|
||||
@@ -146,14 +146,14 @@ public class RTreeTest {
|
||||
|
||||
assertEquals(results.size(), numItems);
|
||||
|
||||
// for (int i = 999; i >= 0; i--) {
|
||||
// Item it = results.remove(i);
|
||||
// boolean removed = t.remove(it.min, it.max, it);
|
||||
// //out.println("REMOVED: " + it + " " + removed);
|
||||
// for (int i = 999; i >= 0; i--) {
|
||||
// Item it = results.remove(i);
|
||||
// boolean removed = t.remove(it.min, it.max, it);
|
||||
// //out.println("REMOVED: " + it + " " + removed);
|
||||
//
|
||||
// Assert.assertEquals(i, t.count());
|
||||
// }
|
||||
// Assert.assertEquals(0, t.count());
|
||||
// Assert.assertEquals(i, t.count());
|
||||
// }
|
||||
// Assert.assertEquals(0, t.count());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -189,14 +189,14 @@ public class RTreeTest {
|
||||
|
||||
assertEquals(numItems, results.size());
|
||||
|
||||
// for (int i = 999; i >= 0; i--) {
|
||||
// Item it = results.remove(i);
|
||||
// boolean removed = t.remove(it.min, it.max, it);
|
||||
// //out.println("REMOVED: " + it + " " + removed);
|
||||
// for (int i = 999; i >= 0; i--) {
|
||||
// Item it = results.remove(i);
|
||||
// boolean removed = t.remove(it.min, it.max, it);
|
||||
// //out.println("REMOVED: " + it + " " + removed);
|
||||
//
|
||||
// Assert.assertEquals(i, t.count());
|
||||
// }
|
||||
// Assert.assertEquals(0, t.count());
|
||||
// Assert.assertEquals(i, t.count());
|
||||
// }
|
||||
// Assert.assertEquals(0, t.count());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -220,22 +220,22 @@ public class RTreeTest {
|
||||
|
||||
Assert.assertEquals(10000, t.size());
|
||||
|
||||
/*SearchCb<RTreeTest.Item> cb = new SearchCb<RTreeTest.Item>() {
|
||||
/*SearchCb<RTreeTest.Item> cb = new SearchCb<RTreeTest.Item>() {
|
||||
@Override
|
||||
public boolean call(Item item, Object context) {
|
||||
//out.println("found: " + item);
|
||||
//results.add(item);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
public boolean call(Item item, Object context) {
|
||||
//out.println("found: " + item);
|
||||
//results.add(item);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
int counter = 0;
|
||||
int counter = 0;
|
||||
|
||||
for (int i = 0; i < 10000; i++) {
|
||||
counter += t.search(min, max, cb, null);
|
||||
}
|
||||
for (int i = 0; i < 10000; i++) {
|
||||
counter += t.search(min, max, cb, null);
|
||||
}
|
||||
|
||||
System.out.println("found: " + counter);*/
|
||||
System.out.println("found: " + counter);*/
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -23,14 +23,14 @@ public class InlistTest {
|
||||
list.push(new Thing(4));
|
||||
list.push(new Thing(5));
|
||||
|
||||
/* iterate items */
|
||||
/* iterate items */
|
||||
int i = 5;
|
||||
for (Thing it : list)
|
||||
assertEquals(it.value, i--);
|
||||
|
||||
assertEquals(i, 0);
|
||||
|
||||
/* iterate with insertion order */
|
||||
/* iterate with insertion order */
|
||||
list.reverse();
|
||||
i = 1;
|
||||
for (Thing it : list)
|
||||
@@ -42,7 +42,7 @@ public class InlistTest {
|
||||
|
||||
List<Thing> list2 = new List<Thing>();
|
||||
|
||||
/* pop list and append to list2 */
|
||||
/* pop list and append to list2 */
|
||||
for (int j = 5; j > 0; j--) {
|
||||
Thing t = list.pop();
|
||||
assertEquals(t.value, j);
|
||||
@@ -51,7 +51,7 @@ public class InlistTest {
|
||||
list2.append(t);
|
||||
}
|
||||
|
||||
/* check nothing to iterate */
|
||||
/* check nothing to iterate */
|
||||
for (Thing t : list)
|
||||
assert (t == null && t != null);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class InlistTest {
|
||||
|
||||
list.push(new Thing(6));
|
||||
|
||||
/* move items from list2 to list */
|
||||
/* move items from list2 to list */
|
||||
list.appendList(list2.clear());
|
||||
|
||||
assertNull(list2.head());
|
||||
|
||||
Reference in New Issue
Block a user