// Path: SeleniumGridExtras/src/main/java/com/groupon/seleniumgridextras/SeleniumGridExtras.java
// public class SeleniumGridExtras {
// 
//     public static final String START_UP_COMPLETE = 
//             "\nSelenium Grid Extras has been started!\nNavigate to http://%s:%s for more details";
//     private static Logger logger = Logger.getLogger(SeleniumGridExtras.class);
// 
//     public static void main(String[] args) throws Exception {
//         final String filename = "log4j.properties";
//         PropertyConfigurator.configure(SeleniumGridExtras.class.getClassLoader().getResource(filename));
//         logger.info("Loaded Grid Logger from " + filename);
// 
//         RuntimeConfig.load(true);
// 
//         SelfHealingGrid.checkStatus(RuntimeConfig.getGridExtrasPort(), RuntimeConfig.getConfig());
// 
//         HttpServer
//                 server =
//                 HttpServer.create(new InetSocketAddress(RuntimeConfig.getGridExtrasPort()), 0);
// 
//         List<ExecuteOSTask> tasks = new LinkedList<ExecuteOSTask>();
//         for (String module : RuntimeConfig.getConfig().getActivatedModules()) {
//             tasks.add((ExecuteOSTask) Class.forName(module).newInstance());
//         }
// 
//         logger.debug(RuntimeConfig.getSeleniungGridExtrasHomePath());
// 
//         logger.info("Initializing Task Modules");
//         for (final ExecuteOSTask task : tasks) {
// 
//             if (task.initialize()) {
// 
//                 HttpContext context = server.createContext(task.getEndpoint(), new HttpExecutor() {
//                     @Override
//                     String execute(Map params) {
// 
//                         logger.debug(
//                                 "End-point " + task.getEndpoint() + " was called with HTTP params " + params
//                                         .toString());
//                         String result = JsonParserWrapper.prettyPrintString(task.execute(params));
//                         logger.debug(result);
//                         return result;
//                     }
//                 });
// 
//                 context.getFilters().add(new ParameterFilter());
//             }
// 
// 
//         }
// 
//         logger.info("API documentation");
//         logger.info("/api - Located here");
//         HttpContext context = server.createContext("/api", new HttpExecutor() {
//             @Override
//             String execute(Map params) {
//                 String apiDocs = ApiDocumentation.getApiDocumentation();
//                 logger.debug(apiDocs);
//                 return apiDocs;
//             }
//         });
// 
//         HttpContext homePageContext = server.createContext("/", new HtmlHttpExecutor() {
//             @Override
//             String execute(Map params) {
//                 return new HtmlRenderer(params).toString();
//             }
//         });
// 
//         HttpContext videoContext = server.createContext(VideoHttpExecutor.GET_VIDEO_FILE_ENDPOINT, new VideoHttpExecutor());
//         logger.info("Attaching video downloading context at " + VideoHttpExecutor.GET_VIDEO_FILE_ENDPOINT);
// 
//         if (RuntimeConfig.getConfig().getAutoStartHub()) {
//             logger.info("Grid Hub was set to Autostart");
//             ExecuteOSTask grid = new StartGrid();
//             logger.info(grid.execute("hub").toString().toString());
// 
//         }
// 
//         if (RuntimeConfig.getConfig().getAutoStartNode()) {
//             logger.info("Grid NodeConfig was set to Autostart");
//             ExecuteOSTask grid = new StartGrid();
//             logger.info(grid.execute("node").toString().toString());
//         }
// 
//         context.getFilters().add(new ParameterFilter());
//         homePageContext.getFilters().add(new ParameterFilter());
//         videoContext.getFilters().add(new ParameterFilter());
// 
//         server.setExecutor(null);
//         server.start();
// 
// 
//         System.out.println(String.format(START_UP_COMPLETE, 
//             RuntimeConfig.getOS().getHostIp(),
//             RuntimeConfig.getGridExtrasPort()));
//         logger.info(String.format(START_UP_COMPLETE, 
//             RuntimeConfig.getOS().getHostIp(),
//             RuntimeConfig.getGridExtrasPort()));
// 
//         new VideoShutdownHook().attachShutDownHook();
//         new CleanTempShutdownHook(TempUtility.getWindowsTempForCurrentUser()).attachShutDownHook();
//     }
// }


import com.groupon.seleniumgridextras.SeleniumGridExtras;
import com.groupon.seleniumgridextras.utilities.ImageUtils;
import org.junit.Test;
import java.io.File;
import javax.imageio.ImageIO;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
package com.groupon.seleniumgridextras.videorecording;

/**
 * Created with IntelliJ IDEA. User: dima Date: 8/27/14 Time: 10:19 AM To change this template use
 * File | Settings | File Templates.
 */






public class MissingFrameImageTest {

