use of com.datastax.dse.driver.internal.core.insights.schema.InsightsPlatformInfo.RuntimeAndCompileTimeVersions in project java-driver by datastax.
the class PlatformInfoFinderTest method should_load_runtime_version_from_pom_properties_URL.
@Test
public void should_load_runtime_version_from_pom_properties_URL() {
// given
InputStream inputStream = this.getClass().getResourceAsStream("/insights/netty-dependency.txt");
Map<String, RuntimeAndCompileTimeVersions> expected = new LinkedHashMap<>();
expected.put("io.netty:netty-handler", new RuntimeAndCompileTimeVersions("4.0.56.Final", "4.0.0.Final", false));
// when
Map<String, RuntimeAndCompileTimeVersions> stringStringMap = new PlatformInfoFinder(this::nettyUrlProvider).fetchDependenciesFromFile(inputStream);
// then
assertThat(stringStringMap).isEqualTo(expected);
}
use of com.datastax.dse.driver.internal.core.insights.schema.InsightsPlatformInfo.RuntimeAndCompileTimeVersions in project java-driver by datastax.
the class PlatformInfoFinderTest method should_not_load_runtime_dependency_from_non_existing_pom_properties.
@Test
public void should_not_load_runtime_dependency_from_non_existing_pom_properties() {
// given
InputStream inputStream = this.getClass().getResourceAsStream("/insights/netty-dependency.txt");
Map<String, RuntimeAndCompileTimeVersions> expected = new LinkedHashMap<>();
expected.put("io.netty:netty-handler", withUnverifiedRuntimeVersion("4.0.0.Final"));
// when
Map<String, RuntimeAndCompileTimeVersions> stringStringMap = new PlatformInfoFinder(this::nonExistingUrlProvider).fetchDependenciesFromFile(inputStream);
// then
assertThat(stringStringMap).isEqualTo(expected);
}
use of com.datastax.dse.driver.internal.core.insights.schema.InsightsPlatformInfo.RuntimeAndCompileTimeVersions in project java-driver by datastax.
the class PlatformInfoFinderTest method should_load_runtime_version_of_optional_dependency_from_pom_properties_URL.
@Test
public void should_load_runtime_version_of_optional_dependency_from_pom_properties_URL() {
// given
InputStream inputStream = this.getClass().getResourceAsStream("/insights/netty-dependency-optional.txt");
Map<String, RuntimeAndCompileTimeVersions> expected = new LinkedHashMap<>();
expected.put("io.netty:netty-handler", new RuntimeAndCompileTimeVersions("4.0.56.Final", "4.0.0.Final", true));
// when
Map<String, RuntimeAndCompileTimeVersions> stringStringMap = new PlatformInfoFinder(this::nettyUrlProvider).fetchDependenciesFromFile(inputStream);
// then
assertThat(stringStringMap).isEqualTo(expected);
}
use of com.datastax.dse.driver.internal.core.insights.schema.InsightsPlatformInfo.RuntimeAndCompileTimeVersions in project java-driver by datastax.
the class PlatformInfoFinderTest method should_find_dependencies_from_file.
@Test
public void should_find_dependencies_from_file() {
// given
InputStream inputStream = this.getClass().getResourceAsStream("/insights/test-dependencies.txt");
Map<String, RuntimeAndCompileTimeVersions> expected = new HashMap<>();
expected.put("io.netty:netty-transport-native-epoll", withUnverifiedRuntimeVersionOptional("4.0.56.Final"));
expected.put("org.slf4j:slf4j-api", withUnverifiedRuntimeVersion("1.7.25"));
expected.put("org.ow2.asm:asm", withUnverifiedRuntimeVersion("5.0.3"));
expected.put("com.esri.geometry:esri-geometry-api", withUnverifiedRuntimeVersion("1.2.1"));
expected.put("io.netty:netty-transport", withUnverifiedRuntimeVersion("4.0.56.Final"));
expected.put("com.github.jnr:jnr-x86asm", withUnverifiedRuntimeVersion("1.0.2"));
expected.put("org.ow2.asm:asm-analysis", withUnverifiedRuntimeVersion("5.0.3"));
expected.put("com.github.jnr:jnr-constants", withUnverifiedRuntimeVersion("0.9.9"));
expected.put("io.netty:netty-common", withUnverifiedRuntimeVersion("4.0.56.Final"));
expected.put("com.google.guava:guava", withUnverifiedRuntimeVersion("19.0"));
expected.put("org.xerial.snappy:snappy-java", withUnverifiedRuntimeVersionOptional("1.1.2.6"));
expected.put("io.dropwizard.metrics:metrics-core", withUnverifiedRuntimeVersion("3.2.2"));
expected.put("org.ow2.asm:asm-tree", withUnverifiedRuntimeVersion("5.0.3"));
expected.put("com.github.jnr:jnr-posix", withUnverifiedRuntimeVersion("3.0.44"));
expected.put("org.codehaus.jackson:jackson-core-asl", withUnverifiedRuntimeVersion("1.9.12"));
expected.put("com.fasterxml.jackson.core:jackson-databind", withUnverifiedRuntimeVersion("2.7.9.3"));
expected.put("io.netty:netty-codec", withUnverifiedRuntimeVersion("4.0.56.Final"));
expected.put("com.fasterxml.jackson.core:jackson-annotations", withUnverifiedRuntimeVersion("2.8.11"));
expected.put("com.fasterxml.jackson.core:jackson-core", withUnverifiedRuntimeVersion("2.8.11"));
expected.put("io.netty:netty-handler", withUnverifiedRuntimeVersion("4.0.56.Final"));
expected.put("org.lz4:lz4-java", withUnverifiedRuntimeVersionOptional("1.4.1"));
expected.put("org.hdrhistogram:HdrHistogram", withUnverifiedRuntimeVersionOptional("2.1.10"));
expected.put("com.github.jnr:jffi", withUnverifiedRuntimeVersion("1.2.16"));
expected.put("io.netty:netty-buffer", withUnverifiedRuntimeVersion("4.0.56.Final"));
expected.put("org.ow2.asm:asm-commons", withUnverifiedRuntimeVersion("5.0.3"));
expected.put("org.json:json", withUnverifiedRuntimeVersion("20090211"));
expected.put("org.ow2.asm:asm-util", withUnverifiedRuntimeVersion("5.0.3"));
expected.put("com.github.jnr:jnr-ffi", withUnverifiedRuntimeVersion("2.1.7"));
// when
Map<String, RuntimeAndCompileTimeVersions> stringStringMap = new PlatformInfoFinder(this::nullUrlProvider).fetchDependenciesFromFile(inputStream);
// then
assertThat(stringStringMap).hasSize(28);
assertThat(stringStringMap).isEqualTo(expected);
}
Aggregations