Permalink
Browse files

Hold off on Java 7 until the JDK for Mac ships.

Otherwise it's a massive complication to use the beta JDK for pushing just this module.
  • Loading branch information...
1 parent d34357a commit a12c1fa82aa29dc697ab8ed935725422ab391376 @codahale codahale committed Oct 19, 2011
View
52 metrics-java7/pom.xml
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>com.yammer.metrics</groupId>
- <artifactId>metrics-parent</artifactId>
- <version>2.0.0-BETA18-SNAPSHOT</version>
- </parent>
-
- <groupId>com.yammer.metrics</groupId>
- <artifactId>metrics-java7</artifactId>
-
- <properties>
- <java7.home>/Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home</java7.home>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>com.yammer.metrics</groupId>
- <artifactId>metrics-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-all</artifactId>
- <version>1.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <verbose>true</verbose>
- <fork>true</fork>
- <source>1.7</source>
- <target>1.7</target>
- <encoding>UTF-8</encoding>
- <executable>${java7.home}/bin/javac</executable>
- <compilerVersion>1.7</compilerVersion>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
View
16 metrics-java7/src/main/java/com/yammer/metrics/core/Timer.java
@@ -1,16 +0,0 @@
-package com.yammer.metrics.core;
-
-public class Timer extends TimerContext implements AutoCloseable {
- public static Timer time(TimerMetric timer) {
- return new Timer(timer);
- }
-
- public Timer(TimerMetric timer) {
- super(timer);
- }
-
- @Override
- public void close() {
- stop();
- }
-}
View
41 metrics-java7/src/test/java/com/yammer/metrics/core/tests/TimerTest.java
@@ -1,41 +0,0 @@
-package com.yammer.metrics.core.tests;
-
-import com.yammer.metrics.core.MetricsRegistry;
-import com.yammer.metrics.core.Timer;
-import com.yammer.metrics.core.TimerMetric;
-import org.junit.After;
-import org.junit.Test;
-
-import java.util.concurrent.TimeUnit;
-
-import static org.hamcrest.Matchers.closeTo;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-public class TimerTest {
- private final MetricsRegistry registry = new MetricsRegistry();
- private final TimerMetric timer = registry.newTimer(TimerTest.class,
- "example",
- TimeUnit.MILLISECONDS,
- TimeUnit.SECONDS);
-
- @After
- public void tearDown() throws Exception {
- registry.threadPools().shutdownThreadPools();
- }
-
- @Test
- public void timesAnExecutionContext() throws Exception {
- try (@SuppressWarnings("unused") Timer t = Timer.time(timer)) {
- Thread.sleep(100);
- }
-
- assertThat("the timer is updated",
- timer.count(),
- is(1L));
-
- assertThat("the context is timed",
- timer.min(),
- is(closeTo(100, 1)));
- }
-}
View
1 pom.xml
@@ -14,7 +14,6 @@
<module>metrics-ehcache</module>
<module>metrics-graphite</module>
<module>metrics-guice</module>
- <module>metrics-java7</module>
<module>metrics-jetty</module>
<module>metrics-log4j</module>
<module>metrics-logback</module>

0 comments on commit a12c1fa

Please sign in to comment.