Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c19a59
commit 3d6c495
Showing
8 changed files
with
71 additions
and
121 deletions.
There are no files selected for viewing
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
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
10 changes: 0 additions & 10 deletions
10
core/src/main/java/cucumber/runtime/order/OrderPickleEvents.java
This file was deleted.
Oops, something went wrong.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,41 +1,31 @@ | |||
package cucumber.runtime.order; | package cucumber.runtime.order; | ||
|
|
||
import java.util.Collections; | import java.util.Collections; | ||
import java.util.List; | import java.util.List; | ||
|
|
||
import cucumber.runtime.CucumberException; | import gherkin.events.PickleEvent; | ||
import gherkin.events.PickleEvent; |
|
||
|
public enum OrderType implements PickleOrder { | ||
public enum OrderType implements OrderPickleEvents { |
|
||
|
NONE { | ||
NONE { | @Override | ||
@Override | public List<PickleEvent> orderPickleEvents(List<PickleEvent> pickleEvents) { | ||
public List<PickleEvent> orderPickleEvents(List<PickleEvent> pickleEvents) { | return pickleEvents; | ||
return pickleEvents; | } | ||
} | }, | ||
}, | REVERSE { | ||
REVERSE { | @Override | ||
@Override | public List<PickleEvent> orderPickleEvents(List<PickleEvent> pickleEvents) { | ||
public List<PickleEvent> orderPickleEvents(List<PickleEvent> pickleEvents) { | Collections.reverse(pickleEvents); | ||
Collections.reverse(pickleEvents); | return pickleEvents; | ||
return pickleEvents; | } | ||
} | }, | ||
}, | RANDOM { | ||
RANDOM { | @Override | ||
@Override | public List<PickleEvent> orderPickleEvents(List<PickleEvent> pickleEvents) { | ||
public List<PickleEvent> orderPickleEvents(List<PickleEvent> pickleEvents) { | Collections.shuffle(pickleEvents); | ||
Collections.shuffle(pickleEvents); | return pickleEvents; | ||
return pickleEvents; | } | ||
} | } | ||
}; |
|
||
|
|||
|
|||
public static OrderType getOrderType(String name) { | |||
for (OrderType orderType : OrderType.values()) { | |||
if (name.equalsIgnoreCase(orderType.name())) { | |||
return orderType; | |||
} | |||
} | |||
throw new CucumberException(String.format("Unrecognized OrderType %s", name)); | |||
} | |||
} | } |
10 changes: 10 additions & 0 deletions
10
core/src/main/java/cucumber/runtime/order/PickleOrder.java
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,10 @@ | |||
package cucumber.runtime.order; | |||
|
|||
import java.util.List; | |||
|
|||
import gherkin.events.PickleEvent; | |||
|
|||
public interface PickleOrder { | |||
|
|||
List<PickleEvent> orderPickleEvents(List<PickleEvent> pickleEvents); | |||
} |
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
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
45 changes: 0 additions & 45 deletions
45
core/src/test/java/cucumber/runtime/order/OrderTypeTest.java
This file was deleted.
Oops, something went wrong.