Author: raffaeleguidi
Date: Thu Oct 27 19:11:47 2011
New Revision: 1189942

URL: http://svn.apache.org/viewvc?rev=1189942&view=rev
Log:
Closes DIRECTMEMORY-27 and fixes a lot of deprecation errors and unused import 
warnings. I think serialization performance has improved but I cannot get 
junit-benchmarks to produce graphs anymore (maybe @m_cucchiara could give it a 
look)

Modified:
    incubator/directmemory/trunk/directmemory-cache/bench.bat
    
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/Cache.java
    
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/CacheServiceImpl.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheConcurrentTests.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheLightConcurrentTest.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/TestCachePlusSerialization.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/BaseTests.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests2.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests3.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MallocTests.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MemoryManagerTests.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/preliminary/test/MicroBenchmarks.java
    
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/serialization/test/SerializerTest.java

Modified: incubator/directmemory/trunk/directmemory-cache/bench.bat
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/bench.bat?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- incubator/directmemory/trunk/directmemory-cache/bench.bat (original)
+++ incubator/directmemory/trunk/directmemory-cache/bench.bat Thu Oct 27 
19:11:47 2011
@@ -1 +1 @@
-mvn test -Dtest=SerializerTest -Djub.customkey=%1 
-Djub.consumers=CONSOLE,XML,H2 -Djub.db.file=data/benchmarks/database 
-Djub.xml.file=logs/benchmarks.xml -Djub.charts.dir=data/benchmarks/graphs
+mvn test -Dtest=SerializerTest -Djub.customkey=%1 
-Djub.consumers=CONSOLE,XML,H2 -Djub.db.file=data/benchmarks/database 
-Djub.xml.file=data/benchmarks/benchmarks.xml 
-Djub.charts.dir=data/benchmarks/graphs

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/Cache.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/Cache.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/Cache.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/Cache.java
 Thu Oct 27 19:11:47 2011
@@ -19,26 +19,16 @@ package org.apache.directmemory.cache;
  * under the License.
  */
 
-import java.io.EOFException;
-import java.io.IOException;
 import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.ConcurrentMap;
 
-import org.apache.directmemory.measures.Every;
-import org.apache.directmemory.measures.Ram;
 import org.apache.directmemory.memory.MemoryManager;
 import org.apache.directmemory.memory.MemoryManagerService;
 import org.apache.directmemory.memory.OffHeapMemoryBuffer;
 import org.apache.directmemory.memory.Pointer;
-import org.apache.directmemory.misc.Format;
-import org.apache.directmemory.serialization.ProtoStuffSerializerV1;
 import org.apache.directmemory.serialization.Serializer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.MapMaker;
-
 public class Cache {
 
        private static Logger logger = LoggerFactory.getLogger(Cache.class);

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/CacheServiceImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/CacheServiceImpl.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/CacheServiceImpl.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/cache/CacheServiceImpl.java
 Thu Oct 27 19:11:47 2011
@@ -24,7 +24,7 @@ import java.io.IOException;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.ConcurrentMap;
-import com.google.common.collect.MapMaker;
+
 import org.apache.directmemory.measures.Every;
 import org.apache.directmemory.measures.Ram;
 import org.apache.directmemory.memory.MemoryManagerService;
@@ -32,17 +32,19 @@ import org.apache.directmemory.memory.Me
 import org.apache.directmemory.memory.OffHeapMemoryBuffer;
 import org.apache.directmemory.memory.Pointer;
 import org.apache.directmemory.misc.Format;
-import org.apache.directmemory.serialization.ProtoStuffSerializerV1;
+import 
org.apache.directmemory.serialization.ProtoStuffWithLinkedBufferSerializer;
 import org.apache.directmemory.serialization.Serializer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.MapMaker;
+
 public class CacheServiceImpl implements CacheService {
 
   private static Logger logger = 
LoggerFactory.getLogger(CacheServiceImpl.class);
   private ConcurrentMap<String, Pointer> map;
 
-  private Serializer serializer = new ProtoStuffSerializerV1();
+  private Serializer serializer = new ProtoStuffWithLinkedBufferSerializer();
   private MemoryManagerService memoryManager = new MemoryManagerServiceImpl();
 
   private final Timer timer = new Timer();

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheConcurrentTests.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheConcurrentTests.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheConcurrentTests.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheConcurrentTests.java
 Thu Oct 27 19:11:47 2011
@@ -29,14 +29,12 @@ import org.apache.directmemory.memory.Me
 import org.apache.directmemory.memory.Pointer;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
@@ -46,7 +44,7 @@ import com.carrotsearch.junitbenchmarks.
 @BenchmarkMethodChart()
 @BenchmarkHistoryChart(labelWith = LabelType.CUSTOM_KEY, maxRuns = 5)
 
-public class CacheConcurrentTests {
+public class CacheConcurrentTests extends AbstractBenchmark {
        
        private final static int entries = 100000;
        public static AtomicInteger count = new AtomicInteger();
@@ -193,10 +191,6 @@ public class CacheConcurrentTests {
 
        Random rndGen = new Random();
        
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
-
-
        private static Logger logger = 
LoggerFactory.getLogger(CacheConcurrentTests.class);
 
        @BeforeClass

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheLightConcurrentTest.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheLightConcurrentTest.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheLightConcurrentTest.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/CacheLightConcurrentTest.java
 Thu Oct 27 19:11:47 2011
@@ -32,14 +32,12 @@ import org.josql.QueryExecutionException
 import org.josql.QueryParseException;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
@@ -49,7 +47,7 @@ import com.carrotsearch.junitbenchmarks.
 @BenchmarkMethodChart()
 @BenchmarkHistoryChart(labelWith = LabelType.CUSTOM_KEY, maxRuns = 5)
 
-public class CacheLightConcurrentTest {
+public class CacheLightConcurrentTest extends AbstractBenchmark {
        
        private final static int entries = 10000;
        public static AtomicInteger count = new AtomicInteger();
@@ -202,10 +200,6 @@ public class CacheLightConcurrentTest {
 
        Random rndGen = new Random();
        
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
-
-
        private static Logger logger = 
LoggerFactory.getLogger(CacheLightConcurrentTest.class);
 
        @BeforeClass

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/TestCachePlusSerialization.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/TestCachePlusSerialization.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/TestCachePlusSerialization.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/cache/test/TestCachePlusSerialization.java
 Thu Oct 27 19:11:47 2011
@@ -19,7 +19,7 @@ package org.apache.directmemory.cache.te
  * under the License.
  */
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import java.util.Random;
 
@@ -29,19 +29,15 @@ import org.apache.directmemory.measures.
 import org.apache.directmemory.misc.DummyPojo;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 
 
-public class TestCachePlusSerialization {
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
+public class TestCachePlusSerialization  extends AbstractBenchmark {
 
        private static Logger logger = 
LoggerFactory.getLogger(TestCachePlusSerialization.class);
        

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/BaseTests.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/BaseTests.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/BaseTests.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/BaseTests.java
 Thu Oct 27 19:11:47 2011
@@ -34,18 +34,14 @@ import org.apache.directmemory.memory.Po
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.google.common.collect.Maps;
 
-public class BaseTests {
-//     @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
-       
+public class BaseTests extends AbstractBenchmark{
        @Test
        public void smokeTest() {
                OffHeapMemoryBuffer mem = OffHeapMemoryBuffer.createNew(1 * 
1024 * 1024);

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests.java
 Thu Oct 27 19:11:47 2011
@@ -28,14 +28,12 @@ import org.apache.directmemory.memory.Of
 import org.apache.directmemory.memory.Pointer;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
@@ -46,7 +44,7 @@ import com.google.common.collect.MapMake
 @BenchmarkMethodChart()
 @BenchmarkHistoryChart(labelWith = LabelType.CUSTOM_KEY, maxRuns = 5)
 
-public class ConcurrentTests {
+public class ConcurrentTests extends AbstractBenchmark {
        
        private final static int entries = 100000;
        public static AtomicInteger count = new AtomicInteger();
@@ -166,10 +164,6 @@ public class ConcurrentTests {
        }
 
        Random rndGen = new Random();
-       
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
-
 
        private static Logger logger = 
LoggerFactory.getLogger(ConcurrentTests.class);
 

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests2.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests2.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests2.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests2.java
 Thu Oct 27 19:11:47 2011
@@ -29,14 +29,12 @@ import org.apache.directmemory.memory.Of
 import org.apache.directmemory.memory.Pointer;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
@@ -47,7 +45,7 @@ import com.google.common.collect.MapMake
 @BenchmarkMethodChart()
 @BenchmarkHistoryChart(labelWith = LabelType.CUSTOM_KEY, maxRuns = 5)
 
-public class ConcurrentTests2 {
+public class ConcurrentTests2 extends AbstractBenchmark {
        
        private final static int entries = 100000;
        public static AtomicInteger count = new AtomicInteger();
@@ -167,10 +165,6 @@ public class ConcurrentTests2 {
 
        Random rndGen = new Random();
        
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
-
-
        private static Logger logger = 
LoggerFactory.getLogger(ConcurrentTests2.class);
 
        private static void dump(OffHeapMemoryBuffer mem) {

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests3.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests3.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests3.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/ConcurrentTests3.java
 Thu Oct 27 19:11:47 2011
@@ -29,14 +29,11 @@ import org.apache.directmemory.memory.Of
 import org.apache.directmemory.memory.Pointer;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
@@ -198,10 +195,6 @@ public class ConcurrentTests3 {
 
        Random rndGen = new Random();
        
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
-
-
        private static Logger logger = 
LoggerFactory.getLogger(ConcurrentTests3.class);
 
        private static void dump(OffHeapMemoryBuffer mem) {

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MallocTests.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MallocTests.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MallocTests.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MallocTests.java
 Thu Oct 27 19:11:47 2011
@@ -36,6 +36,7 @@ import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
 import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
@@ -49,11 +50,8 @@ import com.google.common.collect.MapMake
 @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 0)
 @BenchmarkHistoryChart(labelWith = LabelType.CUSTOM_KEY, maxRuns = 5)
 
-public class MallocTests {
+public class MallocTests extends AbstractBenchmark {
        
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
-
        Random rnd = new Random();
 
        private static Logger logger = 
LoggerFactory.getLogger(MallocTests.class);

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MemoryManagerTests.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MemoryManagerTests.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MemoryManagerTests.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/memory/test/MemoryManagerTests.java
 Thu Oct 27 19:11:47 2011
@@ -31,16 +31,13 @@ import org.apache.directmemory.memory.Of
 import org.apache.directmemory.memory.Pointer;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.google.common.collect.Maps;
 
-public class MemoryManagerTests {
-//     @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
+public class MemoryManagerTests extends AbstractBenchmark {
        
        
        @BeforeClass

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/preliminary/test/MicroBenchmarks.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/preliminary/test/MicroBenchmarks.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/preliminary/test/MicroBenchmarks.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/preliminary/test/MicroBenchmarks.java
 Thu Oct 27 19:11:47 2011
@@ -25,14 +25,12 @@ import java.util.concurrent.ConcurrentMa
 
 import org.apache.directmemory.measures.Ram;
 import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
@@ -45,13 +43,8 @@ import com.google.common.collect.Maps;
 @BenchmarkOptions(benchmarkRounds = 1, warmupRounds = 0)
 @BenchmarkHistoryChart(labelWith = LabelType.CUSTOM_KEY, maxRuns = 5)
 
-public class MicroBenchmarks {
+public class MicroBenchmarks extends AbstractBenchmark {
        
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
-
-
-
        private static Logger logger = 
LoggerFactory.getLogger(MicroBenchmarks.class);
 
 

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/serialization/test/SerializerTest.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/serialization/test/SerializerTest.java?rev=1189942&r1=1189941&r2=1189942&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/serialization/test/SerializerTest.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/test/java/org/apache/directmemory/serialization/test/SerializerTest.java
 Thu Oct 27 19:11:47 2011
@@ -32,14 +32,12 @@ import org.apache.directmemory.serializa
 import 
org.apache.directmemory.serialization.ProtoStuffWithLinkedBufferSerializer;
 import org.apache.directmemory.serialization.Serializer;
 import org.apache.directmemory.serialization.StandardSerializer;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.MethodRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
 import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
-import com.carrotsearch.junitbenchmarks.BenchmarkRule;
 import com.carrotsearch.junitbenchmarks.annotation.AxisRange;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkHistoryChart;
 import com.carrotsearch.junitbenchmarks.annotation.BenchmarkMethodChart;
@@ -50,10 +48,7 @@ import com.carrotsearch.junitbenchmarks.
 @BenchmarkHistoryChart(labelWith = LabelType.CUSTOM_KEY, maxRuns = 5)
        @BenchmarkOptions(benchmarkRounds = 2, warmupRounds=1, concurrency=1)
 
-public class SerializerTest {
-
-       @Rule
-       public MethodRule benchmarkRun = new BenchmarkRule();
+public class SerializerTest extends AbstractBenchmark {
 
        private static Logger 
logger=LoggerFactory.getLogger(SerializerTest.class);
        private void testSerializer(String name, Serializer serializer, int 
size, int howMany) throws IOException, ClassNotFoundException, 
InstantiationException, IllegalAccessException {


Reply via email to