You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ee...@apache.org on 2011/07/19 01:38:43 UTC

svn commit: r1148098 - in /cassandra/drivers/java: build.xml test/conf/ test/conf/cassandra.yaml test/conf/log4j-junit.properties

Author: eevans
Date: Mon Jul 18 23:38:43 2011
New Revision: 1148098

URL: http://svn.apache.org/viewvc?rev=1148098&view=rev
Log:
implement test target

Added:
    cassandra/drivers/java/test/conf/
    cassandra/drivers/java/test/conf/cassandra.yaml
    cassandra/drivers/java/test/conf/log4j-junit.properties
Modified:
    cassandra/drivers/java/build.xml

Modified: cassandra/drivers/java/build.xml
URL: http://svn.apache.org/viewvc/cassandra/drivers/java/build.xml?rev=1148098&r1=1148097&r2=1148098&view=diff
==============================================================================
--- cassandra/drivers/java/build.xml (original)
+++ cassandra/drivers/java/build.xml Mon Jul 18 23:38:43 2011
@@ -28,10 +28,12 @@
   <property name="build.dir" value="${basedir}/build" />
   <property name="build.main.classes" value="${build.dir}/main/classes" />
   <property name="build.dir.lib" value="${cassandra.dir}/build/lib" />
-  <property name="build.test.classes" value="${build.dir}/test/classes" />
+  <property name="build.test" value="${build.dir}/test" />
+  <property name="build.test.classes" value="${build.test}/classes" />
   <property name="javadoc.dir" value="${build.dir}/javadoc" />
   <property name="javadoc.jars.dir" value="${build.dir}/javadocs" />
   <property name="debuglevel" value="source,lines,vars" />
+  <property name="test.timeout" value="60000" />
 
   <condition property="version" value="${base.version}">
     <isset property="release" />
@@ -78,6 +80,8 @@
   <target name="init">
     <mkdir dir="${build.main.classes}" />
     <mkdir dir="${build.test.classes}" />
+    <mkdir dir="${build.test}/cassandra" />
+    <mkdir dir="${build.test}/logs" />
   </target>
 
   <target name="build" depends="init">
@@ -101,6 +105,27 @@
     </javac>
   </target>
 
+  <target name="test" depends="build-test">
+    <junit fork="on" forkmode="perTest" timeout="${test.timeout}"
+           showoutput="true" maxmemory="1024m">
+      <formatter type="brief" usefile="false"/>
+      <jvmarg value="-Dstorage-config=${test.dir}/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" />
+        <path refid="cassandra.test.classpath" />
+        <pathelement location="${build.main.classes}" />
+        <pathelement location="${build.test.classes}" />
+        <pathelement location="${test.dir}/conf" />
+      </classpath>
+      <batchtest todir="${build.test/output}">
+        <fileset dir="${test.dir}" includes="**/*Test.java" />
+      </batchtest>
+    </junit>
+  </target>
+
   <target name="jar" depends="build">
     <manifest file="${build.dir}/MANIFEST.MF">
       <attribute name="Built-By" value="${builder.name}" />

Added: cassandra/drivers/java/test/conf/cassandra.yaml
URL: http://svn.apache.org/viewvc/cassandra/drivers/java/test/conf/cassandra.yaml?rev=1148098&view=auto
==============================================================================
--- cassandra/drivers/java/test/conf/cassandra.yaml (added)
+++ cassandra/drivers/java/test/conf/cassandra.yaml Mon Jul 18 23:38:43 2011
@@ -0,0 +1,36 @@
+#
+# Warning!
+# Consider the effects on 'o.a.c.i.s.LegacySSTableTest' before changing schemas in this file.
+#
+cluster_name: Test Cluster
+in_memory_compaction_limit_in_mb: 1
+commitlog_sync: batch
+commitlog_sync_batch_window_in_ms: 1.0
+partitioner: org.apache.cassandra.dht.CollatingOrderPreservingPartitioner
+rpc_timeout_in_ms: 5000
+listen_address: 127.0.0.1
+storage_port: 7010
+rpc_port: 9170
+column_index_size_in_kb: 4
+commitlog_directory: build/test/cassandra/commitlog
+saved_caches_directory: build/test/cassandra/saved_caches
+commitlog_rotation_threshold_in_mb: 128
+data_file_directories:
+    - build/test/cassandra/data
+disk_access_mode: mmap
+seed_provider:
+    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
+      parameters:
+          - seeds: "127.0.0.2"
+endpoint_snitch: org.apache.cassandra.locator.SimpleSnitch
+dynamic_snitch: true
+request_scheduler: org.apache.cassandra.scheduler.RoundRobinScheduler
+request_scheduler_id: keyspace
+encryption_options:
+    internode_encryption: none
+    keystore: conf/.keystore
+    keystore_password: cassandra
+    truststore: conf/.truststore
+    truststore_password: cassandra
+incremental_backups: true
+flush_largest_memtables_at: 1.0

Added: cassandra/drivers/java/test/conf/log4j-junit.properties
URL: http://svn.apache.org/viewvc/cassandra/drivers/java/test/conf/log4j-junit.properties?rev=1148098&view=auto
==============================================================================
--- cassandra/drivers/java/test/conf/log4j-junit.properties (added)
+++ cassandra/drivers/java/test/conf/log4j-junit.properties Mon Jul 18 23:38:43 2011
@@ -0,0 +1,37 @@
+# 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.
+
+# for production, you should probably set the root to INFO
+# and the pattern to %c instead of %l.  (%l is slower.)
+
+# output messages into a rolling log file as well as stdout
+log4j.rootLogger=DEBUG,stderr,R
+
+# stderr
+log4j.appender.stderr=org.apache.log4j.ConsoleAppender
+log4j.appender.stderr.target=System.err
+log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
+log4j.appender.stderr.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n
+log4j.appender.stderr.threshold=WARN
+
+# rolling log file
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.file.maxFileSize=20MB
+log4j.appender.file.maxBackupIndex=50
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line %L) %m%n
+# Edit the next line to point to your logs directory
+log4j.appender.R.File=build/test/logs/system.log