diff options
| -rw-r--r-- | .travis.yml | 9 | ||||
| -rw-r--r-- | core/pom.xml | 18 | ||||
| -rw-r--r-- | core/src/test/java/com/google/instrumentation/stats/ViewTest.java | 2 | ||||
| -rw-r--r-- | core/src/test/java/com/google/instrumentation/trace/SamplersTest.java | 8 | ||||
| -rw-r--r-- | core/src/test/java/com/google/instrumentation/trace/SpanBuilderTest.java | 2 | ||||
| -rw-r--r-- | core/src/test/java/com/google/instrumentation/trace/StartSpanOptionsTest.java | 4 | ||||
| -rw-r--r-- | core_impl/pom.xml | 7 | ||||
| -rw-r--r-- | pom.xml | 40 |
8 files changed, 78 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml index 060cf093..87988f8b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,6 +55,8 @@ install: # TODO(bdrutu): Find a way to enable try. We use try-with-resources without # using the local variable. + +# We skip building the tests with Java 6, because they use try-with-resources. script: - case "$BUILD" in "BAZEL") @@ -63,7 +65,12 @@ script: case "$TRAVIS_JDK_VERSION" in "oraclejdk8") mvn verify -P dev -Dguava.version=$GUAVA_VERSION ;; - *) + "oraclejdk7") mvn verify -Dguava.version=$GUAVA_VERSION ;; + "openjdk6") + mvn verify -Dmaven.test.skip -Dguava.version=$GUAVA_VERSION ;; + *) + echo "Missing case $TRAVIS_JDK_VERSION" ; + exit 1 ;; esac esac diff --git a/core/pom.xml b/core/pom.xml index 9d286cef..655e4118 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -23,6 +23,22 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> + <executions> + <execution> + <id>default-testCompile</id> + <phase>test-compile</phase> + <goals> + <goal>testCompile</goal> + </goals> + <configuration> + <!-- + Don't build the tests, because they currently create a circular + dependency between the 'core' and 'core_impl' directories. + --> + <skip>true</skip> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -62,4 +78,4 @@ </build> </profile> </profiles> -</project>
\ No newline at end of file +</project> diff --git a/core/src/test/java/com/google/instrumentation/stats/ViewTest.java b/core/src/test/java/com/google/instrumentation/stats/ViewTest.java index 5a057918..7a1dd483 100644 --- a/core/src/test/java/com/google/instrumentation/stats/ViewTest.java +++ b/core/src/test/java/com/google/instrumentation/stats/ViewTest.java @@ -47,7 +47,7 @@ public final class ViewTest { final DistributionViewDescriptor viewDescriptor = DistributionViewDescriptor.create( name, description, measurementDescriptor, aggregationDescriptor, tagKeys); - List<DistributionAggregation> aggregations = Arrays.asList( + final List<DistributionAggregation> aggregations = Arrays.asList( DistributionAggregation.create(5, 5.0, 15.0, Range.create(1.0, 5.0), tags1, Arrays.asList(1L, 1L, 1L, 1L, 1L)), DistributionAggregation.create(10, 5.0, 30.0, Range.create(1.0, 5.0), tags2, diff --git a/core/src/test/java/com/google/instrumentation/trace/SamplersTest.java b/core/src/test/java/com/google/instrumentation/trace/SamplersTest.java index d8b83667..954983b2 100644 --- a/core/src/test/java/com/google/instrumentation/trace/SamplersTest.java +++ b/core/src/test/java/com/google/instrumentation/trace/SamplersTest.java @@ -40,7 +40,7 @@ public class SamplersTest { traceId, spanId, "Another name", - Collections.emptyList())) + Collections.<Span>emptyList())) .isTrue(); // Untraced parent. assertThat( @@ -51,7 +51,7 @@ public class SamplersTest { traceId, spanId, "Yet another name", - Collections.emptyList())) + Collections.<Span>emptyList())) .isTrue(); } @@ -76,7 +76,7 @@ public class SamplersTest { traceId, spanId, "bar", - Collections.emptyList())) + Collections.<Span>emptyList())) .isFalse(); // Untraced parent. assertThat( @@ -87,7 +87,7 @@ public class SamplersTest { traceId, spanId, "quux", - Collections.emptyList())) + Collections.<Span>emptyList())) .isFalse(); } diff --git a/core/src/test/java/com/google/instrumentation/trace/SpanBuilderTest.java b/core/src/test/java/com/google/instrumentation/trace/SpanBuilderTest.java index 56679585..cce15c0e 100644 --- a/core/src/test/java/com/google/instrumentation/trace/SpanBuilderTest.java +++ b/core/src/test/java/com/google/instrumentation/trace/SpanBuilderTest.java @@ -116,7 +116,7 @@ public class SpanBuilderTest { @Test public void startRootSpanWithOptions() { - List<Span> parentList = Arrays.asList(BlankSpan.INSTANCE); + List<Span> parentList = Arrays.<Span>asList(BlankSpan.INSTANCE); StartSpanOptions startSpanOptions = new StartSpanOptions(); startSpanOptions.setParentLinks(parentList); startSpanOptions.setSampler(Samplers.neverSample()); diff --git a/core/src/test/java/com/google/instrumentation/trace/StartSpanOptionsTest.java b/core/src/test/java/com/google/instrumentation/trace/StartSpanOptionsTest.java index 314789a8..82278616 100644 --- a/core/src/test/java/com/google/instrumentation/trace/StartSpanOptionsTest.java +++ b/core/src/test/java/com/google/instrumentation/trace/StartSpanOptionsTest.java @@ -27,7 +27,7 @@ import org.junit.runners.JUnit4; /** Unit tests for {@link StartSpanOptions}. */ @RunWith(JUnit4.class) public class StartSpanOptionsTest { - private final List<Span> singleParentList = Arrays.asList(BlankSpan.INSTANCE); + private final List<Span> singleParentList = Arrays.<Span>asList(BlankSpan.INSTANCE); @Test public void defaultOptions() { @@ -81,7 +81,7 @@ public class StartSpanOptionsTest { @Test public void setParentLinks_MultipleParents() { StartSpanOptions options = new StartSpanOptions(); - options.setParentLinks(Arrays.asList(BlankSpan.INSTANCE, BlankSpan.INSTANCE)); + options.setParentLinks(Arrays.<Span>asList(BlankSpan.INSTANCE, BlankSpan.INSTANCE)); assertThat(options.getStartTime()).isNull(); assertThat(options.getSampler()).isNull(); assertThat(options.getParentLinks().size()).isEqualTo(2); diff --git a/core_impl/pom.xml b/core_impl/pom.xml index 83f4bda4..183cd842 100644 --- a/core_impl/pom.xml +++ b/core_impl/pom.xml @@ -34,6 +34,11 @@ <artifactId>shared</artifactId> <version>0.1.0-SNAPSHOT</version> </dependency> + <dependency> + <groupId>com.google.protobuf</groupId> + <artifactId>protobuf-java</artifactId> + <version>3.0.0</version> + </dependency> </dependencies> <build> @@ -80,4 +85,4 @@ </build> </profile> </profiles> -</project>
\ No newline at end of file +</project> @@ -64,7 +64,9 @@ <goal>testCompile</goal> </goals> <configuration> - <skip>true</skip> + <!-- Tests use try-with-resources --> + <source>1.7</source> + <target>1.7</target> </configuration> </execution> </executions> @@ -167,5 +169,41 @@ <artifactId>jsr305</artifactId> <version>3.0.0</version> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava-testlib</artifactId> + <version>${guava.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.google.truth</groupId> + <artifactId>truth</artifactId> + <version>0.30</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + <version>1.3</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-library</artifactId> + <version>1.3</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>1.9.5</version> + <scope>test</scope> + </dependency> </dependencies> </project> |
