Search in sources :

Example 6 with FindViewTopComponent

use of au.gov.asd.tac.constellation.views.find2.FindViewTopComponent in project constellation by constellation-app.

the class FindViewControllerNGTest method testGetCurrentBasicFindParameters.

/**
 * Test of getCurrentBasicFindParameters method, of class
 * FindViewController.
 */
@Test
public void testGetCurrentBasicFindParameters() {
    System.out.println("getCurrentBasicFindParameters");
    final FindViewTopComponent findViewTopComponent = mock(FindViewTopComponent.class);
    FindViewController instance = FindViewController.getDefault().init(findViewTopComponent);
    /**
     * Check getting getCurrentBasicReplaceParamters returns the default
     * parameters
     */
    BasicFindReplaceParameters defaultParameters = new BasicFindReplaceParameters();
    instance.updateBasicFindParameters(defaultParameters);
    assertEquals(instance.getCurrentBasicFindParameters(), defaultParameters);
    /**
     * Check getting getCurrentBasicReplaceParamters returns the matching
     * parameters of what it was set to
     */
    instance.updateBasicFindParameters(parameters);
    assertEquals(instance.getCurrentBasicFindParameters(), parameters);
}
Also used : BasicFindReplaceParameters(au.gov.asd.tac.constellation.views.find2.utilities.BasicFindReplaceParameters) Test(org.testng.annotations.Test)

Example 7 with FindViewTopComponent

use of au.gov.asd.tac.constellation.views.find2.FindViewTopComponent in project constellation by constellation-app.

the class FindViewControllerNGTest method testGetCurrentBasicReplaceParameters.

/**
 * Test of getCurrentBasicReplaceParameters method, of class
 * FindViewController.
 */
@Test
public void testGetCurrentBasicReplaceParameters() {
    System.out.println("getCurrentBasicReplaceParameters");
    final FindViewTopComponent findViewTopComponent = mock(FindViewTopComponent.class);
    FindViewController instance = FindViewController.getDefault().init(findViewTopComponent);
    // Check getting getCurrentBasicReplaceParamters returns the default
    // when it has not been set
    BasicFindReplaceParameters defaultParameters = new BasicFindReplaceParameters();
    instance.updateBasicReplaceParameters(defaultParameters);
    assertEquals(instance.getCurrentBasicReplaceParameters(), defaultParameters);
    // Check getting getCurrentBasicReplaceParamters returns the parameters it has been set to
    // it has been set to when it has not been set
    instance.updateBasicReplaceParameters(parameters2);
    assertEquals(instance.getCurrentBasicReplaceParameters(), parameters2);
}
Also used : BasicFindReplaceParameters(au.gov.asd.tac.constellation.views.find2.utilities.BasicFindReplaceParameters) Test(org.testng.annotations.Test)

Example 8 with FindViewTopComponent

use of au.gov.asd.tac.constellation.views.find2.FindViewTopComponent in project constellation by constellation-app.

the class ColourCriteriaPanelNGTest method setUpMethod.

@BeforeMethod
public void setUpMethod() throws Exception {
    findViewTopComponent = mock(FindViewTopComponent.class);
    spyTopComponent = spy(findViewTopComponent);
    findViewPane = mock(FindViewPane.class);
    findViewTabs = mock(FindViewTabs.class);
    FindViewController.getDefault();
    basicFindTab = mock(BasicFindTab.class);
    replaceTab = mock(ReplaceTab.class);
    when(findViewTabs.getParentComponent()).thenReturn(findViewPane);
    when(findViewPane.getTabs()).thenReturn(findViewTabs);
    when(findViewTabs.getBasicFindTab()).thenReturn(basicFindTab);
    when(findViewTabs.getReplaceTab()).thenReturn(replaceTab);
    when(findViewTabs.getAdvancedFindTab()).thenReturn(advancedTab);
    advancedTab = new AdvancedFindTab(findViewTabs);
}
Also used : ReplaceTab(au.gov.asd.tac.constellation.views.find2.components.ReplaceTab) AdvancedFindTab(au.gov.asd.tac.constellation.views.find2.components.AdvancedFindTab) FindViewTabs(au.gov.asd.tac.constellation.views.find2.components.FindViewTabs) BasicFindTab(au.gov.asd.tac.constellation.views.find2.components.BasicFindTab) FindViewTopComponent(au.gov.asd.tac.constellation.views.find2.FindViewTopComponent) FindViewPane(au.gov.asd.tac.constellation.views.find2.components.FindViewPane) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

FindViewTopComponent (au.gov.asd.tac.constellation.views.find2.FindViewTopComponent)6 AdvancedFindTab (au.gov.asd.tac.constellation.views.find2.components.AdvancedFindTab)4 BasicFindTab (au.gov.asd.tac.constellation.views.find2.components.BasicFindTab)4 FindViewPane (au.gov.asd.tac.constellation.views.find2.components.FindViewPane)4 FindViewTabs (au.gov.asd.tac.constellation.views.find2.components.FindViewTabs)4 ReplaceTab (au.gov.asd.tac.constellation.views.find2.components.ReplaceTab)4 BeforeMethod (org.testng.annotations.BeforeMethod)4 Attribute (au.gov.asd.tac.constellation.graph.Attribute)2 GraphAttribute (au.gov.asd.tac.constellation.graph.GraphAttribute)2 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)2 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)2 GraphManager (au.gov.asd.tac.constellation.graph.manager.GraphManager)2 FindViewController (au.gov.asd.tac.constellation.views.find2.FindViewController)2 BasicFindReplaceParameters (au.gov.asd.tac.constellation.views.find2.utilities.BasicFindReplaceParameters)2 ArrayList (java.util.ArrayList)2 Test (org.testng.annotations.Test)2