### Question:
MetaToolTaskUpdateLocation extends MetaToolTask { @Override void execute() { String[] loc = getCl().getUpddateLocationParams(); Path newPath = new Path(loc[0]); Path oldPath = new Path(loc[1]); URI oldURI = oldPath.toUri(); URI newURI = newPath.toUri(); if (oldURI.getHost() == null || newURI.getHost() == null) { throw new IllegalStateException("HiveMetaTool:A valid host is required in both old-loc and new-loc"); } else if (oldURI.getScheme() == null || newURI.getScheme() == null) { throw new IllegalStateException("HiveMetaTool:A valid scheme is required in both old-loc and new-loc"); } updateFSRootLocation(oldURI, newURI, getCl().getSerdePropKey(), getCl().getTablePropKey(), getCl().isDryRun()); }    }### Answer:
@Test public void testNoHost() throws Exception { exception.expect(IllegalStateException.class); exception.expectMessage("HiveMetaTool:A valid host is required in both old-loc and new-loc"); MetaToolTaskUpdateLocation t = new MetaToolTaskUpdateLocation(); t.setCommandLine(new HiveMetaToolCommandLine(new String[] {"-updateLocation", "hdfs: t.execute(); }
@Test public void testNoScheme() throws Exception { exception.expect(IllegalStateException.class); exception.expectMessage("HiveMetaTool:A valid scheme is required in both old-loc and new-loc"); MetaToolTaskUpdateLocation t = new MetaToolTaskUpdateLocation(); t.setCommandLine(new HiveMetaToolCommandLine(new String[] {"-updateLocation", " t.execute(); }