Search in sources :

Example 1 with QueryBuilderChooser

use of org.corpus_tools.annis.gui.querybuilder.QueryBuilderChooser in project ANNIS by korpling.

the class FlatQueryBuilderTest method setup.

@BeforeEach
public void setup() {
    UIScopeImpl.setBeanStoreRetrievalStrategy(new SingletonBeanStoreRetrievalStrategy());
    this.ui = beanFactory.getBean(AnnisUI.class);
    MockVaadin.setup(() -> this.ui);
    ui.getQueryState().setSelectedCorpora(Sets.newSet("pcc2"));
    // Click on the query builder button and select the flat query builder
    _click(_get(Button.class, spec -> spec.withCaption("Query<br />Builder")));
    ComboBox queryBuilderChooser = _get(_get(QueryBuilderChooser.class), ComboBox.class);
    queryBuilderChooser.select("Word sequences and meta information");
    this.queryBuilder = _get(FlatQueryBuilder.class);
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) MenuItem(com.vaadin.ui.MenuBar.MenuItem) CheckBox(com.vaadin.v7.ui.CheckBox) EdgeBox(org.corpus_tools.annis.gui.flatquerybuilder.EdgeBox) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) QueryBuilderChooser(org.corpus_tools.annis.gui.querybuilder.QueryBuilderChooser) Autowired(org.springframework.beans.factory.annotation.Autowired) FlatQueryBuilder(org.corpus_tools.annis.gui.flatquerybuilder.FlatQueryBuilder) ActiveProfiles(org.springframework.test.context.ActiveProfiles) LocatorJ._find(com.github.mvysny.kaributesting.v8.LocatorJ._find) ArrayList(java.util.ArrayList) SpanBox(org.corpus_tools.annis.gui.flatquerybuilder.SpanBox) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) MockVaadin(com.github.mvysny.kaributesting.v8.MockVaadin) Sets(org.mockito.internal.util.collections.Sets) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) UIScopeImpl(com.vaadin.spring.internal.UIScopeImpl) LocatorJ._get(com.github.mvysny.kaributesting.v8.LocatorJ._get) MetaBox(org.corpus_tools.annis.gui.flatquerybuilder.MetaBox) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) WebAppConfiguration(org.springframework.test.context.web.WebAppConfiguration) SearchBox(org.corpus_tools.annis.gui.flatquerybuilder.SearchBox) MenuBar(com.vaadin.ui.MenuBar) TextChangeEvent(com.vaadin.v7.event.FieldEvents.TextChangeEvent) AnnisUI(org.corpus_tools.annis.gui.AnnisUI) ComboBox(com.vaadin.v7.ui.ComboBox) Collection(java.util.Collection) LocatorJ._click(com.github.mvysny.kaributesting.v8.LocatorJ._click) Mockito.when(org.mockito.Mockito.when) ValueField(org.corpus_tools.annis.gui.flatquerybuilder.ValueField) SensitiveComboBox(org.corpus_tools.annis.gui.flatquerybuilder.SensitiveComboBox) Test(org.junit.jupiter.api.Test) Button(com.vaadin.ui.Button) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) VerticalNode(org.corpus_tools.annis.gui.flatquerybuilder.VerticalNode) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) BeanFactory(org.springframework.beans.factory.BeanFactory) Mockito.mock(org.mockito.Mockito.mock) QueryBuilderChooser(org.corpus_tools.annis.gui.querybuilder.QueryBuilderChooser) Button(com.vaadin.ui.Button) AnnisUI(org.corpus_tools.annis.gui.AnnisUI) ComboBox(com.vaadin.v7.ui.ComboBox) SensitiveComboBox(org.corpus_tools.annis.gui.flatquerybuilder.SensitiveComboBox) FlatQueryBuilder(org.corpus_tools.annis.gui.flatquerybuilder.FlatQueryBuilder) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

LocatorJ._click (com.github.mvysny.kaributesting.v8.LocatorJ._click)1 LocatorJ._find (com.github.mvysny.kaributesting.v8.LocatorJ._find)1 LocatorJ._get (com.github.mvysny.kaributesting.v8.LocatorJ._get)1 MockVaadin (com.github.mvysny.kaributesting.v8.MockVaadin)1 UIScopeImpl (com.vaadin.spring.internal.UIScopeImpl)1 Button (com.vaadin.ui.Button)1 MenuBar (com.vaadin.ui.MenuBar)1 MenuItem (com.vaadin.ui.MenuBar.MenuItem)1 TextChangeEvent (com.vaadin.v7.event.FieldEvents.TextChangeEvent)1 CheckBox (com.vaadin.v7.ui.CheckBox)1 ComboBox (com.vaadin.v7.ui.ComboBox)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 List (java.util.List)1 AnnisUI (org.corpus_tools.annis.gui.AnnisUI)1 SingletonBeanStoreRetrievalStrategy (org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy)1 EdgeBox (org.corpus_tools.annis.gui.flatquerybuilder.EdgeBox)1 FlatQueryBuilder (org.corpus_tools.annis.gui.flatquerybuilder.FlatQueryBuilder)1 MetaBox (org.corpus_tools.annis.gui.flatquerybuilder.MetaBox)1 SearchBox (org.corpus_tools.annis.gui.flatquerybuilder.SearchBox)1