cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ran Tavory <ran...@gmail.com>
Subject Re: How to unit test my code calling Cassandra with Thift
Date Mon, 25 Jan 2010 16:17:11 GMT
yeah, it would. I was doing it under the assumption I don't want to change
the source for cassandra but I'll work on putting it into contrib and add
that c'tor as well.

2010/1/25 Ted Zlatanov <tzz@lifelogs.com>

> On Sun, 24 Jan 2010 13:56:07 +0200 Ran Tavory <rantav@gmail.com> wrote:
>
> RT> On Sun, Jan 24, 2010 at 1:16 PM, gabriele renzi <rff.rff@gmail.com>
> wrote:
>
> >> On Sun, Jan 24, 2010 at 11:02 AM, Ran Tavory <rantav@gmail.com> wrote:
> >> > Here's the code I've just written over the weekend and started using
> in
> >> > test:
> >>
> >> <snip>
> >> Thanks for sharing :)
> >> A quick note on the code from a superficial look: instead of the
> >> hardwired "tmp" string I think it would make more sense to use the
> >> system's tmp dir (  System.getProperty("java.io.tmpdir")).
> >>
> >> I'd say something like this deserves to be present in the cassandra
> >> distribution, or at least put in some public repo (github,
> >> code.google, whatever), what do other people think?
>
> RT> agreed on the System.getProperty("java.io.tmpdir")
> RT> I can put this under contrib if you think it's useful.
>
> Maybe it would make sense to also add a constructor to XMLUtils to
> accept a configuration directly from an InputStream instead of just a
> String filename.  Then all these tmpdir games can be avoided.
> DocumentBuilder, which is used behind the scenes, already does this so
> it's a simple patch to add this constructor to XMLUtils.java:
>
>    public XMLUtils(InputStream xmlIS) throws ParserConfigurationException,
> SAXException, IOException
>    {
>        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
>        DocumentBuilder db = dbf.newDocumentBuilder();
>        document_ = db.parse(xmlIS);
>
>        XPathFactory xpathFactory = XPathFactory.newInstance();
>        xpath_ = xpathFactory.newXPath();
>    }
>
> Ted
>
>

Mime
View raw message