use of org.hl7.fhir.utilities.npm.CachingPackageClient in project org.hl7.fhir.core by hapifhir.
the class CachingPackageClientTests method testRegistry.
@Test
public void testRegistry() throws IOException {
CachingPackageClient client = new CachingPackageClient("http://packages.fhir.org/packages");
List<PackageInfo> matches1 = client.listFromRegistry(null, null, null);
List<PackageInfo> matches2 = client.listFromRegistry(null, null, "4.0.1");
Assertions.assertTrue(matches1.size() > matches2.size());
}
use of org.hl7.fhir.utilities.npm.CachingPackageClient in project org.hl7.fhir.core by hapifhir.
the class CachingPackageClientTests method testVersions.
@Test
public void testVersions() throws IOException {
CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER1);
List<PackageInfo> matches = client.getVersions("Simplifier.Core.STU3");
for (PackageInfo pi : matches) {
System.out.println(pi.toString());
}
Assertions.assertTrue(matches.size() > 0);
}
use of org.hl7.fhir.utilities.npm.CachingPackageClient in project org.hl7.fhir.core by hapifhir.
the class CachingPackageClientTests method testExists.
// private static final String SERVER2 = "http://local.fhir.org:8080/packages";
@Test
public void testExists() throws IOException {
CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER1);
Assertions.assertTrue(client.exists("hl7.fhir.r4.core", "4.0.1"));
Assertions.assertTrue(!client.exists("hl7.fhir.r4.core", "1.0.2"));
Assertions.assertTrue(client.exists("HL7.fhir.r4.core", "4.0.1"));
Assertions.assertTrue(!client.exists("hl7.fhir.nothing", "1.0.1"));
}
use of org.hl7.fhir.utilities.npm.CachingPackageClient in project org.hl7.fhir.core by hapifhir.
the class CachingPackageClientTests method testSearchNoMatches2.
@Test
public void testSearchNoMatches2() throws IOException {
CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER2);
List<PackageInfo> matches = client.search("corezxxx", null, null, false);
Assertions.assertTrue(matches.size() == 0);
}
use of org.hl7.fhir.utilities.npm.CachingPackageClient in project org.hl7.fhir.core by hapifhir.
the class CachingPackageClientTests method testExists2.
@Test
public void testExists2() throws IOException {
CachingPackageClient client = new CachingPackageClient(CachingPackageClientTests.SERVER2);
Assertions.assertTrue(client.exists("hl7.fhir.r4.core", "4.0.1"));
Assertions.assertTrue(!client.exists("hl7.fhir.r4.core", "1.0.2"));
Assertions.assertTrue(!client.exists("hl7.fhir.nothing", "1.0.1"));
Assertions.assertTrue(client.exists(CommonPackages.ID_PUBPACK, CommonPackages.VER_PUBPACK));
}
Aggregations