use of io.github.vocabhunter.analysis.session.EnrichedSessionState in project VocabHunter by VocabHunter.
the class AnalysisSystemTest method setUpClass.
@BeforeClass
public static void setUpClass() throws Exception {
Analyser analyser = new SimpleAnalyser();
FileStreamer target = new FileStreamer(analyser);
URL resource = FileStreamerTest.class.getResource("/" + INPUT_DOCUMENT);
Path file = Paths.get(resource.toURI());
EnrichedSessionState enrichedSession = target.createNewSession(file);
SessionState sessionState = enrichedSession.getState();
words = sessionState.getOrderedUses();
}
use of io.github.vocabhunter.analysis.session.EnrichedSessionState in project VocabHunter by VocabHunter.
the class FileStreamerTest method testDifferentSession.
@Test
public void testDifferentSession() {
EnrichedSessionState state1 = createNewSession(FILE_TEXT);
EnrichedSessionState state2 = createNewSession(FILE_WORD);
assertNotEquals("Different session", state1, state2);
}
use of io.github.vocabhunter.analysis.session.EnrichedSessionState in project VocabHunter by VocabHunter.
the class FileStreamerTest method testEqualHashCode.
@Test
public void testEqualHashCode() {
EnrichedSessionState state1 = createNewSession(FILE_TEXT);
EnrichedSessionState state2 = createNewSession(FILE_TEXT);
assertEquals("Equal hash code session", state1.hashCode(), state2.hashCode());
}
use of io.github.vocabhunter.analysis.session.EnrichedSessionState in project VocabHunter by VocabHunter.
the class FileStreamerTest method testSessionToString.
@Test
public void testSessionToString() {
EnrichedSessionState state = createNewSession(FILE_TEXT);
assertTrue("Session toString", StringUtils.isNotBlank(state.toString()));
}
use of io.github.vocabhunter.analysis.session.EnrichedSessionState in project VocabHunter by VocabHunter.
the class GuiFileHandler method processNewSession.
private void processNewSession() {
Path file = checkUnsavedChangesAndChooseFile(FileDialogueType.NEW_SESSION);
if (file == null) {
statusManager.completeAction();
} else {
statusManager.performAction(file);
LOG.info("New session from '{}'", file);
GuiTask<EnrichedSessionState> task = new GuiTask<>(guiTaskHandler, statusManager, () -> sessionFileService.createNewSession(file), this::finishOpen, e -> FileErrorTool.open(file, e));
guiTaskHandler.executeInBackground(task);
}
}
Aggregations