@Test public final void testProjectInfo() throws ParseException { final SimpleDateFormat sdf = new SimpleDateFormat(ProjectInfo.BUILD_TIMESTAMP_FORMAT); final String name = "Project X"; final String version = "1.2.3"; final String buildTimestamp = sdf.format(new Date()); final Properties props = new Properties(); props.put(ProjectInfo.PROPERTY_NAME, name); props.put(ProjectInfo.PROPERTY_VERSION, version); props.put(ProjectInfo.PROPERTY_BUILD_TIMESTAMP, buildTimestamp); final ProjectInfo testee = new ProjectInfo(props); assertThat(testee.getName()).isEqualTo(name); assertThat(testee.getVersion()).isEqualTo(version); assertThat(testee.getBuildTimestamp()).isEqualTo(buildTimestamp); }
public ProjectInfo(final Properties props) { super(); name = props.getProperty(PROPERTY_NAME); version = props.getProperty(PROPERTY_VERSION); buildTimestamp = props.getProperty(PROPERTY_BUILD_TIMESTAMP); Contract.requireValid(this); }
ProjectInfo implements Serializable { public ProjectInfo(final Properties props) { super(); name = props.getProperty(PROPERTY_NAME); version = props.getProperty(PROPERTY_VERSION); buildTimestamp = props.getProperty(PROPERTY_BUILD_TIMESTAMP); Contract.requireValid(this); } }
ProjectInfo implements Serializable { public ProjectInfo(final Properties props) { super(); name = props.getProperty(PROPERTY_NAME); version = props.getProperty(PROPERTY_VERSION); buildTimestamp = props.getProperty(PROPERTY_BUILD_TIMESTAMP); Contract.requireValid(this); } ProjectInfo(final Properties props); }
ProjectInfo implements Serializable { public ProjectInfo(final Properties props) { super(); name = props.getProperty(PROPERTY_NAME); version = props.getProperty(PROPERTY_VERSION); buildTimestamp = props.getProperty(PROPERTY_BUILD_TIMESTAMP); Contract.requireValid(this); } ProjectInfo(final Properties props); String getName(); String getVersion(); String getBuildTimestamp(); Date getBuildTimestampAsDate(); @Override String toString(); }
ProjectInfo implements Serializable { public ProjectInfo(final Properties props) { super(); name = props.getProperty(PROPERTY_NAME); version = props.getProperty(PROPERTY_VERSION); buildTimestamp = props.getProperty(PROPERTY_BUILD_TIMESTAMP); Contract.requireValid(this); } ProjectInfo(final Properties props); String getName(); String getVersion(); String getBuildTimestamp(); Date getBuildTimestampAsDate(); @Override String toString(); static final String PROPERTY_NAME; static final String PROPERTY_VERSION; static final String PROPERTY_BUILD_TIMESTAMP; static final String BUILD_TIMESTAMP_FORMAT; }