use of com.b2international.snowowl.core.attachments.Attachment in project snow-owl by b2ihealthcare.
the class SnomedContentRule method before.
@Override
protected void before() throws Throwable {
createCodeSystemIfNotExist();
Attachment attachment = Attachment.upload(Services.context(), importArchive);
String jobId = SnomedRequests.rf2().prepareImport().setRf2Archive(attachment).setReleaseType(contentType).setCreateVersions(true).setImportUntil(importUntil).build(codeSystemId).runAsJobWithRestart(SnomedRf2Requests.importJobKey(codeSystemId), "Importing RF2 content into " + codeSystemId).execute(Services.bus()).getSync(1, TimeUnit.MINUTES);
RemoteJobEntry job = JobRequests.waitForJob(Services.bus(), jobId, 2000);
assertTrue("Failed to import RF2 archive", job.isSuccessful());
}
use of com.b2international.snowowl.core.attachments.Attachment in project snow-owl by b2ihealthcare.
the class SnomedImportRowValidatorTest method importArchive.
private ImportResponse importArchive(String archiveFilePath, Rf2ReleaseType releaseType) throws FileNotFoundException {
final String codeSystemId = branchPath.lastSegment();
try {
CodeSystemRequests.prepareGetCodeSystem(codeSystemId).buildAsync().execute(getBus()).getSync(1L, TimeUnit.MINUTES);
} catch (NotFoundException e) {
CodeSystemRequests.prepareNewCodeSystem().setBranchPath(branchPath.getPath()).setId(codeSystemId).setToolingId(SnomedTerminologyComponentConstants.TOOLING_ID).setUrl(SnomedTerminologyComponentConstants.SNOMED_URI_SCT + "/" + codeSystemId).setTitle(codeSystemId).build("info@b2international.com", "Created new code system " + codeSystemId).execute(getBus()).getSync(1L, TimeUnit.MINUTES);
}
Attachment attachment = Attachment.upload(Services.context(), PlatformUtil.toAbsolutePath(this.getClass(), archiveFilePath));
return SnomedRequests.rf2().prepareImport().setCreateVersions(false).setReleaseType(releaseType).setRf2Archive(attachment).build(branchPath.getPath()).execute(getBus()).getSync();
}
Aggregations