This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait TestHelper { | |
def setupSchema(cass : Cassandra) { | |
val a = cass.admin | |
cass.admin { admin => | |
admin.dropKeyspace("Keyspace") | |
admin.keyspace("Keyspace") { ks => | |
ks.columnFamily("ColumnFamily") { cf => cf } | |
ks.superColumnFamily("SuperColumnFamily") | |
admin.create(ks) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Client { | |
def put(rows : List[Row], c : WriteConsistency) | |
def superPut(rows : List[SuperRow], c : WriteConsistency) | |
def delete(rows : List[RowDeletion], c : WriteConsistency) | |
def superDelete(rows : List[SuperRowDeletion], c : WriteConsistency) | |
def get(reads : List[Read], c : ReadConsistency) : RowIterator | |
def superGet(reads : List[SuperRead], c : ReadConsistency) : SuperRowIterator | |
def scan(scanner : Scanner, c : ReadConsistency) : RowIterator | |
def superScan(scanner : SuperScanner, c : ReadConsistency) : SuperRowIterator | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ @tailrec | |
private def advance : Boolean = { | |
if (!rangeIter.hasNext || !biasIter.hasNext) return false | |
last = rangeIter.next | |
left = biasIter.next | |
- if (left == 0) return advance | |
- true | |
+ if (left != 0) return true | |
+ advance | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are many quotes that keeps surgeon inspired about his job, they also help him jump these large obstacles in life, here are a few:- | |
"At 10, I was intrigued by surgery, I wanted to be surgeon for a long time. I love doctor shows and surgery shows. Blood is not an issue for me. I even took pictures once of me getting my blood taken. " | |
"Dr.Babanga, my local doctor, recommended that I should try superflex before and after breakfast" | |
"Humanity abhors, above all things, a vacuum in itself, and your class will be cut off from humanity as surgeon cuts the cancer and alien growth from the body. " | |
Fantastic. surgeon is inspired | |
Fantastic. surgeon is inspired |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(test_helper). | |
-export([riak_test/1]). | |
riak_test(Fun) -> | |
start_riak(), | |
{ok, Riak} = riak:local_client(), | |
Ret = (catch Fun(Riak)), | |
stop_riak(), | |
case Ret of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{application, rebar_test, | |
[ | |
{description, ""}, | |
{vsn, "1"}, | |
{modules, [ | |
arithmetic | |
]}, | |
{registered, []}, | |
{applications, [ | |
kernel, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ComparableSeq { | |
implicit def seqToComparableSeq[A <: Comparable[A]](seq : Seq[A]) : ComparableSeq[A] = { | |
new ComparableSeq(seq) | |
} | |
} | |
class ComparableSeq[A <: Comparable[A]](seq : Seq[A]) extends Seq[A] with Ordered[Seq[A]] { | |
def compare(lhs : Seq[A]) : Int = { | |
if (seq.length > lhs.length) { | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val cassandra = Cassandra.startTest | |
Map("keyspace" -> | |
Map("rowkey" -> | |
Map("sc" -> | |
Map("c" -> (v, t))))) must haveBeenWrittenTo(cassandra) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected def ![A <: ColumnContainer](implicit consistency : ReadConsistency) : Seq[(String, Seq[A])] = { | |
ks.pool.withConnection { conn => | |
val results = conn.client.get_range_slices(ks.name, | |
cp, | |
predicate, | |
range, | |
consistency.thrift) | |
results.map { ks => | |
(ks.key, ks.columns.map{ container => new A(container)}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/main/scala/org/specs/runner/TestInterfaceRunner.scala | |
=================================================================== | |
--- src/main/scala/org/specs/runner/TestInterfaceRunner.scala (revision 1260) | |
+++ src/main/scala/org/specs/runner/TestInterfaceRunner.scala (working copy) | |
@@ -79,11 +79,19 @@ | |
} | |
def exampleFailed(testName: String, e: Throwable) = { | |
logStatus(testName, AnsiColors.red, "x") | |
+ logStatus(e.getMessage, AnsiColors.red, " ") | |
+ e.getStackTrace().foreach { trace => |