Java 11 migrate all remaining s (#1120)
* Moves saga to Java 11 * Moves semaphore to Java 11 * Moves servant to Java 11 * Moves serverless to Java 11 * Moves service-layer to Java 11 * Moves service-locator to Java 11 * Moves sharding to Java 11 * Moves singleton to Java 11 * Moves spatial-partition to Java 11 * Moves specification to Java 11 * Moves state to Java 11 * Moves step-builder to Java 11 * Moves strategy to Java 11 * Moves subclass-sandbox to Java 11 * Fixes checkstyle issues
This commit is contained in:
committed by
Ilkka Seppälä
parent
310ae50248
commit
cd2a2e7711
saga/src
main
java
test
java
com
iluwatar
saga
choreography
orchestration
semaphore/src
main
java
com
iluwatar
test
java
com
iluwatar
servant/src
main
java
com
iluwatar
servant
test
java
com
iluwatar
serverless/src
main
java
test
java
com
iluwatar
serverless
service-layer/src
main
java
com
iluwatar
servicelayer
app
common
hibernate
spell
spellbook
wizard
test
java
com
iluwatar
servicelayer
app
common
magic
spell
spellbook
wizard
service-locator/src
main
java
com
iluwatar
servicelocator
test
java
com
iluwatar
servicelocator
sharding/src
main
java
com
iluwatar
test
java
com
singleton
spatial-partition
specification
state/src/test/java/com/iluwatar/state
step-builder/src
main
java
com
iluwatar
test
java
com
iluwatar
stepbuilder
strategy/src/test/java/com/iluwatar/strategy
subclass-sandbox/src/test/java/com/iluwatar/subclasssandbox
@ -23,7 +23,9 @@
|
||||
|
||||
package com.iluwatar.spatialpartition;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
import java.util.Hashtable;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -35,24 +37,27 @@ class SpatialPartitionBubblesTest {
|
||||
|
||||
@Test
|
||||
void handleCollisionsUsingQtTest() {
|
||||
Bubble b1 = new Bubble(10,10,1,3);
|
||||
Bubble b2 = new Bubble(5,5,2,1);
|
||||
Bubble b3 = new Bubble(9,9,3,1);
|
||||
Bubble b4 = new Bubble(8,8,4,2);
|
||||
Hashtable<Integer, Bubble> bubbles = new Hashtable<Integer, Bubble>();
|
||||
bubbles.put(1, b1);
|
||||
bubbles.put(2, b2);
|
||||
bubbles.put(3, b3);
|
||||
var b1 = new Bubble(10, 10, 1, 3);
|
||||
var b2 = new Bubble(5, 5, 2, 1);
|
||||
var b3 = new Bubble(9, 9, 3, 1);
|
||||
var b4 = new Bubble(8, 8, 4, 2);
|
||||
var bubbles = new Hashtable<Integer, Bubble>();
|
||||
bubbles.put(1, b1);
|
||||
bubbles.put(2, b2);
|
||||
bubbles.put(3, b3);
|
||||
bubbles.put(4, b4);
|
||||
Rect r = new Rect(10,10,20,20);
|
||||
QuadTree qt = new QuadTree(r,4);
|
||||
qt.insert(b1);
|
||||
qt.insert(b2);
|
||||
qt.insert(b3);
|
||||
var r = new Rect(10, 10, 20, 20);
|
||||
var qt = new QuadTree(r, 4);
|
||||
qt.insert(b1);
|
||||
qt.insert(b2);
|
||||
qt.insert(b3);
|
||||
qt.insert(b4);
|
||||
SpatialPartitionBubbles sp = new SpatialPartitionBubbles(bubbles, qt);
|
||||
var sp = new SpatialPartitionBubbles(bubbles, qt);
|
||||
sp.handleCollisionsUsingQt(b1);
|
||||
//b1 touches b3 and b4 but not b2 - so b1,b3,b4 get popped
|
||||
assertTrue(bubbles.get(1) == null && bubbles.get(2) != null && bubbles.get(3) == null && bubbles.get(4) == null);
|
||||
assertNull(bubbles.get(1));
|
||||
assertNotNull(bubbles.get(2));
|
||||
assertNull(bubbles.get(3));
|
||||
assertNull(bubbles.get(4));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user