@Override public Optional<Long> getCorrectionCasTimestamp(SourceDocument aDocument) throws IOException { Validate.notNull(aDocument, "Source document must be specified"); return casStorageService.getCasTimestamp(aDocument, CORRECTION_USER); } }
@Override public Optional<Long> getCorrectionCasTimestamp(SourceDocument aDocument) throws IOException { Validate.notNull(aDocument, "Source document must be specified"); return casStorageService.getCasTimestamp(aDocument, CORRECTION_USER); } }
@Override public Optional<Long> getCurationCasTimestamp(SourceDocument aDocument) throws IOException { Validate.notNull(aDocument, "Source document must be specified"); return casStorageService.getCasTimestamp(aDocument, CURATION_USER); } }
@Override public Optional<Long> getAnnotationCasTimestamp(SourceDocument aDocument, String aUsername) throws IOException { Validate.notNull(aDocument, "Source document must be specified"); Validate.notNull(aUsername, "Username must be specified"); return casStorageService.getCasTimestamp(aDocument, aUsername); }
@Override public Optional<Long> getAnnotationCasTimestamp(SourceDocument aDocument, String aUsername) throws IOException { Validate.notNull(aDocument, "Source document must be specified"); Validate.notNull(aUsername, "Username must be specified"); return casStorageService.getCasTimestamp(aDocument, aUsername); }
@Test public void testCasMetadataGetsCreated() throws Exception { List<TypeSystemDescription> typeSystems = new ArrayList<>(); typeSystems.add(createTypeSystemDescription()); typeSystems.add(CasMetadataUtils.getInternalTypeSystem()); JCas cas = JCasFactory.createJCas(mergeTypeSystems(typeSystems)); SourceDocument doc = makeSourceDocument(1l, 1l); String user = "test"; sut.writeCas(doc, cas, user); JCas cas2 = sut.readCas(doc, user); List<CASMetadata> cmds = new ArrayList<>(select(cas2, CASMetadata.class)); assertThat(cmds).hasSize(1); assertThat(cmds.get(0).getProjectId()).isEqualTo(doc.getProject().getId()); assertThat(cmds.get(0).getSourceDocumentId()).isEqualTo(doc.getId()); assertThat(cmds.get(0).getLastChangedOnDisk()) .isEqualTo(sut.getCasTimestamp(doc, user).get()); }