UnmanagedApplicationManager { public FinishApplicationMasterResponse finishApplicationMaster( FinishApplicationMasterRequest request) throws YarnException, IOException { this.heartbeatHandler.shutdown(); if (this.userUgi == null) { if (this.connectionInitiated) { LOG.warn("Unmanaged AM still not successfully launched/registered yet." + " Stopping the UAM heartbeat thread anyways."); return FinishApplicationMasterResponse.newInstance(false); } else { throw new YarnException("finishApplicationMaster should not " + "be called before createAndRegister"); } } return this.rmProxyRelayer.finishApplicationMaster(request); } UnmanagedApplicationManager(Configuration conf, ApplicationId appId,
      String queueName, String submitter, String appNameSuffix,
      boolean keepContainersAcrossApplicationAttempts, String rmName); Token<AMRMTokenIdentifier> launchUAM(); void reAttachUAM(Token<AMRMTokenIdentifier> amrmToken); RegisterApplicationMasterResponse registerApplicationMaster(
      RegisterApplicationMasterRequest request); FinishApplicationMasterResponse finishApplicationMaster(
      FinishApplicationMasterRequest request); KillApplicationResponse forceKillApplication(); void allocateAsync(AllocateRequest request,
      AsyncCallback<AllocateResponse> callback); ApplicationId getAppId(); AMRMClientRelayer getAMRMClientRelayer(); @VisibleForTesting int getRequestQueueSize(); static final String APP_NAME; }
@Test(expected = Exception.class) public void testFinishWithoutRegister() throws YarnException, IOException, InterruptedException { finishApplicationMaster( FinishApplicationMasterRequest.newInstance(null, null, null), attemptId); }