Thanks Jonathan.
 
Ok, will take look.
 
However wondering why we cannot use the (CASSANDRA_HOME/bin/cassandra) script in the BeforeClass to start and stop-server (with pidfile) to stop it?
 


--- On Fri, 12/3/10, Jonathan Ellis <jbellis@gmail.com> wrote:

From: Jonathan Ellis <jbellis@gmail.com>
Subject: Re: Connection refused Error..
To: "user" <user@cassandra.apache.org>
Date: Friday, December 3, 2010, 6:07 AM

Look at EmbeddedCassandraService

On Fri, Dec 3, 2010 at 2:13 AM, rambabu pakala <rampakala@yahoo.com> wrote:
Hi,
 
Can someone Please help me?
 
Using Cassandra 0.6.6 version on Linux System.
 
I can Manually start Cassandra and can run the Junit tests(can see all the data from cli). However when i try to start Cassandra from a test (with @Beforeclass)  getting Connection refused error.
 
Is there a way to automate start/stop of Cassandra ?
 
Error:
org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused
        at org.apache.thrift.transport.TSocket.open(TSocket.java:185)
        at com.xp.odm.manager.index.CassandraIndex.addIndexEntry(Unknown Source)
        at com.xp.odm.manager.index.CassandraIndex.addBlob(Unknown Source)
        at com.xp.odm.manager.index.IndexTest$RunThread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at org.apache.thrift.transport.TSocket.open(TSocket.java:180)
        ... 3 more
org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused
 
Thanks,
-Ram.




--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com