Search in sources :

Example 21 with FenceAgent

use of org.ovirt.engine.core.common.businessentities.pm.FenceAgent in project ovirt-engine by oVirt.

the class ConcurrentAgentsFenceActionExecutorTest method setup.

@Before
public void setup() {
    agent1 = new FenceAgent();
    agent1.setId(Guid.newGuid());
    agent2 = new FenceAgent();
    agent2.setId(Guid.newGuid());
    List<FenceAgent> fenceAgents = new ArrayList<>();
    fenceAgents.add(agent1);
    fenceAgents.add(agent2);
    executor = spy(new ConcurrentAgentsFenceActionExecutor(fencedHost, fenceAgents, new FencingPolicy()));
    doReturn(singleExecutor1).when(executor).createFenceActionExecutor(eq(agent1));
    doReturn(singleExecutor2).when(executor).createFenceActionExecutor(eq(agent2));
}
Also used : FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent) ArrayList(java.util.ArrayList) FencingPolicy(org.ovirt.engine.core.common.businessentities.FencingPolicy) Before(org.junit.Before)

Example 22 with FenceAgent

use of org.ovirt.engine.core.common.businessentities.pm.FenceAgent in project ovirt-engine by oVirt.

the class FenceAgentExecutorTest method createAgent.

private FenceAgent createAgent() {
    FenceAgent agent = new FenceAgent();
    agent.setId(FENCE_AGENT_ID);
    return agent;
}
Also used : FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent)

Example 23 with FenceAgent

use of org.ovirt.engine.core.common.businessentities.pm.FenceAgent in project ovirt-engine by oVirt.

the class FenceProxyLocatorTest method createFenceAgent.

private FenceAgent createFenceAgent(Guid hostId, String type) {
    FenceAgent agent = new FenceAgent();
    agent.setId(Guid.newGuid());
    agent.setHostId(hostId);
    agent.setType(type);
    return agent;
}
Also used : FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent)

Example 24 with FenceAgent

use of org.ovirt.engine.core.common.businessentities.pm.FenceAgent in project ovirt-engine by oVirt.

the class StartVdsCommandTest method createHost.

private VDS createHost() {
    VDS vds = new VDS();
    vds.setId(FENCECD_HOST_ID);
    vds.setClusterId(FENCECD_HOST_CLUSTER_ID);
    vds.setVdsName(HOST_NAME);
    vds.setStatus(VDSStatus.Up);
    List<FenceAgent> agents = new LinkedList<>();
    agents.add(agent1);
    agents.add(agent2);
    vds.setFenceAgents(agents);
    return vds;
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent) LinkedList(java.util.LinkedList)

Example 25 with FenceAgent

use of org.ovirt.engine.core.common.businessentities.pm.FenceAgent in project ovirt-engine by oVirt.

the class BackendFenceAgentResource method remove.

@Override
public Response remove() {
    get();
    FenceAgentCommandParameterBase params = new FenceAgentCommandParameterBase();
    FenceAgent agent = new FenceAgent();
    agent.setHostId(hostId);
    agent.setId(guid);
    params.setAgent(agent);
    return performAction(ActionType.RemoveFenceAgent, params);
}
Also used : FenceAgentCommandParameterBase(org.ovirt.engine.core.common.action.FenceAgentCommandParameterBase) FenceAgent(org.ovirt.engine.core.common.businessentities.pm.FenceAgent)

Aggregations

FenceAgent (org.ovirt.engine.core.common.businessentities.pm.FenceAgent)27 VDS (org.ovirt.engine.core.common.businessentities.VDS)5 Guid (org.ovirt.engine.core.compat.Guid)5 ArrayList (java.util.ArrayList)4 LinkedList (java.util.LinkedList)4 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)4 Comparator (java.util.Comparator)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Map (java.util.Map)2 Test (org.junit.Test)2 Window (com.google.gwt.user.client.Window)1 Inject (com.google.inject.Inject)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Objects (java.util.Objects)1 Set (java.util.Set)1 Before (org.junit.Before)1