This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@allbreach | |
Feature: Breach engine tests to verify breach in case vehicle ETD change. | |
Background: Assign pilots on activity. Two home pilots (of DELP1 with pilot id:1422 and 1423) | |
reseted to a pitstop (DELP1). One Vehicle is going from DELP1 to AMBP1 (1121286) | |
and other to JAIP1(894440).ETD of both vehicles is in next 2 hours | |
(ETD from current time) at DELP1. | |
Given Active pilots "1422,1423" | |
And Reset pilot 1422 to "DELP1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HibernateUtil { | |
private static final SessionFactory sessionFactory; | |
static { | |
try { | |
Configuration cfg = new Configuration(); | |
cfg.setProperty("hibernate.connection.url", CommonUtil.loadTestData.getString("connection.url")); | |
cfg.setProperty("hibernate.connection.username", CommonUtil.loadTestData.getString("connection.username")); | |
cfg.setProperty("hibernate.connection.password", CommonUtil.loadTestData.getString("connection.password")); | |
cfg.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(Cucumber.class) | |
@CucumberOptions( | |
monochrome = true, | |
features = "src/test/java/features", | |
glue = {"utils","steps"}, | |
tags = {"@single"}, | |
format = { | |
"pretty", | |
"html:target/cucumber-reports/cucumber-pretty", | |
"json:target/cucumber-reports/CucumberTestReport.json", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Given("^Vehicle of pilot (\\d+) gets \"([^\"]*)\" by (\\d+) minutes") | |
public void vehicleOfPilotGetsByMinutes(long pilotId, String timeChange, int timeUpdateInMinutes) throws Throwable { | |
// Write code here that turns the phrase above into concrete actions | |
session = CrudOperations.createHibernateConnection(); | |
List<PilotActivity> pilotActivity = session.createQuery("from PilotActivity where isActive=true order by id desc").setMaxResults(1).list(); | |
DateTime currentExpectedStartTimeAtCreation = pilotActivity.get(0).getExpectedStartTimeAtCreation(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RestUtil { | |
Map<String, String> getRequestHeaders; | |
Map<String, String> getRequestParameters; | |
HashMap<String, String> postRequestHeaders; | |
HashMap<String, String> postRequestParameters; | |
RequestSpecification baseSpec; | |
public RestUtil() throws Exception { | |
this.getRequestHeaders = new HashMap(); | |
this.getRequestParameters = new HashMap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Expected report time should be 15 mins before activity start time if vehicle is not placement dry run. | |
Vehicle HR55V1072 is going from DELP1 to JAIP1 and not placement dry run. | |
Given 120 minutes "added" to vehicle node tracking id 894440 | |
And Pilot 1435 is on DUTY OUT | |
And Pilot 1448 is on DUTY OUT | |
And Pilot 1422 is on DUTY OUT | |
When AA scheduler executes | |
Then Pilot 1422 activity on vehicle number "HR55V1072" should "be active" | |
And Difference between expected report time of Pilot 1422 and activity start time of vehicle "HR55V1072" should be 15 minutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void verifyTimeDifferenceBetweenExpectedReportTimeAndActivityStartForNonPlacementVehicles() throws Throwable { | |
// increasing vehicle start time from current time by 2 hours | |
vehicleSteps.minutesShouldBeAddedOrDeletedToVehicleNodeTrackingId | |
(120, "added", 894440); | |
// end the duty for pilot 1435 | |
pilotSteps.pilotIsOnDUTYOUT(1435L); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@And("^Get all active \"([^\"]*)\" of pilots$") | |
public void getAllActiveOfPilots(String activityOrDuty) throws Throwable { | |
session = CrudOperations.createHibernateConnection(); | |
if (activityOrDuty.equalsIgnoreCase("duties")) { | |
activePilotDutiesMap = new HashMap<>(); | |
List<PilotDuty> pilotDuty = session.createQuery("from PilotDuty where isActive=true order by id desc").list(); |
NewerOlder