Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testNodeNotInContext() {
AutomationCapabilityMatcher matcher = new AutomationCapabilityMatcher();
Map<String,Object> nodeCapability = new HashMap<String,Object>();
nodeCapability.put(CapabilityType.BROWSER_NAME,"firefox");
nodeCapability.put(AutomationConstants.INSTANCE_ID,"foobar");
nodeCapability.put(AutomationConstants.INSTANCE_ID,"foo");
Map<String,Object> testCapability = new HashMap<String,Object>();
testCapability.put(CapabilityType.BROWSER_NAME,"firefox");
AutomationDynamicNode node = new AutomationDynamicNode("uuid","id","browser","os", new Date(),10);
Expand Down Expand Up @@ -130,5 +130,7 @@ public void testPropertyDoesMatch() {
@After
public void clearSystemProperty() {
System.clearProperty(AutomationConstants.EXTRA_CAPABILITIES_PROPERTY_NAME);
// Also clear out the old AutomationRunContext
AutomationContext.refreshContext();
}
}
8 changes: 7 additions & 1 deletion src/test/java/com/rmn/qa/task/AutomationReaperTaskTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Calendar;
import java.util.Date;

import org.junit.After;
import org.junit.Test;

import com.amazonaws.services.ec2.model.Instance;
Expand All @@ -18,13 +19,18 @@

public class AutomationReaperTaskTest {

@After
public void tearDown() {
AutomationContext.refreshContext();
}

@Test
public void testShutdown() {
MockVmManager ec2 = new MockVmManager();
Reservation reservation = new Reservation();
Instance instance = new Instance();
instance.setState(new InstanceState().withCode(10));
String instanceId = "foobar";
String instanceId = "foo";
instance.setInstanceId(instanceId);
instance.setLaunchTime(AutomationUtils.modifyDate(new Date(),-5,Calendar.HOUR));
reservation.setInstances(Arrays.asList(instance));
Expand Down