### Question:
MetaToolTaskExecuteJDOQLQuery extends MetaToolTask { @Override void execute() { String query = getCl().getJDOQLQuery(); if (query.toLowerCase().trim().startsWith("select")) { try { executeJDOQLSelect(query); } catch (Exception e) { throw new RuntimeException(e); } } else if (query.toLowerCase().trim().startsWith("update")) { try { executeJDOQLUpdate(query); } catch (Exception e) { throw new RuntimeException(e); } } else { throw new IllegalArgumentException("HiveMetaTool:Unsupported statement type, only select and update supported"); } }    }### Answer:
@Test public void testIllegalQuery() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("HiveMetaTool:Unsupported statement type, only select and update supported"); String illegalQuery = "abcde"; MetaToolTaskExecuteJDOQLQuery t = new MetaToolTaskExecuteJDOQLQuery(); t.setCommandLine(new HiveMetaToolCommandLine(new String[] {"-executeJDOQL", illegalQuery})); t.execute(); }