Working on dateTime with precision NIHVIVO-295
This commit is contained in:
parent
e418533759
commit
c4774272eb
2 changed files with 41 additions and 1 deletions
|
@ -182,6 +182,37 @@ public class DateTimeWithPrecisionTest {
|
|||
Assert.assertEquals(VitroVocabulary.Precision.YEAR.uri(), precisionURI);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void precisionNoValueTest() throws Exception{
|
||||
String FIELDNAME = "testfield";
|
||||
Field field = new Field();
|
||||
field.setName(FIELDNAME);
|
||||
DateTimeWithPrecision dtwp = new DateTimeWithPrecision(field);
|
||||
|
||||
Map<String,String[]> queryParameters = new HashMap<String, String[]>();
|
||||
//field is not filled out at all
|
||||
//no year
|
||||
//no months
|
||||
//no days
|
||||
//no hours
|
||||
//no minutes
|
||||
//no seconds
|
||||
|
||||
EditConfiguration editConfig=null;
|
||||
Map<String,String> validationMsgs = dtwp.getValidationMessages("testfield", editConfig, queryParameters);
|
||||
Assert.assertNotNull(validationMsgs);
|
||||
Assert.assertTrue(validationMsgs.size() == 0 );
|
||||
|
||||
String precisionURI = null;
|
||||
precisionURI = dtwp.getSubmittedPrecision( queryParameters );
|
||||
|
||||
Assert.assertNotNull(precisionURI);
|
||||
Assert.assertEquals(VitroVocabulary.Precision.NONE.uri(), precisionURI);
|
||||
|
||||
Literal date = dtwp.getDateTime( queryParameters);
|
||||
Assert.assertNull(date);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getDateLiteralTest(){
|
||||
String FIELDNAME = "testfield";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue