/** * Create an engine's unique ID from its {@code engineId} using the default * format. * * <p>The engine ID will be stored in a {@link Segment} with * {@link Segment#getType type} {@code "engine"}. * * @param engineId the engine ID; never {@code null} or blank * @see #root(String, String) */ public static UniqueId forEngine(String engineId) { Preconditions.notBlank(engineId, "engineId must not be null or blank"); return root(ENGINE_SEGMENT_TYPE, engineId); }
MockExecutionTask(String name) { this(UniqueId.root("test", name), name); }
public TestDescriptor build() { return build(new AbstractTestDescriptor(UniqueId.root("root", "test"), "test root") { @Override public Type getType() { return Type.CONTAINER; } }); }
public static PropertyMethodDescriptor createPropertyMethodDescriptor( Class<?> containerClass, String methodName, String seed, int tries, int maxDiscardRatio, ShrinkingMode shrinking ) { UniqueId uniqueId = UniqueId.root("test", "i dont care"); Method method = getMethod(containerClass, methodName); PropertyConfiguration propertyConfig = new PropertyConfiguration("Property", seed, null, null, tries, maxDiscardRatio, shrinking, GenerationMode.AUTO, AfterFailureMode.PREVIOUS_SEED); return new PropertyMethodDescriptor(uniqueId, method, containerClass, propertyConfig); }
@Example void executeFirstByUniqueId() { MockExecutionTask task1 = new MockExecutionTask("1"); MockExecutionTask task2 = new MockExecutionTask("2"); pipeline.submit(task1, task2); pipeline.submit(task2); UniqueId ownerId = UniqueId.root("owner", "2"); MockExecutionTask owned1 = new MockExecutionTask(ownerId, "1"); MockExecutionTask owned2 = new MockExecutionTask(ownerId, "2"); pipeline.submit(owned1); pipeline.submit(owned2, owned1); pipeline.executeFirst(ownerId); pipeline.runToTermination(); InOrder events = Mockito.inOrder(listener); events.verify(listener).executionStarted(owned1); events.verify(listener).executionStarted(owned2); events.verify(listener).executionStarted(task2); events.verify(listener).executionStarted(task1); }