@Test public void mixedCriteria() throws Exception { FindReachRequest req = new FindReachRequest(); req.modelID = TEST_MODEL_ID.toString(); req.edaName = " , ,, Albemarle Sound, Altamaha River, "; req.meanQLo = "50"; req.totContributingAreaLo = "100"; req.totContributingAreaHi = "150"; req.reachName = "cr"; req.huc = "030102"; FindReaches action = new FindReaches(); action.setReachRequest(req); action.setPageSize(10); DataTable result = action.run(); assertTrue(result.getRowCount() == 4); assertEquals(0, action.getValidationErrors().length); assertEquals("4915", result.getString(0, result.getColumnByName("FULL_IDENTIFIER"))); assertEquals("4851", result.getString(1, result.getColumnByName("FULL_IDENTIFIER"))); assertEquals("4840", result.getString(2, result.getColumnByName("FULL_IDENTIFIER"))); assertEquals("4850", result.getString(3, result.getColumnByName("FULL_IDENTIFIER"))); }
@Test public void noModelSpecified() throws Exception { FindReachRequest req = new FindReachRequest(); // req.modelID = TEST_MODEL_ID.toString(); req.reachName = "app"; FindReaches action = new FindReaches(); action.setReachRequest(req); action.setPageSize(7); DataTable result = action.run(); assertNull(result); assertEquals(1, action.getValidationErrors().length); }
@Test public void reachName() throws Exception { FindReachRequest req = new FindReachRequest(); req.modelID = TEST_MODEL_ID.toString(); req.reachName = "app"; FindReaches action = new FindReaches(); action.setReachRequest(req); action.setPageSize(7); DataTable result = action.run(); assertTrue(result.getRowCount() == 7); assertEquals(0, action.getValidationErrors().length); assertEquals("81163", result.getString(0, result.getColumnByName("FULL_IDENTIFIER"))); assertEquals("8164", result.getString(6, result.getColumnByName("FULL_IDENTIFIER"))); }