@Test public void testUnsupportedDirectionForConnector() { SqoopException exception = new SqoopException(DriverError.DRIVER_0011, "Connector: " + sqoopConnectorMock.getClass().getCanonicalName()); List<Direction> supportedDirections = getSupportedDirections(); when(sqoopConnectorMock.getSupportedDirections()).thenReturn(supportedDirections); try { jobManager.validateSupportedDirection(sqoopConnectorMock, null); } catch (SqoopException ex) { assertEquals(ex.getMessage(), exception.getMessage()); verify(sqoopConnectorMock, times(1)).getSupportedDirections(); return; } fail("Should throw out an exception with message: " + exception.getMessage()); }
void validateSupportedDirection(SqoopConnector connector, Direction direction) { if (!connector.getSupportedDirections().contains(direction)) { throw new SqoopException(DriverError.DRIVER_0011, "Connector: " + connector.getClass().getCanonicalName()); } }
JobManager implements Reconfigurable { void validateSupportedDirection(SqoopConnector connector, Direction direction) { if (!connector.getSupportedDirections().contains(direction)) { throw new SqoopException(DriverError.DRIVER_0011, "Connector: " + connector.getClass().getCanonicalName()); } } }
JobManager implements Reconfigurable { void validateSupportedDirection(SqoopConnector connector, Direction direction) { if (!connector.getSupportedDirections().contains(direction)) { throw new SqoopException(DriverError.DRIVER_0011, "Connector: " + connector.getClass().getCanonicalName()); } }  }
JobManager implements Reconfigurable { void validateSupportedDirection(SqoopConnector connector, Direction direction) { if (!connector.getSupportedDirections().contains(direction)) { throw new SqoopException(DriverError.DRIVER_0011, "Connector: " + connector.getClass().getCanonicalName()); } }  static JobManager getInstance(); static void setInstance(JobManager newInstance); void setNotificationBaseUrl(String url); String getNotificationBaseUrl(); synchronized void destroy(); synchronized void initialize(); MSubmission start(long jobId, HttpEventContext ctx); JobRequest createJobRequest(long jobId, MSubmission submission); MSubmission createJobSubmission(HttpEventContext ctx, long jobId); void prepareJob(JobRequest request); MSubmission stop(long jobId, HttpEventContext ctx); MSubmission status(long jobId); void updateSubmission(MSubmission submission); @Override synchronized void configurationChanged(); }
JobManager implements Reconfigurable { void validateSupportedDirection(SqoopConnector connector, Direction direction) { if (!connector.getSupportedDirections().contains(direction)) { throw new SqoopException(DriverError.DRIVER_0011, "Connector: " + connector.getClass().getCanonicalName()); } }  static JobManager getInstance(); static void setInstance(JobManager newInstance); void setNotificationBaseUrl(String url); String getNotificationBaseUrl(); synchronized void destroy(); synchronized void initialize(); MSubmission start(long jobId, HttpEventContext ctx); JobRequest createJobRequest(long jobId, MSubmission submission); MSubmission createJobSubmission(HttpEventContext ctx, long jobId); void prepareJob(JobRequest request); MSubmission stop(long jobId, HttpEventContext ctx); MSubmission status(long jobId); void updateSubmission(MSubmission submission); @Override synchronized void configurationChanged();  }