// Path: src/main/java/com/rmn/qa/RegistryRetriever.java
// public interface RegistryRetriever {
// 
//     /**
//      * Retrieves a Selenium Registry
//      * @return
//      */
//     Registry retrieveRegistry();
// 
// }
// 
// Path: src/main/java/com/rmn/qa/aws/VmManager.java
// public interface VmManager {
// 
//     /**
//      * Launches the specified instances
//      * @param uuid UUID of the requesting test run
//      * @param os OS of the requesting test run
//      * @param browser Browser of the requesting test run
//      * @param hubHostName Hub host name for the nodes to register with
//      * @param nodeCount Number of nodes to be started
//      * @param maxSessions Number of max sessions per node
//      * @return
//      */
//     // TODO Refactor into AutomationRunRequest
//     List<Instance> launchNodes(String uuid, String os, String browser, String hubHostName, int nodeCount, int maxSessions) throws NodesCouldNotBeStartedException;
// 
//     /**
//      * Terminates the specified instance
//      * @param instanceId
//      */
//     // TODO Rename to be node or instance in the name
//     boolean terminateInstance(String instanceId);
// 
//     /**
//      * Returns a list of reservations as defined in the {@link com.amazonaws.services.ec2.model.DescribeInstancesRequest DescribeInstancesRequest}
//      * @param describeInstancesRequest
//      * @return
//      */
//     List<Reservation> describeInstances(DescribeInstancesRequest describeInstancesRequest);
// }


import org.openqa.grid.internal.ProxySet;
import java.util.Date;
import com.rmn.qa.RegistryRetriever;
import com.rmn.qa.aws.VmManager;
/*
 * Copyright (C) 2014 RetailMeNot, Inc.
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */

package com.rmn.qa.task;



// We're extending the task so we can override the created date behavior
public class MockAutomationHubCleanupTask extends AutomationHubCleanupTask {

    private Object createdDate;
    private ProxySet proxySet;

    public MockAutomationHubCleanupTask(RegistryRetriever retrieveContext, VmManager ec2, String instanceId) {
        super(retrieveContext, ec2, instanceId);
    }

    @Override
    protected Object getCreatedDate() {
        return createdDate;    //To change body of overridden methods use File | Settings | File Templates.
    }

    @Override
    protected ProxySet getProxySet() {
        return proxySet;
    }

    static Date getEndDate() {
        return AutomationHubCleanupTask.endDate;
    }

    /**
     * Clears the start/end date
     */
    static void clearDates() {
// Path: src/main/java/com/rmn/qa/RegistryRetriever.java
// public interface RegistryRetriever {
// 
//     /**
//      * Retrieves a Selenium Registry
//      * @return
//      */
//     Registry retrieveRegistry();
// 
// }
// 
// Path: src/main/java/com/rmn/qa/aws/VmManager.java
// public interface VmManager {
// 
//     /**
//      * Launches the specified instances
//      * @param uuid UUID of the requesting test run
//      * @param os OS of the requesting test run
//      * @param browser Browser of the requesting test run
//      * @param hubHostName Hub host name for the nodes to register with
//      * @param nodeCount Number of nodes to be started
//      * @param maxSessions Number of max sessions per node
//      * @return
//      */
//     // TODO Refactor into AutomationRunRequest
//     List<Instance> launchNodes(String uuid, String os, String browser, String hubHostName, int nodeCount, int maxSessions) throws NodesCouldNotBeStartedException;
// 
//     /**
//      * Terminates the specified instance
//      * @param instanceId
//      */
//     // TODO Rename to be node or instance in the name
//     boolean terminateInstance(String instanceId);
// 
//     /**
//      * Returns a list of reservations as defined in the {@link com.amazonaws.services.ec2.model.DescribeInstancesRequest DescribeInstancesRequest}
//      * @param describeInstancesRequest
//      * @return
//      */
//     List<Reservation> describeInstances(DescribeInstancesRequest describeInstancesRequest);
// }


// Path: src/test/java/com/rmn/qa/task/MockAutomationHubCleanupTask.java
import org.openqa.grid.internal.ProxySet;
import java.util.Date;
import com.rmn.qa.RegistryRetriever;
import com.rmn.qa.aws.VmManager;

/*
 * Copyright (C) 2014 RetailMeNot, Inc.
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */

package com.rmn.qa.task;



// We're extending the task so we can override the created date behavior
public class MockAutomationHubCleanupTask extends AutomationHubCleanupTask {

    private Object createdDate;
    private ProxySet proxySet;

    public MockAutomationHubCleanupTask(RegistryRetriever retrieveContext, VmManager ec2, String instanceId) {
        super(retrieveContext, ec2, instanceId);
    }

    @Override
    protected Object getCreatedDate() {
        return createdDate;    //To change body of overridden methods use File | Settings | File Templates.
    }

    @Override
    protected ProxySet getProxySet() {
        return proxySet;
    }

    static Date getEndDate() {
        return AutomationHubCleanupTask.endDate;
    }

    /**
     * Clears the start/end date
     */
    static void clearDates() {
        AutomationHubCleanupTask.createdDate = null;