The point is missed

Museum of public mistakes and unfinished projects

Posts Tagged ‘junit

Poju4s – an attempt to make JUnit a bit more Scala friendly

leave a comment »

Recently I felt like going back to basics of testing in Scala. There are some fine testing frameworks for Scala that I recommend that you use. Never the less I started thinking about what it would be like to make JUnit more Scala-friendly rather than rolling an entire new framework. Since I came down with the flu anyway I had some time when I was neither unconscious nor watching movies when I could toy with the idea. Long story short: I started the poju4s project on github here.

Poju4s obviously stands for “Plain old JUnit for Scala”

It is not much yet and it has some distance to go before being really useful but I think a few sparks of elegance have found their way into the code (or that is just the fever talking). Anyway, before I understand better than to make this stuff public. Without further due… here it is for what its worth:

Read the rest of this entry »

Written by johlrogge

March 11, 2011 at 4:52 pm

Posted in junit, poju4s, repl, scala

Tagged with , , ,

Phasing over from java to scala pt. 4 – Writing specs with specs

with 7 comments

In the last part I figured out how to make Buildr run specs that are also runnable from Eclipse via JUnit. I started writing my first spec and we are now in the position to make it fail. What we are trying to acomplish is to make directories behave as nodes in a graph, at the moment, only the files show up as nodes.

The spec I wrote currently looks like this:

class PublishSiteGraphSpecTest extends JUnit4(PublishSiteGraphSpec)
object PublishSiteGraphSpec extends Specification {
  "directories are nodes" in {
  }
}

Let us fill in the details about what we actually mean when we say that directories should be nodes:

Read the rest of this entry »

Written by johlrogge

September 14, 2008 at 10:05 pm

Posted in Uncategorized

Tagged with , , ,

Phasing over from java to scala pt. 3 – What about the tests?

with 2 comments

I’ve now spent some time every now and then converting Java-classes into Scala classes. I’m one of those Agile loudmouths so some of you may wonder what I’m doing about the tests. I mentioned that all tests pass in pt. 2 but I have not written about how I test. Well, it probably comes as no surprise that the current code is tested in JUnit and I have simply kept my old test-suite intact when phasing over. This strategy works well since what I’m really doing is refactoring. I move class by class in baby steps, running my tests after each change to make sure that everything is still working as it should. But I’m starting to be done with the move now and a strategy for writing new scala-code seems more and more relevant.

Read the rest of this entry »

Written by johlrogge

September 10, 2008 at 9:44 pm

Posted in Uncategorized

Tagged with , , , ,