Skip to content

Instantly share code, notes, and snippets.

@shouichi
Created April 11, 2012 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shouichi/2359051 to your computer and use it in GitHub Desktop.
Save shouichi/2359051 to your computer and use it in GitHub Desktop.

Quick Start

Run unit tests from Zookeeper.

ant junit

Run QuorumPeerMain on JPF. We try to re-produce ZOOKEEPER-1144 bug. This fails due to out of memory.

ant jpf

Requirements

You need to configure JPF to use jpf-net-iocache, jpf-concurrentand and jpf-bfs extensions. Both of them are available in following reepositories accordingly.

ssh://hg@bitbucket.org/watcharin/net-iocache
http://babelfish.arc.nasa.gov/hg/jpf/jpf-concurrent
https://code.google.com/p/jpf-bfs/
<?xml version="1.0"?>
<project name="jpf-zookeeper" default="compile" basedir=".">
<!-- Properties -->
<property name="src" value="src/"/>
<property name="src.main" value="${src}/main"/>
<property name="src.main.java" value="${src.main}/java"/>
<property name="src.test" value="${src}/test"/>
<property name="src.test.java" value="${src.test}/java"/>
<property name="src.test.resources" value="${src.test}/resources"/>
<property name="target" value="target"/>
<property name="target.main" value="${target}/main"/>
<property name="target.main.classes" value="${target}/main/classes"/>
<property name="target.test" value="${target}/test"/>
<property name="target.test.classes" value="${target.test}/classes"/>
<property name="target.test.reports" value="${target.test}/reports"/>
<property name="target.test.resources" value="${target.test}/resources"/>
<property name="lib" value="lib"/>
<property name="bin" value="bin"/>
<property name="bin.jpf" value="bin/jpf"/>
<!-- Paths -->
<path id="test.classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
<exclude name="**/*modified*.jar"/>
</fileset>
<pathelement location="${target.test.classes}"/>
</path>
<!-- Targets -->
<target name="init">
<mkdir dir="${target.main.classes}"/>
<mkdir dir="${target.test.classes}"/>
<mkdir dir="${target.test.reports}"/>
<copy todir="${target.test.resources}">
<fileset dir="${src.test.resources}"/>
</copy>
</target>
<target name="compile" depends="init">
<javac includeantruntime="false" srcdir="${src.main.java}" destdir="${target.main.classes}">
<compilerarg value="-Xlint:all"/>
</javac>
</target>
<target name="compile-test" depends="init">
<javac includeantruntime="false" srcdir="${src.test.java}" destdir="${target.test.classes}">
<classpath refid="test.classpath"/>
<compilerarg value="-Xlint:all"/>
</javac>
</target>
<target name="junit" depends="compile-test">
<junit fork="yes" showoutput="yes" haltonfailure="yes">
<classpath refid="test.classpath"/>
<formatter type="plain"/>
<batchtest todir="${target.test.reports}">
<fileset dir="${src.test.java}">
<include name="**/*Test.java"/>
<exclude name="**/ACLTest.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="jpf" depends="compile">
<exec executable="${bin.jpf}">
<arg value="${src.test.resources}/SUT.jpf"/>
</exec>
</target>
<target name="clean">
<delete>
<fileset dir="${target}"/>
</delete>
</target>
</project>
#!/bin/sh
java -jar "lib/RunJPF.jar" "$@"
jpf-zookeeper=.
jpf-zookeeper.classpath=lib/zookeeper-3.3.4-modified.jar:lib/log4j-1.2.15.jar:target/test/classes
#!/bin/sh
CLASSPATH=lib/zookeeper-3.3.4.jar:lib/log4j-1.2.15.jar:target/test/resources/conf
java -cp $CLASSPATH org.apache.zookeeper.server.quorum.QuorumPeerMain target/test/resources/conf/peer.cfg
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment