Guest User

Untitled

a guest
Nov 18th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. @RunWith(UnitilsJUnit4TestClassRunner.class)
  2. @SpringApplicationContext( { "spring/spring.xml",
  3. "spring/spring-test.xml",
  4. "spring/spring-datasource-test.xml" })
  5. public class AbstractSpreadSheetStrategyTest {
  6.  
  7. InputStream inputStream;
  8.  
  9. @Test
  10. public void testValidateNotNegative() throws IOException {
  11. String FILE = "xls/new-test-files/TESTING_NEGATIVE_VALUES.xlsx";
  12. // Given
  13. XSSFWorkbook workbook = null;
  14.  
  15. if (inputStream != null) {
  16. inputStream.close();
  17. }
  18.  
  19. inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(FILE);;
  20. workbook = new XSSFWorkbook(inputStream);
  21.  
  22. AbstractSpreadSheetStrategy strategy = new AbstractSpreadSheetStrategy();
  23.  
  24. strategy.mandatoryAttributesErrorList = new ArrayList<DataUploadCheckList>();
  25.  
  26. //The number -1
  27. Row row = workbook.getSheet("Datasets-SMA").getRow(1);
  28. //0-30-Count
  29. Long _0_30_Count = strategy.validateLongNotNegative(row, 2, AbstractSpreadSheetStrategy.NUMBER_FORMAT, false);
Add Comment
Please, Sign In to add comment