LinuxContainerExecutor extends ContainerExecutor { @Override public IOStreamPair execContainer(ContainerExecContext ctx) throws ContainerExecutionException { IOStreamPair res; try { res = linuxContainerRuntime.execContainer(ctx); } catch (ContainerExecutionException e) { int retCode = e.getExitCode(); if (retCode != 0) { return new IOStreamPair(null, null); } LOG.warn("Error in executing container interactive shell {} exit = {}", ctx, retCode, e); logOutput(e.getOutput()); throw new ContainerExecutionException( "Error in executing container interactive shel" + ctx.getContainer() .getContainerId().toString() + " exit = " + retCode); } return res; } LinuxContainerExecutor();  LinuxContainerExecutor(LinuxContainerRuntime linuxContainerRuntime); @Override void setConf(Configuration conf); @Override void init(Context context); @Override void start(); @Override void stop(); @Override void startLocalizer(LocalizerStartContext ctx); @VisibleForTesting void buildMainArgs(List<String> command, String user, String appId,
      String locId, InetSocketAddress nmAddr, String tokenFileName,
      List<String> localDirs); @Override void prepareContainer(ContainerPrepareContext ctx); @Override int launchContainer(ContainerStartContext ctx); @Override int relaunchContainer(ContainerStartContext ctx); @Override String[] getIpAndHost(Container container); @Override int reacquireContainer(ContainerReacquisitionContext ctx); @Override boolean signalContainer(ContainerSignalContext ctx); @Override boolean reapContainer(ContainerReapContext ctx); @Override IOStreamPair execContainer(ContainerExecContext ctx); @Override void deleteAsUser(DeletionAsUserContext ctx); @Override void symLink(String target, String symlink); @Override boolean isContainerAlive(ContainerLivenessContext ctx); void mountCgroups(List<String> cgroupKVs, String hierarchy); @VisibleForTesting ResourceHandler getResourceHandler(); void removeDockerContainer(String containerId); @Override synchronized void updateYarnSysFS(Context ctx, String user,
      String appId, String spec); @Override String getExposedPorts(Container container); @Override Map<String, LocalResource> getLocalResources(Container container);  }
@Test public void testExecContainer() throws Exception { Container container = mock(Container.class); LinuxContainerExecutor lce = mock(LinuxContainerExecutor.class); ContainerExecContext.Builder builder = new ContainerExecContext.Builder(); builder.setUser("foo").setAppId("app1").setContainer(container); ContainerExecContext ctx = builder.build(); lce.execContainer(ctx); verify(lce, times(1)).execContainer(ctx); }