/// <exception cref="System.IO.IOException"/>
        public virtual void TestContainerLaunchNullImage()
        {
            string appSubmitter = "nobody";
            string appId        = "APP_ID";
            string containerId  = "CONTAINER_ID";
            string testImage    = string.Empty;

            Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Container.Container container
                = Org.Mockito.Mockito.Mock <Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Container.Container
                                            >(Org.Mockito.Mockito.ReturnsDeepStubs);
            ContainerId cId = Org.Mockito.Mockito.Mock <ContainerId>(Org.Mockito.Mockito.ReturnsDeepStubs
                                                                     );
            ContainerLaunchContext context = Org.Mockito.Mockito.Mock <ContainerLaunchContext>
                                                 ();
            Dictionary <string, string> env = new Dictionary <string, string>();

            Org.Mockito.Mockito.When(container.GetContainerId()).ThenReturn(cId);
            Org.Mockito.Mockito.When(container.GetLaunchContext()).ThenReturn(context);
            Org.Mockito.Mockito.When(cId.GetApplicationAttemptId().GetApplicationId().ToString
                                         ()).ThenReturn(appId);
            Org.Mockito.Mockito.When(cId.ToString()).ThenReturn(containerId);
            Org.Mockito.Mockito.When(context.GetEnvironment()).ThenReturn(env);
            env[YarnConfiguration.NmDockerContainerExecutorImageName] = testImage;
            dockerContainerExecutor.GetConf().Set(YarnConfiguration.NmDockerContainerExecutorImageName
                                                  , testImage);
            Path scriptPath = new Path("file:///bin/echo");
            Path tokensPath = new Path("file:///dev/null");
            Path pidFile    = new Path(workDir, "pid.txt");

            dockerContainerExecutor.ActivateContainer(cId, pidFile);
            dockerContainerExecutor.LaunchContainer(container, scriptPath, tokensPath, appSubmitter
                                                    , appId, workDir, dirsHandler.GetLocalDirs(), dirsHandler.GetLogDirs());
        }
        /// <exception cref="System.IO.IOException"/>
        private int RunAndBlock(ContainerId cId, IDictionary <string, string> launchCtxEnv
                                , params string[] cmd)
        {
            string appId = "APP_" + Runtime.CurrentTimeMillis();

            Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Container.Container container
                = Org.Mockito.Mockito.Mock <Org.Apache.Hadoop.Yarn.Server.Nodemanager.Containermanager.Container.Container
                                            >();
            ContainerLaunchContext context = Org.Mockito.Mockito.Mock <ContainerLaunchContext>
                                                 ();

            Org.Mockito.Mockito.When(container.GetContainerId()).ThenReturn(cId);
            Org.Mockito.Mockito.When(container.GetLaunchContext()).ThenReturn(context);
            Org.Mockito.Mockito.When(cId.GetApplicationAttemptId().GetApplicationId().ToString
                                         ()).ThenReturn(appId);
            Org.Mockito.Mockito.When(context.GetEnvironment()).ThenReturn(launchCtxEnv);
            string script     = WriteScriptFile(launchCtxEnv, cmd);
            Path   scriptPath = new Path(script);
            Path   tokensPath = new Path("/dev/null");
            Path   workDir    = new Path(workSpace.GetAbsolutePath());
            Path   pidFile    = new Path(workDir, "pid.txt");

            exec.ActivateContainer(cId, pidFile);
            return(exec.LaunchContainer(container, scriptPath, tokensPath, appSubmitter, appId
                                        , workDir, dirsHandler.GetLocalDirs(), dirsHandler.GetLogDirs()));
        }