package com.ge.nbc.legal.strata.util;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
THIS IS A JAVA PROGRAM.I HAVE TO CREATE A JUNIT TEST CLASS FOR THIS
USING DIFFRENT DATE FORMATS AND TEST IT.PLEASE HELP.
public class StrataUtil {
public String convertDateToString(Date dateValue) {
DateFormat dateFormatObject = new SimpleDateFormat("MM/dd/yyyy");
String strFormat = dateFormatObject.format(dateValue);
return strFormat;
}
public Object parse(String string) {
// TODO Auto-generated method stub
return null;
}
public String format(Object object) {
// TODO Auto-generated method stub
return null;
}
}
James McGill - 05 Apr 2006 11:10 GMT
> package com.ge.nbc.legal.strata.util;
>
[quoted text clipped - 22 lines]
> }
> }
Here's where you start:
/**
* File: StrataUtilTest.java <p>
* Created: Apr 5, 2006 <p>
*/
package com.ge.nbc.legal.strata.util;
import java.util.Date;
import junit.framework.TestCase;
/**
* TestCase automatically generated by Eclipse
* @version $Id: $
*/
public class StrataUtilTest extends TestCase {
private StrataUtil fixture;
public static void main(String[] args) {
junit.textui.TestRunner.run(StrataUtilTest.class);
}
/**
* Constructor for StrataUtilTest.
* @param name
*/
public StrataUtilTest(String name) {
super(name);
}
/*
* @see TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
fixture = new StrataUtil();
}
/*
* @see TestCase#tearDown()
*/
protected void tearDown() throws Exception {
super.tearDown();
}
/*
* Test method for 'com.ge.nbc.legal.strata.util.StrataUtil.convertDateToString(Date)'
*/
public void testConvertDateToString() {
String dateString = fixture.convertDateToString(new Date());
//
//
// Your work starts here.
//
//
fail();
}
/*
* Test method for 'com.ge.nbc.legal.strata.util.StrataUtil.parse(String)'
*/
public void testParse() {
fail();
}
/*
* Test method for 'com.ge.nbc.legal.strata.util.StrataUtil.format(Object)'
*/
public void testFormat() {
fail();
}
}