use of au.gov.asd.tac.constellation.views.find2.components.AdvancedFindTab in project constellation by constellation-app.
the class FloatCriteriaPanelNGTest method testGetCriteriaValues.
/**
* Test of getCriteriaValues method, of class FloatCriteriaPanel.
*/
@Test
public void testGetCriteriaValues() {
System.out.println("getCriteriaValues");
setupGraph();
AdvancedFindTab parentComponent = spy(advancedTab);
final GraphElementType type = GraphElementType.VERTEX;
FloatCriteriaPanel floatCriteriaPanel = new FloatCriteriaPanel(parentComponent, "x", type);
floatCriteriaPanel.getFilterChoiceBox().getSelectionModel().select("Is Between");
floatCriteriaPanel.getSearchField().setText("22");
floatCriteriaPanel.getSearchFieldTwo().setText("44");
final List<AdvancedCriteriaBorderPane> tempList = new ArrayList<>();
final GridPane tempGrid = new GridPane();
tempList.add(floatCriteriaPanel);
tempGrid.add(tempList.get(0), 0, 0);
when(parentComponent.getCorrespondingCriteriaList(Mockito.eq(type))).thenReturn(tempList);
when(parentComponent.getCorrespondingGridPane(Mockito.eq(type))).thenReturn(tempGrid);
final List<AdvancedCriteriaBorderPane> criteriaList = parentComponent.getCorrespondingCriteriaList(type);
final FindCriteriaValues result = criteriaList.get(0).getCriteriaValues();
final FloatCriteriaValues floatResult = (FloatCriteriaValues) result;
assertEquals(floatResult.getAttribute(), "x");
assertEquals(floatResult.getAttributeType(), "float");
assertEquals(floatResult.getFilter(), "Is Between");
assertEquals(floatResult.getFloatValuePrimary(), 22f);
assertEquals(floatResult.getFloatValueSecondary(), 44f);
}
use of au.gov.asd.tac.constellation.views.find2.components.AdvancedFindTab in project constellation by constellation-app.
the class FloatCriteriaPanelNGTest method testGetType.
/**
* Test of getType method, of class FloatCriteriaPanel.
*/
@Test
public void testGetType() {
System.out.println("getType");
setupGraph();
AdvancedFindTab parentComponent = spy(advancedTab);
final GraphElementType type = GraphElementType.VERTEX;
FloatCriteriaPanel floatCriteriaPanel = new FloatCriteriaPanel(parentComponent, "x", type);
assertEquals(floatCriteriaPanel.getType(), FloatAttributeDescription.ATTRIBUTE_NAME);
}
use of au.gov.asd.tac.constellation.views.find2.components.AdvancedFindTab in project constellation by constellation-app.
the class FloatCriteriaPanelNGTest 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);
}
use of au.gov.asd.tac.constellation.views.find2.components.AdvancedFindTab in project constellation by constellation-app.
the class StringCriteriaPanelNGTest method testGetSearchFieldText.
/**
* Test of getSearchFieldText method, of class StringCriteriaPanel.
*/
@Test
public void testGetSearchFieldText() {
System.out.println("getSearchFieldText");
setupGraph();
AdvancedFindTab parentComponent = spy(advancedTab);
final GraphElementType type = GraphElementType.VERTEX;
StringCriteriaPanel stringCriteriaPanel = new StringCriteriaPanel(parentComponent, "Identifier", type);
stringCriteriaPanel.getFilterChoiceBox().getSelectionModel().select("Is");
stringCriteriaPanel.setSearchFieldText("test");
assertEquals(stringCriteriaPanel.getSearchFieldText(), "test");
}
use of au.gov.asd.tac.constellation.views.find2.components.AdvancedFindTab in project constellation by constellation-app.
the class StringCriteriaPanelNGTest method testGetType.
/**
* Test of getType method, of class StringCriteriaPanel.
*/
@Test
public void testGetType() {
System.out.println("getType");
setupGraph();
AdvancedFindTab parentComponent = spy(advancedTab);
final GraphElementType type = GraphElementType.VERTEX;
StringCriteriaPanel stringCriteriaPanel = new StringCriteriaPanel(parentComponent, "Identifier", type);
assertEquals(stringCriteriaPanel.getType(), StringAttributeDescription.ATTRIBUTE_NAME);
}
Aggregations