-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding QuadtreeTest, it doesn't do much right now
- Loading branch information
1 parent
59ce37f
commit c1f265d
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...ology.app/src/test/java/org/opennms/features/topology/app/internal/jung/QuadTreeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/******************************************************************************* | ||
* This file is part of OpenNMS(R). | ||
* | ||
* Copyright (C) 2012 The OpenNMS Group, Inc. | ||
* OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc. | ||
* | ||
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. | ||
* | ||
* OpenNMS(R) is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, | ||
* or (at your option) any later version. | ||
* | ||
* OpenNMS(R) is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with OpenNMS(R). If not, see: | ||
* http://www.gnu.org/licenses/ | ||
* | ||
* For more information contact: | ||
* OpenNMS(R) Licensing <license@opennms.org> | ||
* http://www.opennms.org/ | ||
* http://www.opennms.com/ | ||
*******************************************************************************/ | ||
|
||
package org.opennms.features.topology.app.internal.jung; | ||
|
||
import org.junit.Test; | ||
import org.opennms.features.topology.api.Point; | ||
import org.opennms.features.topology.api.topo.Vertex; | ||
|
||
import java.awt.geom.Point2D; | ||
|
||
public class QuadTreeTest { | ||
|
||
@Test | ||
public void testQuadTree() { | ||
QuadTree<Integer, String> quadTree = new QuadTree<Integer, String>(); | ||
quadTree.insert(10, 10, "Vertex1"); | ||
quadTree.insert(10, 20, "Vertex2"); | ||
quadTree.insert((int)(Math.random() * 100), (int) (Math.random() * 100), "Vertex3"); | ||
quadTree.insert((int)(Math.random() * 100), (int) (Math.random() * 100), "Vertex4"); | ||
quadTree.insert((int)(Math.random() * 100), (int) (Math.random() * 100), "Vertex5"); | ||
quadTree.insert((int)(Math.random() * 100), (int) (Math.random() * 100), "Vertex6"); | ||
quadTree.insert((int)(Math.random() * 100), (int) (Math.random() * 100), "Vertex7"); | ||
quadTree.insert((int)(Math.random() * 100), (int) (Math.random() * 100), "Vertex8"); | ||
quadTree.insert((int)(Math.random() * 100), (int) (Math.random() * 100), "Vertex9"); | ||
|
||
|
||
} | ||
} |