• Bug
  • Status: Closed
  • Resolution: Fixed
  • drb
  • Reporter: sourceforgetracker
  • September 21, 2009
  • 0
  • Watchers: 0
  • September 22, 2009
  • September 22, 2009

Description

Here is a proposed patch for making Element constructable from all fields that are not already configurable via setter methods. The justification for this is to allow querying/setting these fields in a persistable Store implementation, such as the JdbcStore I am working on. In this case I need to be able to store the Element fields as columns, and then re-create the Element from those columns. Sourceforge Ticket ID: 1725911 - Opened By: msqr - 26 May 2007 00:01 UTC

Comments

Sourceforge Tracker 2009-09-21

Logged In: YES user_id=693320 Originator: NO

Matt

Ok, accepted.

Can you please try and add sufficient tests for new functionality so that the test coverage does not drop. I created a new test for this change as follows:

/**
 * Tests that the full constructor sets everything right.
 */
public void testFullConstructor() {

    Element element = new Element("key", "value", 1L, 123L, 1234L, 12345L, 123456L, 1234567L);
    assertEquals("key", element.getKey());
    assertEquals("value", element.getValue());
    assertEquals(1L, element.getVersion());
    assertEquals(123L, element.getCreationTime());
    assertEquals(1234L, element.getLastAccessTime());
    assertEquals(12345L, element.getNextToLastAccessTime());
    assertEquals(123456L, element.getLastUpdateTime());
    assertEquals(1234567L, element.getHitCount());

}

It gives me confidence to make changes given that I don’t have formal testers and rely on beta users as testers, so I try and have high coverage using unit, integration, performance, multithreaded… tests.

Greg Comment by: gregluck - 27 May 2007 01:46 UTC

Fiona OShea 2009-09-22

Re-opening so that I can properly close out these issues and have correct Resolution status in Jira