Search in sources :

Example 1 with SingletonBeanStoreRetrievalStrategy

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

the class AdminViewTest method setup.

@BeforeEach
void setup() throws IOException {
    UIScopeImpl.setBeanStoreRetrievalStrategy(new SingletonBeanStoreRetrievalStrategy());
    this.ui = beanFactory.getBean(AnnisUI.class);
    MockVaadin.setup(() -> ui);
    _click(_get(Button.class, spec -> spec.withCaption("Administration")));
}
Also used : WebAppConfiguration(org.springframework.test.context.web.WebAppConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach) AnnisUI(org.corpus_tools.annis.gui.AnnisUI) MigrationPanel(org.corpus_tools.annis.gui.admin.reflinks.MigrationPanel) Autowired(org.springframework.beans.factory.annotation.Autowired) IOException(java.io.IOException) ActiveProfiles(org.springframework.test.context.ActiveProfiles) LocatorJ._click(com.github.mvysny.kaributesting.v8.LocatorJ._click) NotThreadSafe(net.jcip.annotations.NotThreadSafe) ReferenceLinkEditor(org.corpus_tools.annis.gui.admin.reflinks.ReferenceLinkEditor) Test(org.junit.jupiter.api.Test) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) MockVaadin(com.github.mvysny.kaributesting.v8.MockVaadin) Button(com.vaadin.ui.Button) AfterEach(org.junit.jupiter.api.AfterEach) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) TabSheet(com.vaadin.ui.TabSheet) BeanFactory(org.springframework.beans.factory.BeanFactory) UIScopeImpl(com.vaadin.spring.internal.UIScopeImpl) LocatorJ._get(com.github.mvysny.kaributesting.v8.LocatorJ._get) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) Button(com.vaadin.ui.Button) AnnisUI(org.corpus_tools.annis.gui.AnnisUI) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with SingletonBeanStoreRetrievalStrategy

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

the class MigrationPanelTest method setup.

@BeforeEach
void setup() throws IOException {
    UIScopeImpl.setBeanStoreRetrievalStrategy(new SingletonBeanStoreRetrievalStrategy());
    this.ui = beanFactory.getBean(AnnisUI.class);
    this.legacyServer = new MockWebServer();
    this.legacyServer.start();
    MockVaadin.setup(() -> ui);
}
Also used : AnnisUI(org.corpus_tools.annis.gui.AnnisUI) MockWebServer(okhttp3.mockwebserver.MockWebServer) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with SingletonBeanStoreRetrievalStrategy

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

the class ReferenceLinkEditorTest method setup.

