use of org.opennms.features.topology.app.internal.DefaultLayout in project opennms by OpenNMS.
the class HierarchyLayoutAlgorithmTest method buildLayout.
private void buildLayout() {
// Mock ALL the things
final GraphContainer mockGraphContainer = Mockito.mock(GraphContainer.class);
layout = new DefaultLayout();
final TestGraph testGraph = new TestGraph(layout, vertices, edges);
Mockito.when(mockGraphContainer.getGraph()).thenReturn(testGraph);
// Update layouts and ensure no exception is thrown
new HierarchyLayoutAlgorithm().updateLayout(testGraph);
}
use of org.opennms.features.topology.app.internal.DefaultLayout in project opennms by OpenNMS.
the class BundleContextHistoryManagerTest method setUp.
@Before
public void setUp() {
if (new File(DATA_FILE_NAME).exists()) {
new File(DATA_FILE_NAME).delete();
}
serviceLocatorMock = Mockito.mock(ServiceLocator.class);
bundleContextMock = Mockito.mock(BundleContext.class);
graphContainerMock = Mockito.mock(GraphContainer.class);
;
graphMock = Mockito.mock(Graph.class);
startingSearchResults = new HashMap<>();
startingProviders = new HashMap<>();
startingCriteria = new HashMap<>();
this.capturedCriteria = new ArrayList<>();
displayableVertices = new ArrayList<>();
selectedLayout = new DefaultLayout();
historyManager = new BundleContextHistoryManager(bundleContextMock, serviceLocatorMock);
historyManager.onBind(new CircleLayoutOperation());
historyManager.onBind(new ManualLayoutOperation(null));
historyManager.onBind(new FRLayoutOperation());
historyManager.onBind(new SimpleLayoutOperation());
historyManager.onBind(new ISOMLayoutOperation());
historyManager.onBind(new SpringLayoutOperation());
historyManager.onBind(new RealUltimateLayoutOperation());
historyManager.onBind(new KKLayoutOperation());
historyManager.onBind(new AutoRefreshToggleOperation());
initProvidersAndCriteria();
setBehaviour(bundleContextMock);
setBehaviour(graphContainerMock);
setBehaviour(graphMock);
setBehaviour(serviceLocatorMock);
}
Aggregations