Skip to content
Snippets Groups Projects
Commit 29c4420b authored by Piotr Gawron's avatar Piotr Gawron
Browse files

parsing date improved (when data is no available)

parent c5f45384
No related branches found
No related tags found
1 merge request!1Appointments dev
...@@ -142,6 +142,9 @@ public abstract class SubjectParser { ...@@ -142,6 +142,9 @@ public abstract class SubjectParser {
} }
protected String getDate(Cell cell) { protected String getDate(Cell cell) {
if (cell == null) {
return "";
}
String result = null; String result = null;
if (cell.getCellTypeEnum().equals(CellType.STRING)) { if (cell.getCellTypeEnum().equals(CellType.STRING)) {
result = getString(cell); result = getString(cell);
......
...@@ -11,6 +11,7 @@ import org.junit.runners.Suite.SuiteClasses; ...@@ -11,6 +11,7 @@ import org.junit.runners.Suite.SuiteClasses;
RedcapParserTest.class, // RedcapParserTest.class, //
SubjectDaoTest.class, // SubjectDaoTest.class, //
SubjectParserTest.class, //
XlsxCalendarProcessorTest.class, // XlsxCalendarProcessorTest.class, //
}) })
public class AllTests { public class AllTests {
......
package smash.appointment.parse;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
public class SubjectParserTest {
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void testParseDate() {
SubjectParser parser = new PrcControlParser();
assertEquals("", parser.getDate(null));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment