Author: jbellis
Date: Fri Apr 16 16:44:47 2010
New Revision: 934992
URL: http://svn.apache.org/viewvc?rev=934992&view=rev
Log:
add long-test ant target for compaction speed test and larger bloom filter
tests [formerly commented out]. patch by Stu Hood; reviewed by Jeremy Hanna
for CASSANDRA-985
Added:
cassandra/trunk/test/long/
cassandra/trunk/test/long/org/
cassandra/trunk/test/long/org/apache/
cassandra/trunk/test/long/org/apache/cassandra/
cassandra/trunk/test/long/org/apache/cassandra/db/
cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java
- copied, changed from r934974,
cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionSpeedTest.java
cassandra/trunk/test/long/org/apache/cassandra/utils/
cassandra/trunk/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java
Removed:
cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionSpeedTest.java
Modified:
cassandra/trunk/build.xml
cassandra/trunk/test/unit/org/apache/cassandra/utils/BloomFilterTest.java
Modified: cassandra/trunk/build.xml
URL:
http://svn.apache.org/viewvc/cassandra/trunk/build.xml?rev=934992&r1=934991&r2=934992&view=diff
==============================================================================
--- cassandra/trunk/build.xml (original)
+++ cassandra/trunk/build.xml Fri Apr 16 16:44:47 2010
@@ -42,6 +42,7 @@
<property name="test.data" value="${test.dir}/data"/>
<property name="test.name" value="*Test"/>
<property name="test.unit.src" value="${test.dir}/unit"/>
+ <property name="test.long.src" value="${test.dir}/long"/>
<property name="dist.dir" value="${build.dir}/dist"/>
<property name="version" value="0.6.0-rc1"/>
<property name="final.name" value="${ant.project.name}-${version}"/>
@@ -348,10 +349,10 @@
<javac
debug="true"
debuglevel="${debuglevel}"
- destdir="${test.classes}"
- >
+ destdir="${test.classes}">
<classpath refid="cassandra.classpath"/>
<src path="${test.unit.src}"/>
+ <src path="${test.long.src}"/>
</javac>
<!-- Non-java resources needed by the test suite -->
@@ -360,30 +361,42 @@
</copy>
</target>
- <target name="test" depends="build-test">
- <echo message="running tests"/>
- <mkdir dir="${build.test.dir}/cassandra"/>
- <mkdir dir="${build.test.dir}/output"/>
- <junit fork="on" failureproperty="testfailed" maxmemory="1024m">
- <sysproperty key="net.sourceforge.cobertura.datafile"
file="${cobertura.datafile}"/>
- <formatter type="xml" usefile="true"/>
- <formatter type="brief" usefile="false"/>
- <jvmarg value="-Dstorage-config=${test.conf}"/>
- <jvmarg value="-Dlog4j.configuration=log4j-junit.properties" />
- <jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
- <jvmarg value="-ea"/>
- <classpath>
- <path refid="cassandra.classpath" />
- <pathelement location="${test.classes}"/>
- <pathelement location="${cobertura.dir}/cobertura.jar"/>
- <pathelement location="${test.conf}"/>
- </classpath>
- <batchtest todir="${build.test.dir}/output">
- <fileset dir="${test.classes}" includes="**/${test.name}.class" />
- </batchtest>
- </junit>
+ <macrodef name="testmacro">
+ <attribute name="suitename" />
+ <attribute name="inputdir" />
+ <attribute name="timeout" />
+ <sequential>
+ <echo message="running @{suitename} tests"/>
+ <mkdir dir="${build.test.dir}/cassandra"/>
+ <mkdir dir="${build.test.dir}/output"/>
+ <junit fork="on" failureproperty="testfailed" maxmemory="1024m"
timeout="@{timeout}">
+ <sysproperty key="net.sourceforge.cobertura.datafile"
file="${cobertura.datafile}"/>
+ <formatter type="xml" usefile="true"/>
+ <formatter type="brief" usefile="false"/>
+ <jvmarg value="-Dstorage-config=${test.conf}"/>
+ <jvmarg value="-Dlog4j.configuration=log4j-junit.properties" />
+ <jvmarg value="-Dlegacy-sstable-root=${test.data}/legacy-sstables"/>
+ <jvmarg value="-ea"/>
+ <classpath>
+ <path refid="cassandra.classpath" />
+ <pathelement location="${test.classes}"/>
+ <pathelement location="${cobertura.dir}/cobertura.jar"/>
+ <pathelement location="${test.conf}"/>
+ </classpath>
+ <batchtest todir="${build.test.dir}/output">
+ <fileset dir="@{inputdir}" includes="**/${test.name}.java" />
+ </batchtest>
+ </junit>
+ <fail if="testfailed" message="Some @{suitename} test(s) failed."/>
+ </sequential>
+ </macrodef>
+
+ <target name="test" depends="build-test">
+ <testmacro suitename="unit" inputdir="${test.unit.src}" timeout="30000" />
+ </target>
- <fail if="testfailed" message="Some test(s) failed."/>
+ <target name="long-test" depends="build-test">
+ <testmacro suitename="long" inputdir="${test.long.src}" timeout="300000" />
</target>
<!-- instruments the classes to later create code coverage reports -->
Copied:
cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java
(from r934974,
cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionSpeedTest.java)
URL:
http://svn.apache.org/viewvc/cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java?p2=cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java&p1=cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionSpeedTest.java&r1=934974&r2=934992&rev=934992&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/db/CompactionSpeedTest.java
(original)
+++
cassandra/trunk/test/long/org/apache/cassandra/db/LongCompactionSpeedTest.java
Fri Apr 16 16:44:47 2010
@@ -35,7 +35,7 @@ import org.apache.cassandra.db.filter.Qu
import org.apache.cassandra.utils.FBUtilities;
import static junit.framework.Assert.assertEquals;
-public class CompactionSpeedTest extends CleanupHelper
+public class LongCompactionSpeedTest extends CleanupHelper
{
public static final String TABLE1 = "Keyspace1";
public static final InetAddress LOCAL = FBUtilities.getLocalAddress();
Added:
cassandra/trunk/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java
URL:
http://svn.apache.org/viewvc/cassandra/trunk/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java?rev=934992&view=auto
==============================================================================
---
cassandra/trunk/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java
(added)
+++
cassandra/trunk/test/long/org/apache/cassandra/utils/LongBloomFilterTest.java
Fri Apr 16 16:44:47 2010
@@ -0,0 +1,62 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+package org.apache.cassandra.utils;
+
+import java.io.IOException;
+import java.util.Random;
+
+import org.junit.Test;
+
+public class LongBloomFilterTest
+{
+ public BloomFilter bf;
+
+ /**
+ * NB: needs to run with -mx1G
+ */
+ @Test
+ public void testBigInt() {
+ int size = 10 * 1000 * 1000;
+ bf = BloomFilter.getFilter(size, FilterTest.spec.bucketsPerElement);
+ FilterTest.testFalsePositives(bf,
+ new KeyGenerator.IntGenerator(size),
+ new KeyGenerator.IntGenerator(size, size
* 2));
+ }
+
+ @Test
+ public void testBigRandom() {
+ int size = 10 * 1000 * 1000;
+ bf = BloomFilter.getFilter(size, FilterTest.spec.bucketsPerElement);
+ FilterTest.testFalsePositives(bf,
+ new
KeyGenerator.RandomStringGenerator(new Random().nextInt(), size),
+ new
KeyGenerator.RandomStringGenerator(new Random().nextInt(), size));
+ }
+
+ @Test
+ public void timeit() {
+ int size = 300 * FilterTest.ELEMENTS;
+ bf = BloomFilter.getFilter(size, FilterTest.spec.bucketsPerElement);
+ for (int i = 0; i < 10; i++) {
+ FilterTest.testFalsePositives(bf,
+ new
KeyGenerator.RandomStringGenerator(new Random().nextInt(), size),
+ new
KeyGenerator.RandomStringGenerator(new Random().nextInt(), size));
+ bf.clear();
+ }
+ }
+}
Modified:
cassandra/trunk/test/unit/org/apache/cassandra/utils/BloomFilterTest.java
URL:
http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/utils/BloomFilterTest.java?rev=934992&r1=934991&r2=934992&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/utils/BloomFilterTest.java
(original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/utils/BloomFilterTest.java
Fri Apr 16 16:44:47 2010
@@ -90,37 +90,4 @@ public class BloomFilterTest
{
FilterTest.testSerialize(bf);
}
-
- /* TODO move these into a nightly suite (they take 5-10 minutes each)
- @Test
- // run with -mx1G
- public void testBigInt() {
- int size = 100 * 1000 * 1000;
- bf = new BloomFilter(size, FilterTest.spec.bucketsPerElement);
- FilterTest.testFalsePositives(bf,
- new KeyGenerator.IntGenerator(size),
- new KeyGenerator.IntGenerator(size, size
* 2));
- }
-
- @Test
- public void testBigRandom() {
- int size = 100 * 1000 * 1000;
- bf = new BloomFilter(size, FilterTest.spec.bucketsPerElement);
- FilterTest.testFalsePositives(bf,
- new
KeyGenerator.RandomStringGenerator(new Random().nextInt(), size),
- new
KeyGenerator.RandomStringGenerator(new Random().nextInt(), size));
- }
-
- @Test
- public void timeit() {
- int size = 300 * FilterTest.ELEMENTS;
- bf = new BloomFilter(size, FilterTest.spec.bucketsPerElement);
- for (int i = 0; i < 10; i++) {
- FilterTest.testFalsePositives(bf,
- new
KeyGenerator.RandomStringGenerator(new Random().nextInt(), size),
- new
KeyGenerator.RandomStringGenerator(new Random().nextInt(), size));
- bf.clear();
- }
- }
- */
}