@BeforeEach
void setup() throws IOException {
    UIScopeImpl.setBeanStoreRetrievalStrategy(new SingletonBeanStoreRetrievalStrategy());
    this.ui = beanFactory.getBean(AnnisUI.class);
    MockVaadin.setup(() -> ui);
    _click(_get(Button.class, spec -> spec.withCaption("Administration")));
    TabSheet tab = _get(TabSheet.class);
    panel = _get(ReferenceLinkEditor.class);
    tab.setSelectedTab(panel);
    // Add some example entries
    ui.getUrlShortener().getRepo().deleteAll();
    UrlShortener urlShortener = this.ui.getUrlShortener();
    entry1 = new UrlShortenerEntry();
    entry1.setId(UUID.fromString("4366b0a5-6b27-40fe-ac5d-08e75c9eef51"));
    entry1.setUrl(URI.create("/test1"));
    urlShortener.getRepo().save(entry1);
    entry2 = new UrlShortenerEntry();
    entry2.setId(UUID.fromString("b1912b10-93f3-4018-84e8-6bf7572ee163"));
    entry2.setUrl(URI.create("/test2"));
    entry2.setTemporaryUrl(URI.create("/temp2"));
    urlShortener.getRepo().save(entry2);
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) TextField(com.vaadin.ui.TextField) Autowired(org.springframework.beans.factory.annotation.Autowired) ActiveProfiles(org.springframework.test.context.ActiveProfiles) SortDirection(com.vaadin.shared.data.sort.SortDirection) UrlShortener(org.corpus_tools.annis.gui.query_references.UrlShortener) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) MockVaadin(com.github.mvysny.kaributesting.v8.MockVaadin) UIScopeImpl(com.vaadin.spring.internal.UIScopeImpl) LocatorJ._get(com.github.mvysny.kaributesting.v8.LocatorJ._get) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) URI(java.net.URI) GridKt(com.github.mvysny.kaributesting.v8.GridKt) WebAppConfiguration(org.springframework.test.context.web.WebAppConfiguration) AnnisUI(org.corpus_tools.annis.gui.AnnisUI) IOException(java.io.IOException) LocatorJ._click(com.github.mvysny.kaributesting.v8.LocatorJ._click) UUID(java.util.UUID) LocatorJ._setValue(com.github.mvysny.kaributesting.v8.LocatorJ._setValue) NotThreadSafe(net.jcip.annotations.NotThreadSafe) Test(org.junit.jupiter.api.Test) Button(com.vaadin.ui.Button) AfterEach(org.junit.jupiter.api.AfterEach) UrlShortenerEntry(org.corpus_tools.annis.gui.query_references.UrlShortenerEntry) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) TabSheet(com.vaadin.ui.TabSheet) BeanFactory(org.springframework.beans.factory.BeanFactory) Grid(com.vaadin.ui.Grid) UrlShortener(org.corpus_tools.annis.gui.query_references.UrlShortener) Button(com.vaadin.ui.Button) AnnisUI(org.corpus_tools.annis.gui.AnnisUI) TabSheet(com.vaadin.ui.TabSheet) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) UrlShortenerEntry(org.corpus_tools.annis.gui.query_references.UrlShortenerEntry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with SingletonBeanStoreRetrievalStrategy

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

the class CSVExporterTest method setup.

@BeforeEach
void setup() {
    UIScopeImpl.setBeanStoreRetrievalStrategy(new SingletonBeanStoreRetrievalStrategy());
    this.ui = beanFactory.getBean(AnnisUI.class);
    MockVaadin.setup(() -> ui);
}
Also used : AnnisUI(org.corpus_tools.annis.gui.AnnisUI) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with SingletonBeanStoreRetrievalStrategy

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

the class TextColumnExporterTest method setup.

@BeforeEach
void setup() {
    UIScopeImpl.setBeanStoreRetrievalStrategy(new SingletonBeanStoreRetrievalStrategy());
    this.ui = beanFactory.getBean(AnnisUI.class);
    MockVaadin.setup(() -> ui);
}
Also used : AnnisUI(org.corpus_tools.annis.gui.AnnisUI) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AnnisUI (org.corpus_tools.annis.gui.AnnisUI)9 SingletonBeanStoreRetrievalStrategy (org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy)9 BeforeEach (org.junit.jupiter.api.BeforeEach)9 LocatorJ._click (com.github.mvysny.kaributesting.v8.LocatorJ._click)3 LocatorJ._get (com.github.mvysny.kaributesting.v8.LocatorJ._get)3 MockVaadin (com.github.mvysny.kaributesting.v8.MockVaadin)3 UIScopeImpl (com.vaadin.spring.internal.UIScopeImpl)3 Button (com.vaadin.ui.Button)3 AfterEach (org.junit.jupiter.api.AfterEach)3 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)3 Test (org.junit.jupiter.api.Test)3 BeanFactory (org.springframework.beans.factory.BeanFactory)3 Autowired (org.springframework.beans.factory.annotation.Autowired)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 ActiveProfiles (org.springframework.test.context.ActiveProfiles)3 TabSheet (com.vaadin.ui.TabSheet)2 IOException (java.io.IOException)2 NotThreadSafe (net.jcip.annotations.NotThreadSafe)2 WebAppConfiguration (org.springframework.test.context.web.WebAppConfiguration)2 GridKt (com.github.mvysny.kaributesting.v8.GridKt)1