Archive

Archive for the ‘Tools’ Category

How to branch with Subclipse

March 16th, 2009

On the command line, you can create a branch with

svn cp http://popeye.unibe.ch/svn/p2/Group23/week04 http://popeye.unibe.ch/svn/p2/Group23/ludo01

The same is done with Subclipse as follows

  • Goto the Subclipse perspective
  • Open your group repository.
  • Select the folder you want to branch.
  • Right-click and choose “Branch/Tag”
  • In the dialog, enter the full name of the new folder.
  • Finish, and done.

PS, using the command line you should also be able to copy folders from /Common to your group account. Alas, in Subclipse this wont work.

akuhn Eclipse, P2, Tools

JExample, more than just Tests

March 6th, 2009

JExample helps you to reuse fixtures and to pinpoint failures. It extends Junit with producer-consumer relationships. A producer is a test method that yields its unit under test as return value. A consumer is a test method that depends on one or more producers and their return values.

  • Pinpoint failures – JExample skips any test method whose producer has failed.
  • Reuse fixtures – the return value of a producer is injected into its consumers.

You can find a tutorial here: JExample Quickstart.

@RunWith(JExample.class)
public class StackTest {

  @Test
  public Stack emptyStack() {
    Stack stack = new Stack();
    assertTrue(stack.isEmpty());
    assertEquals(0, stack.size());
    return stack;
  }

  @Test
  @Given("#emptyStack")
  public Stack testPush(Stack stack) {
    stack.push("foo");
    assertEquals("foo", stack.peek());
    assertEquals(1, stack.size());
    return stack;
  }

  @Test
  @Given("#testPush")
  public void testPop(Stack stack) {
    Object top = stack.pop();
    assertEquals("foo", top);
    assertEquals(0, stack.size());
  }

}

JExample is open source, go get it!

Follow me.

admin Tools

Test Coverage

March 6th, 2009

Programmers love writing tests. If you have a progress-o-meter, writing tests is even more fun. Code coverage tools report how much and which parts of your code are covered by tests.

Eclemma is a coverage tool for Eclipse. You can run both your application or your test cases with Eclemma, and get a coverage report.

Eclemma screenshot.

Eclemma is open source. Go get it!

admin Eclipse, Tools

The Good, the bad, the ugly

May 8th, 2008

The Google Singleton Detector can be used on your code base to detect things matching a classic singleton pattern and also some more subtle singleton variants which they call hingeltons, fingletons, and mingletons.

(via Pure Danger Tech)

admin Java, Patterns, Tools

Source Code Search Engines

April 25th, 2008

There is a couple of source code search engines out there. None of them sofar does more than the usual information retrieval foo. That is, as with any other search engine, you may search for terms occurring in the files.

There are

If you know more, please leave a link in the comments.

admin Tools