Search in sources :

Example 6 with BeforeEach

use of org.junit.jupiter.api.BeforeEach in project VocabHunter by VocabHunter.

the class SettingsManagerTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    files = new TestFileManager(getClass());
    Path settingsFile = files.addFile(SETTINGS_JSON);
    dummyPath = files.addFile("dummy");
    target = new SettingsManagerImpl(settingsFile);
}
Also used : Path(java.nio.file.Path) TestFileManager(io.github.vocabhunter.test.utils.TestFileManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 7 with BeforeEach

use of org.junit.jupiter.api.BeforeEach in project VocabHunter by VocabHunter.

the class FileToolTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    manager = new TestFileManager(getClass());
    base = manager.getDirectory();
    existingFile = manager.addFile("existingFile");
    Files.createFile(existingFile);
    newFile = manager.addFile("newFile");
    subDirectory = manager.addFile("directory");
    Files.createDirectories(subDirectory);
}
Also used : TestFileManager(io.github.vocabhunter.test.utils.TestFileManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 8 with BeforeEach

use of org.junit.jupiter.api.BeforeEach in project VocabHunter by VocabHunter.

the class SelectionExportToolTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    files = new TestFileManager(getClass());
    file = files.addFile("export.txt");
}
Also used : TestFileManager(io.github.vocabhunter.test.utils.TestFileManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 9 with BeforeEach

use of org.junit.jupiter.api.BeforeEach in project VocabHunter by VocabHunter.

the class SessionSerialiserTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    files = new TestFileManager(getClass());
    file = files.addFile("file.json");
}
Also used : TestFileManager(io.github.vocabhunter.test.utils.TestFileManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 10 with BeforeEach

use of org.junit.jupiter.api.BeforeEach in project java-design-patterns by iluwatar.

the class MessengerTest method setUp.

/**
 * Inject the mocked std-out {@link PrintStream} into the {@link System} class before each test
 */
@BeforeEach
public void setUp() {
    this.stdOutBuffer = new ByteArrayOutputStream();
    System.setOut(new PrintStream(stdOutBuffer));
}
Also used : PrintStream(java.io.PrintStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BeforeEach (org.junit.jupiter.api.BeforeEach)13 TestFileManager (io.github.vocabhunter.test.utils.TestFileManager)6 MongoClient (com.mongodb.MongoClient)3 Path (java.nio.file.Path)3 File (java.io.File)2 AfterEach (org.junit.jupiter.api.AfterEach)2 AbstractModule (com.google.inject.AbstractModule)1 Module (com.google.inject.Module)1 GuiTaskHandler (io.github.vocabhunter.analysis.core.GuiTaskHandler)1 FileListManager (io.github.vocabhunter.analysis.settings.FileListManager)1 FileListManagerImpl (io.github.vocabhunter.analysis.settings.FileListManagerImpl)1 Placement (io.github.vocabhunter.gui.common.Placement)1 FileDialogueFactory (io.github.vocabhunter.gui.dialogues.FileDialogueFactory)1 EnvironmentManager (io.github.vocabhunter.gui.services.EnvironmentManager)1 PlacementManager (io.github.vocabhunter.gui.services.PlacementManager)1 WebPageTool (io.github.vocabhunter.gui.services.WebPageTool)1 SettingsManager (io.github.vocabhunter.gui.settings.SettingsManager)1 SettingsManagerImpl (io.github.vocabhunter.gui.settings.SettingsManagerImpl)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1