    @Test
    public void testGetMissingImageString() throws Exception {
        if (!ImageProcessorTest.testIfDimasComputer()) {
            return;
        }
        File
                imageFile =
// Path: SeleniumGridExtras/src/main/java/com/groupon/seleniumgridextras/SeleniumGridExtras.java
// public class SeleniumGridExtras {
// 
//     public static final String START_UP_COMPLETE = 
//             "\nSelenium Grid Extras has been started!\nNavigate to http://%s:%s for more details";
//     private static Logger logger = Logger.getLogger(SeleniumGridExtras.class);
// 
//     public static void main(String[] args) throws Exception {
//         final String filename = "log4j.properties";
//         PropertyConfigurator.configure(SeleniumGridExtras.class.getClassLoader().getResource(filename));
//         logger.info("Loaded Grid Logger from " + filename);
// 
//         RuntimeConfig.load(true);
// 
//         SelfHealingGrid.checkStatus(RuntimeConfig.getGridExtrasPort(), RuntimeConfig.getConfig());
// 
//         HttpServer
//                 server =
//                 HttpServer.create(new InetSocketAddress(RuntimeConfig.getGridExtrasPort()), 0);
// 
//         List<ExecuteOSTask> tasks = new LinkedList<ExecuteOSTask>();
//         for (String module : RuntimeConfig.getConfig().getActivatedModules()) {
//             tasks.add((ExecuteOSTask) Class.forName(module).newInstance());
//         }
// 
//         logger.debug(RuntimeConfig.getSeleniungGridExtrasHomePath());
// 
//         logger.info("Initializing Task Modules");
//         for (final ExecuteOSTask task : tasks) {
// 
//             if (task.initialize()) {
// 
//                 HttpContext context = server.createContext(task.getEndpoint(), new HttpExecutor() {
//                     @Override
//                     String execute(Map params) {
// 
//                         logger.debug(
//                                 "End-point " + task.getEndpoint() + " was called with HTTP params " + params
//                                         .toString());
//                         String result = JsonParserWrapper.prettyPrintString(task.execute(params));
//                         logger.debug(result);
//                         return result;
//                     }
//                 });
// 
//                 context.getFilters().add(new ParameterFilter());
//             }
// 
// 
//         }
// 
//         logger.info("API documentation");
//         logger.info("/api - Located here");
//         HttpContext context = server.createContext("/api", new HttpExecutor() {
//             @Override
//             String execute(Map params) {
//                 String apiDocs = ApiDocumentation.getApiDocumentation();
//                 logger.debug(apiDocs);
//                 return apiDocs;
//             }
//         });
// 
//         HttpContext homePageContext = server.createContext("/", new HtmlHttpExecutor() {
//             @Override
//             String execute(Map params) {
//                 return new HtmlRenderer(params).toString();
//             }
//         });
// 
//         HttpContext videoContext = server.createContext(VideoHttpExecutor.GET_VIDEO_FILE_ENDPOINT, new VideoHttpExecutor());
//         logger.info("Attaching video downloading context at " + VideoHttpExecutor.GET_VIDEO_FILE_ENDPOINT);
// 
//         if (RuntimeConfig.getConfig().getAutoStartHub()) {
//             logger.info("Grid Hub was set to Autostart");
//             ExecuteOSTask grid = new StartGrid();
//             logger.info(grid.execute("hub").toString().toString());
// 
//         }
// 
//         if (RuntimeConfig.getConfig().getAutoStartNode()) {
//             logger.info("Grid NodeConfig was set to Autostart");
//             ExecuteOSTask grid = new StartGrid();
//             logger.info(grid.execute("node").toString().toString());
//         }
// 
//         context.getFilters().add(new ParameterFilter());
//         homePageContext.getFilters().add(new ParameterFilter());
//         videoContext.getFilters().add(new ParameterFilter());
// 
//         server.setExecutor(null);
//         server.start();
// 
// 
//         System.out.println(String.format(START_UP_COMPLETE, 
//             RuntimeConfig.getOS().getHostIp(),
//             RuntimeConfig.getGridExtrasPort()));
//         logger.info(String.format(START_UP_COMPLETE, 
//             RuntimeConfig.getOS().getHostIp(),
//             RuntimeConfig.getGridExtrasPort()));
// 
//         new VideoShutdownHook().attachShutDownHook();
//         new CleanTempShutdownHook(TempUtility.getWindowsTempForCurrentUser()).attachShutDownHook();
//     }
// }


// Path: SeleniumGridExtras/src/test/java/com/groupon/seleniumgridextras/videorecording/MissingFrameImageTest.java
import com.groupon.seleniumgridextras.SeleniumGridExtras;
import com.groupon.seleniumgridextras.utilities.ImageUtils;
import org.junit.Test;
import java.io.File;
import javax.imageio.ImageIO;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

package com.groupon.seleniumgridextras.videorecording;

/**
 * Created with IntelliJ IDEA. User: dima Date: 8/27/14 Time: 10:19 AM To change this template use
 * File | Settings | File Templates.
 */






public class MissingFrameImageTest {

    @Test
    public void testGetMissingImageString() throws Exception {
        if (!ImageProcessorTest.testIfDimasComputer()) {
            return;
        }
        File
                imageFile =
                new File(SeleniumGridExtras.class.getClassLoader().getResource("frame_missing_image.png")