diff --git a/docs/extensions.adoc b/docs/extensions.adoc index 781b3ca5f8..45c0709c6f 100644 --- a/docs/extensions.adoc +++ b/docs/extensions.adoc @@ -1399,6 +1399,9 @@ The `org.spockframework.runtime.IRunListener` can be registered via `SpecInfo.ad The `org.spockframework.runtime.extension.IBlockListener` can be registered on a feature via, `FeatureInfo.addBlockListener(IBlockListener)` and will receive notifications about the progress of the feature. It will be called once when entering a block (`blockEntered`) and once when exiting a block (`blockExited`). +Both methods receive the `BlockInfo` of the block that is entered or exited. +They also receive the current `Specification` instance which gives access to the `ISpecificationContext` to get the current `IterationInfo` or retrieve an `IStore`. +While this gives extensive access to the current state of the test run, it should be used responsibly as it can lead to surprising results if abused. When an exception is thrown in a block, the `blockExited` will not be called for that block. The failed block will be part of the `ErrorContext` in `ErrorInfo` that is passed to `IRunListener.error(ErrorInfo)`. diff --git a/docs/release_notes.adoc b/docs/release_notes.adoc index 340fc77b7b..bc43cad551 100644 --- a/docs/release_notes.adoc +++ b/docs/release_notes.adoc @@ -21,6 +21,7 @@ include::include.adoc[] ** Built-in extensions have been updated to use this new interface where applicable. * Add best-effort error reporting for interactions on final methods when using the `byte-buddy` mock maker spockIssue:2039[] * Add support for `@FailsWith` to assert an exception message spockIssue:2039[] +* Add support for accessing the `IStore` via `ISpecificationContext` spockPull:2064[] * Improve `@Timeout` extension will now use virtual threads if available spockPull:1986[] * Improve mock argument matching, types constraints or arguments in interactions can now handle primitive types like `_ as int` spockIssue:1974[] * Improve `verifyEach` to accept an optional second index parameter for the assertion block closure spockPull:2043[] diff --git a/spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java b/spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java index 6118534648..b4bad98012 100644 --- a/spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java +++ b/spock-core/src/main/java/org/spockframework/compiler/SpecRewriter.java @@ -422,9 +422,9 @@ private void addBlockListeners(Block block) { if (!blockType.isSupportingBlockListeners()) return; // SpockRuntime.callBlockEntered(getSpecificationContext(), blockMetadataIndex) - MethodCallExpression blockEnteredCall = createBlockListenerCall(block, blockType, nodeCache.SpockRuntime_CallBlockEntered); + MethodCallExpression blockEnteredCall = createBlockListenerCall(block, nodeCache.SpockRuntime_CallBlockEntered); // SpockRuntime.callBlockExited(getSpecificationContext(), blockMetadataIndex) - MethodCallExpression blockExitedCall = createBlockListenerCall(block, blockType, nodeCache.SpockRuntime_CallBlockExited); + MethodCallExpression blockExitedCall = createBlockListenerCall(block, nodeCache.SpockRuntime_CallBlockExited); block.getAst().add(0, new ExpressionStatement(blockEnteredCall)); if (blockType == BlockParseInfo.CLEANUP) { @@ -455,13 +455,13 @@ private IfStatement ifThrowableIsNotNull(Statement statement) { ); } - private MethodCallExpression createBlockListenerCall(Block block, BlockParseInfo blockType, MethodNode blockListenerMethod) { + private MethodCallExpression createBlockListenerCall(Block block, MethodNode blockListenerMethod) { if (block.getBlockMetaDataIndex() < 0) throw new SpockException("Block metadata index not set: " + block); return createDirectMethodCall( new ClassExpression(nodeCache.SpockRuntime), blockListenerMethod, new ArgumentListExpression( - getSpecificationContext(), + VariableExpression.THIS_EXPRESSION, new ConstantExpression(block.getBlockMetaDataIndex(), true) )); } diff --git a/spock-core/src/main/java/org/spockframework/lang/ISpecificationContext.java b/spock-core/src/main/java/org/spockframework/lang/ISpecificationContext.java index 8e3b01674a..381aa5c67a 100644 --- a/spock-core/src/main/java/org/spockframework/lang/ISpecificationContext.java +++ b/spock-core/src/main/java/org/spockframework/lang/ISpecificationContext.java @@ -15,6 +15,7 @@ package org.spockframework.lang; import org.spockframework.mock.IThreadAwareMockController; +import org.spockframework.runtime.extension.IStoreProvider; import org.spockframework.runtime.model.BlockInfo; import org.spockframework.runtime.model.FeatureInfo; import org.spockframework.runtime.model.SpecInfo; @@ -24,7 +25,7 @@ import org.spockframework.util.Nullable; @Beta -public interface ISpecificationContext { +public interface ISpecificationContext extends IStoreProvider { @Nullable SpecInfo getCurrentSpec(); diff --git a/spock-core/src/main/java/org/spockframework/runtime/PlatformSpecRunner.java b/spock-core/src/main/java/org/spockframework/runtime/PlatformSpecRunner.java index 93d26f2801..6fdae65687 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/PlatformSpecRunner.java +++ b/spock-core/src/main/java/org/spockframework/runtime/PlatformSpecRunner.java @@ -87,6 +87,7 @@ SpockExecutionContext createSpecInstance(SpockExecutionContext context, boolean context = context.withChildStoreProvider().withCurrentInstance(instance); getSpecificationContext(context).setCurrentSpec(context.getSpec()); + getSpecificationContext(context).pushStoreProvider(context.getStoreProvider()); if (shared) { context = context.withSharedInstance(instance); } @@ -188,6 +189,7 @@ public void runFeature(SpockExecutionContext context, Runnable feature) { throw new InternalSpockError("Invalid state, feature is executed although it should have been skipped"); } getSpecificationContext(context).setCurrentFeature(currentFeature); + getSpecificationContext(context).pushStoreProvider(context.getStoreProvider()); supervisor.beforeFeature(currentFeature); invoke(context, this, createMethodInfoForDoRunFeature(context, feature)); @@ -195,6 +197,7 @@ public void runFeature(SpockExecutionContext context, Runnable feature) { runCloseContextStoreProvider(context, MethodKind.CLEANUP); getSpecificationContext(context).setCurrentFeature(null); + getSpecificationContext(context).popStoreProvider(); } private MethodInfo createMethodInfoForDoRunFeature(SpockExecutionContext context, Runnable feature) { @@ -216,6 +219,7 @@ void runIteration(SpockExecutionContext context, IterationInfo iterationInfo, Ru context = context.withCurrentIteration(iterationInfo); getSpecificationContext(context).setCurrentIteration(iterationInfo); + getSpecificationContext(context).pushStoreProvider(context.getStoreProvider()); supervisor.beforeIteration(iterationInfo); invoke(context, this, createMethodInfoForDoRunIteration(context, runnable)); @@ -223,6 +227,7 @@ void runIteration(SpockExecutionContext context, IterationInfo iterationInfo, Ru runCloseContextStoreProvider(context, MethodKind.CLEANUP); getSpecificationContext(context).setCurrentIteration(null); // TODO check if we really need to null here + getSpecificationContext(context).popStoreProvider(); } IterationInfo createIterationInfo(SpockExecutionContext context, int iterationIndex, Object[] args, int estimatedNumIterations) { diff --git a/spock-core/src/main/java/org/spockframework/runtime/SpecificationContext.java b/spock-core/src/main/java/org/spockframework/runtime/SpecificationContext.java index a8249ae00c..35b8a65660 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/SpecificationContext.java +++ b/spock-core/src/main/java/org/spockframework/runtime/SpecificationContext.java @@ -4,10 +4,15 @@ import org.spockframework.mock.IMockController; import org.spockframework.mock.IThreadAwareMockController; import org.spockframework.mock.runtime.MockController; +import org.spockframework.runtime.extension.IStore; +import org.spockframework.runtime.extension.IStoreProvider; import org.spockframework.runtime.model.*; import org.spockframework.util.Nullable; import spock.lang.Specification; +import java.util.ArrayDeque; +import java.util.Deque; + public class SpecificationContext implements ISpecificationContext { private volatile SpecInfo currentSpec; private volatile FeatureInfo currentFeature; @@ -18,6 +23,7 @@ public class SpecificationContext implements ISpecificationContext { private volatile Specification sharedInstance; private volatile Throwable thrownException; + private final Deque storeProvider = new ArrayDeque<>(3); // spec, feature, iteration private final MockController mockController = new MockController(); @@ -107,4 +113,16 @@ public IThreadAwareMockController getThreadAwareMockController() { return mockController; } + @Override + public IStore getStore(IStore.Namespace namespace) { + return storeProvider.getLast().getStore(namespace); + } + + public void pushStoreProvider(IStoreProvider storeProvider) { + this.storeProvider.push(storeProvider); + } + + public void popStoreProvider() { + this.storeProvider.pop(); + } } diff --git a/spock-core/src/main/java/org/spockframework/runtime/SpockRuntime.java b/spock-core/src/main/java/org/spockframework/runtime/SpockRuntime.java index 04a5163833..36ba45fb9c 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/SpockRuntime.java +++ b/spock-core/src/main/java/org/spockframework/runtime/SpockRuntime.java @@ -24,6 +24,9 @@ import org.hamcrest.Matcher; import org.hamcrest.collection.IsIterableContainingInAnyOrder; import org.opentest4j.MultipleFailuresError; +import spock.lang.Specification; + +import org.spockframework.lang.ISpecificationContext; import org.spockframework.runtime.extension.IBlockListener; import org.spockframework.runtime.model.BlockInfo; import org.spockframework.runtime.model.ExpressionInfo; @@ -231,11 +234,12 @@ public static Object[] despreadList(Object[] args, Object[] spreads, int[] posit public static final String CALL_BLOCK_ENTERED = "callBlockEntered"; - public static void callBlockEntered(SpecificationContext context, int blockInfoIndex) { + public static void callBlockEntered(Specification specification, int blockInfoIndex) { + SpecificationContext context = (SpecificationContext) specification.getSpecificationContext(); IterationInfo currentIteration = context.getCurrentIteration(); BlockInfo blockInfo = context.getCurrentFeature().getBlocks().get(blockInfoIndex); context.setCurrentBlock(blockInfo); - notifyBlockListener(currentIteration, blockListener -> blockListener.blockEntered(currentIteration, blockInfo)); + notifyBlockListener(currentIteration, blockListener -> blockListener.blockEntered(specification, blockInfo)); } private static void notifyBlockListener(IterationInfo currentIteration, Consumer consumer) { @@ -246,10 +250,11 @@ private static void notifyBlockListener(IterationInfo currentIteration, Consumer public static final String CALL_BLOCK_EXITED = "callBlockExited"; - public static void callBlockExited(SpecificationContext context, int blockInfoIndex) { + public static void callBlockExited(Specification specification, int blockInfoIndex) { + SpecificationContext context = (SpecificationContext) specification.getSpecificationContext(); IterationInfo currentIteration = context.getCurrentIteration(); BlockInfo blockInfo = context.getCurrentFeature().getBlocks().get(blockInfoIndex); - notifyBlockListener(currentIteration, blockListener -> blockListener.blockExited(currentIteration, blockInfo)); + notifyBlockListener(currentIteration, blockListener -> blockListener.blockExited(specification, blockInfo)); context.setCurrentBlock(null); } diff --git a/spock-core/src/main/java/org/spockframework/runtime/StoreProvider.java b/spock-core/src/main/java/org/spockframework/runtime/StoreProvider.java index a9f78adb85..31fcfc6505 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/StoreProvider.java +++ b/spock-core/src/main/java/org/spockframework/runtime/StoreProvider.java @@ -17,6 +17,7 @@ import org.junit.platform.engine.support.store.NamespacedHierarchicalStore; import org.spockframework.runtime.extension.IStore; +import org.spockframework.runtime.extension.IStoreProvider; import org.spockframework.util.Nullable; import java.util.Objects; @@ -25,7 +26,7 @@ * @author Leonard Brünings * @since 2.4 */ -public class StoreProvider implements AutoCloseable { +public class StoreProvider implements AutoCloseable, IStoreProvider { private static final NamespacedHierarchicalStore.CloseAction CLOSE_ACTION = (IStore.Namespace namespace, Object key, Object value) -> { if (value instanceof AutoCloseable) { ((AutoCloseable) value).close(); @@ -36,7 +37,7 @@ public class StoreProvider implements AutoCloseable { @Nullable private final StoreProvider parent; - private StoreProvider(NamespacedHierarchicalStore backend, StoreProvider parent) { + private StoreProvider(NamespacedHierarchicalStore backend, @Nullable StoreProvider parent) { this.backend = Objects.requireNonNull(backend); this.parent = parent; } @@ -49,6 +50,7 @@ public StoreProvider createChildStoreProvider() { return new StoreProvider(newBackendStore(backend), this); } + @Override public NamespacedExtensionStore getStore(IStore.Namespace namespace) { return new NamespacedExtensionStore(backend, () -> parent == null ? null : parent.getStore(namespace), diff --git a/spock-core/src/main/java/org/spockframework/runtime/extension/IBlockListener.java b/spock-core/src/main/java/org/spockframework/runtime/extension/IBlockListener.java index df06c4c363..c3741a93c2 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/extension/IBlockListener.java +++ b/spock-core/src/main/java/org/spockframework/runtime/extension/IBlockListener.java @@ -14,6 +14,8 @@ package org.spockframework.runtime.extension; +import spock.lang.Specification; + import org.spockframework.runtime.model.BlockInfo; import org.spockframework.runtime.model.ErrorInfo; import org.spockframework.runtime.model.IterationInfo; @@ -44,7 +46,7 @@ public interface IBlockListener { /** * Called when a block is entered. */ - default void blockEntered(IterationInfo iterationInfo, BlockInfo blockInfo) {} + default void blockEntered(S specificationInstance, BlockInfo blockInfo) {} /** * Called when a block is exited. @@ -53,5 +55,5 @@ default void blockEntered(IterationInfo iterationInfo, BlockInfo blockInfo) {} * The block that was active will be available in the {@link org.spockframework.runtime.model.IErrorContext} * and can be observed via {@link org.spockframework.runtime.IRunListener#error(ErrorInfo)}. */ - default void blockExited(IterationInfo iterationInfo, BlockInfo blockInfo) {} + default void blockExited(S specificationInstance, BlockInfo blockInfo) {} } diff --git a/spock-core/src/main/java/org/spockframework/runtime/extension/IMethodInvocation.java b/spock-core/src/main/java/org/spockframework/runtime/extension/IMethodInvocation.java index 2f0675e79f..d2e56cd4d0 100644 --- a/spock-core/src/main/java/org/spockframework/runtime/extension/IMethodInvocation.java +++ b/spock-core/src/main/java/org/spockframework/runtime/extension/IMethodInvocation.java @@ -22,7 +22,7 @@ /** * @author Peter Niederwieser */ -public interface IMethodInvocation { +public interface IMethodInvocation extends IStoreProvider { /** * Returns the specification which this method invocation belongs to. * @@ -98,22 +98,6 @@ public interface IMethodInvocation { */ Object[] getArguments(); - /** - * Get the {@link IStore} for the supplied {@linkplain IStore.Namespace namespace}. - * - *

A store is bound to its context lifecycle. When a - * context lifecycle ends it closes its associated store. All stored values - * that are instances of {@link AutoCloseable} are - * notified by invoking their {@code close()} methods. - * - * @param namespace the {@code Namespace} to get the store for; never {@code null} - * @return the store in which to put and get objects for other invocations - * working in the same namespace; never {@code null} - * @since 2.4 - */ - @Beta - IStore getStore(IStore.Namespace namespace); - /** * Sets the arguments for this method invocation. * diff --git a/spock-core/src/main/java/org/spockframework/runtime/extension/IStoreProvider.java b/spock-core/src/main/java/org/spockframework/runtime/extension/IStoreProvider.java new file mode 100644 index 0000000000..7e5b64f8f7 --- /dev/null +++ b/spock-core/src/main/java/org/spockframework/runtime/extension/IStoreProvider.java @@ -0,0 +1,40 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * https://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.spockframework.runtime.extension; + +import org.spockframework.util.Beta; + +/** + * Provides access to the {@link IStore} for a given {@linkplain IStore.Namespace namespace}. + * @since 2.4 + */ +@Beta +public interface IStoreProvider { + + /** + * Get the {@link IStore} for the supplied {@linkplain IStore.Namespace namespace}. + *

+ * A store is bound to its context lifecycle. When a + * context lifecycle ends it closes its associated store. All stored values + * that are instances of {@link AutoCloseable} are + * notified by invoking their {@code close()} methods. + * + * @param namespace the {@code Namespace} to get the store for; never {@code null} + * @return the store in which to put and get objects for other invocations + * working in the same namespace; never {@code null} + */ + @Beta + IStore getStore(IStore.Namespace namespace); +} diff --git a/spock-specs/src/test/groovy/org/spockframework/runtime/BlockListenerSpec.groovy b/spock-specs/src/test/groovy/org/spockframework/runtime/BlockListenerSpec.groovy index 59326f9a02..c56c64af5f 100644 --- a/spock-specs/src/test/groovy/org/spockframework/runtime/BlockListenerSpec.groovy +++ b/spock-specs/src/test/groovy/org/spockframework/runtime/BlockListenerSpec.groovy @@ -27,10 +27,10 @@ class BlockListenerSpec extends Specification { def setup() { specificationContext.currentIteration.feature.addBlockListener([ - blockEntered: { IterationInfo i, BlockInfo b -> + blockEntered: { Specification i, BlockInfo b -> blocks << b }, - blockExited: { IterationInfo i, BlockInfo b -> + blockExited: { Specification i, BlockInfo b -> exitBlocks << b }] as IBlockListener) } diff --git a/spock-specs/src/test/groovy/org/spockframework/runtime/StoreSpec.groovy b/spock-specs/src/test/groovy/org/spockframework/runtime/StoreSpec.groovy index 8f5868ccf0..8e131f327e 100644 --- a/spock-specs/src/test/groovy/org/spockframework/runtime/StoreSpec.groovy +++ b/spock-specs/src/test/groovy/org/spockframework/runtime/StoreSpec.groovy @@ -35,6 +35,7 @@ class StoreSpec extends EmbeddedSpecification { def setup() { runner.addClassImport(LogStoreUsage) + runner.addClassImport(LoggingStoreInterceptor) runner.addClassImport(FailingStoreUsage) runner.addClassMemberImport(MethodKind) } @@ -53,15 +54,41 @@ class StoreSpec extends EmbeddedSpecification { runner.runWithImports(''' @LogStoreUsage class ASpec extends Specification { + def setupSpec() { + logStoreAt("setupSpec") + } + + def setup() { + logStoreAt("setup") + } + def "a feature"() { + given: + logStoreAt("feature 'a feature'") + expect: true } def "data driven feature"() { + given: + logStoreAt("feature 'data driven feature'") expect: true where: i << [1, 2] } + + def cleanup() { + logStoreAt("cleanup") + } + + def cleanupSpec() { + logStoreAt("cleanupSpec") + } + + def logStoreAt(String location) { + def store = specificationContext.getStore(LoggingStoreInterceptor.NAMESPACE) + store.get("list", List) << "Store contents at [$location] is: ${store.get("message", String)}" + } } ''') @@ -143,6 +170,7 @@ class LoggingStoreInterceptor implements IMethodInterceptor { final List actionList int counter + String nesting = "" LoggingStoreInterceptor(List actionList) { this.actionList = actionList @@ -151,18 +179,21 @@ class LoggingStoreInterceptor implements IMethodInterceptor { @Override void intercept(IMethodInvocation invocation) throws Throwable { def store = invocation.getStore(NAMESPACE) + store.put("list", actionList) String message = "Stored at $invocation.method.kind - $invocation.method.name [${counter++}]" def prev = store.get("message", String) def replaced = store.put("message", message) store.put(invocation.method.kind, new LoggingValue(actionList, message)) - actionList << "before $invocation.method.kind - $invocation.method.name".toString() - actionList << "\tprev: ${prev}".toString() - actionList << "\treplaced: ${replaced}".toString() - actionList << "\tput: ${message}".toString() + actionList << "${nesting}before $invocation.method.kind - $invocation.method.name".toString() + actionList << "${nesting}\tprev: ${prev}".toString() + actionList << "${nesting}\treplaced: ${replaced}".toString() + actionList << "${nesting}\tput: ${message}".toString() + nesting += " " invocation.proceed() - actionList << "after $invocation.method.kind - $invocation.method.name".toString() + nesting = nesting.substring(0, nesting.length() - 2) + actionList << "${nesting}after $invocation.method.kind - $invocation.method.name".toString() } } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/runtime/StoreSpec/store_is_created_and_cleaned_for_each_level.txt b/spock-specs/src/test/resources/snapshots/org/spockframework/runtime/StoreSpec/store_is_created_and_cleaned_for_each_level.txt index a2d094e9c2..9b40874a5a 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/runtime/StoreSpec/store_is_created_and_cleaned_for_each_level.txt +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/runtime/StoreSpec/store_is_created_and_cleaned_for_each_level.txt @@ -7,120 +7,171 @@ before SPEC_EXECUTION - null prev: Stored at SHARED_INITIALIZER - null [0] replaced: Stored at SHARED_INITIALIZER - null [0] put: Stored at SPEC_EXECUTION - null [1] -before SETUP_SPEC - null - prev: Stored at SPEC_EXECUTION - null [1] - replaced: Stored at SPEC_EXECUTION - null [1] - put: Stored at SETUP_SPEC - null [2] -after SETUP_SPEC - null -before FEATURE_EXECUTION - null - prev: Stored at SETUP_SPEC - null [2] - replaced: null - put: Stored at FEATURE_EXECUTION - null [3] -before INITIALIZER - null - prev: Stored at FEATURE_EXECUTION - null [3] - replaced: null - put: Stored at INITIALIZER - null [4] -after INITIALIZER - null -before ITERATION_EXECUTION - null - prev: Stored at INITIALIZER - null [4] - replaced: Stored at INITIALIZER - null [4] - put: Stored at ITERATION_EXECUTION - null [5] -before SETUP - null - prev: Stored at ITERATION_EXECUTION - null [5] - replaced: Stored at ITERATION_EXECUTION - null [5] - put: Stored at SETUP - null [6] -after SETUP - null -before FEATURE - a feature - prev: Stored at SETUP - null [6] - replaced: Stored at SETUP - null [6] - put: Stored at FEATURE - a feature [7] -after FEATURE - a feature -before CLEANUP - null - prev: Stored at FEATURE - a feature [7] - replaced: Stored at FEATURE - a feature [7] - put: Stored at CLEANUP - null [8] -after CLEANUP - null -after ITERATION_EXECUTION - null -# closing Stored at CLEANUP - null [8] -# closing Stored at FEATURE - a feature [7] -# closing Stored at SETUP - null [6] -# closing Stored at ITERATION_EXECUTION - null [5] -# closing Stored at INITIALIZER - null [4] -after FEATURE_EXECUTION - null -# closing Stored at FEATURE_EXECUTION - null [3] -before FEATURE_EXECUTION - null - prev: Stored at SETUP_SPEC - null [2] - replaced: null - put: Stored at FEATURE_EXECUTION - null [9] -before INITIALIZER - null - prev: Stored at FEATURE_EXECUTION - null [9] - replaced: null - put: Stored at INITIALIZER - null [10] -after INITIALIZER - null -before ITERATION_EXECUTION - null - prev: Stored at INITIALIZER - null [10] - replaced: Stored at INITIALIZER - null [10] - put: Stored at ITERATION_EXECUTION - null [11] -before SETUP - null - prev: Stored at ITERATION_EXECUTION - null [11] - replaced: Stored at ITERATION_EXECUTION - null [11] - put: Stored at SETUP - null [12] -after SETUP - null -before FEATURE - data driven feature - prev: Stored at SETUP - null [12] - replaced: Stored at SETUP - null [12] - put: Stored at FEATURE - data driven feature [13] -after FEATURE - data driven feature -before CLEANUP - null - prev: Stored at FEATURE - data driven feature [13] - replaced: Stored at FEATURE - data driven feature [13] - put: Stored at CLEANUP - null [14] -after CLEANUP - null -after ITERATION_EXECUTION - null -# closing Stored at CLEANUP - null [14] -# closing Stored at FEATURE - data driven feature [13] -# closing Stored at SETUP - null [12] -# closing Stored at ITERATION_EXECUTION - null [11] -# closing Stored at INITIALIZER - null [10] -before INITIALIZER - null - prev: Stored at FEATURE_EXECUTION - null [9] - replaced: null - put: Stored at INITIALIZER - null [15] -after INITIALIZER - null -before ITERATION_EXECUTION - null - prev: Stored at INITIALIZER - null [15] - replaced: Stored at INITIALIZER - null [15] - put: Stored at ITERATION_EXECUTION - null [16] -before SETUP - null - prev: Stored at ITERATION_EXECUTION - null [16] - replaced: Stored at ITERATION_EXECUTION - null [16] - put: Stored at SETUP - null [17] -after SETUP - null -before FEATURE - data driven feature - prev: Stored at SETUP - null [17] - replaced: Stored at SETUP - null [17] - put: Stored at FEATURE - data driven feature [18] -after FEATURE - data driven feature -before CLEANUP - null - prev: Stored at FEATURE - data driven feature [18] - replaced: Stored at FEATURE - data driven feature [18] - put: Stored at CLEANUP - null [19] -after CLEANUP - null -after ITERATION_EXECUTION - null -# closing Stored at CLEANUP - null [19] -# closing Stored at FEATURE - data driven feature [18] -# closing Stored at SETUP - null [17] -# closing Stored at ITERATION_EXECUTION - null [16] -# closing Stored at INITIALIZER - null [15] -after FEATURE_EXECUTION - null -# closing Stored at FEATURE_EXECUTION - null [9] -before CLEANUP_SPEC - null - prev: Stored at SETUP_SPEC - null [2] - replaced: Stored at SETUP_SPEC - null [2] - put: Stored at CLEANUP_SPEC - null [20] -after CLEANUP_SPEC - null + before SETUP_SPEC - null + prev: Stored at SPEC_EXECUTION - null [1] + replaced: Stored at SPEC_EXECUTION - null [1] + put: Stored at SETUP_SPEC - null [2] + before SETUP_SPEC - setupSpec + prev: Stored at SETUP_SPEC - null [2] + replaced: Stored at SETUP_SPEC - null [2] + put: Stored at SETUP_SPEC - setupSpec [3] +Store contents at [setupSpec] is: Stored at SETUP_SPEC - setupSpec [3] + after SETUP_SPEC - setupSpec + after SETUP_SPEC - null + before FEATURE_EXECUTION - null + prev: Stored at SETUP_SPEC - setupSpec [3] + replaced: null + put: Stored at FEATURE_EXECUTION - null [4] + before INITIALIZER - null + prev: Stored at FEATURE_EXECUTION - null [4] + replaced: null + put: Stored at INITIALIZER - null [5] + after INITIALIZER - null + before ITERATION_EXECUTION - null + prev: Stored at INITIALIZER - null [5] + replaced: Stored at INITIALIZER - null [5] + put: Stored at ITERATION_EXECUTION - null [6] + before SETUP - null + prev: Stored at ITERATION_EXECUTION - null [6] + replaced: Stored at ITERATION_EXECUTION - null [6] + put: Stored at SETUP - null [7] + before SETUP - setup + prev: Stored at SETUP - null [7] + replaced: Stored at SETUP - null [7] + put: Stored at SETUP - setup [8] +Store contents at [setup] is: Stored at SETUP - setup [8] + after SETUP - setup + after SETUP - null + before FEATURE - a feature + prev: Stored at SETUP - setup [8] + replaced: Stored at SETUP - setup [8] + put: Stored at FEATURE - a feature [9] +Store contents at [feature 'a feature'] is: Stored at FEATURE - a feature [9] + after FEATURE - a feature + before CLEANUP - null + prev: Stored at FEATURE - a feature [9] + replaced: Stored at FEATURE - a feature [9] + put: Stored at CLEANUP - null [10] + before CLEANUP - cleanup + prev: Stored at CLEANUP - null [10] + replaced: Stored at CLEANUP - null [10] + put: Stored at CLEANUP - cleanup [11] +Store contents at [cleanup] is: Stored at CLEANUP - cleanup [11] + after CLEANUP - cleanup + after CLEANUP - null + after ITERATION_EXECUTION - null +# closing Stored at CLEANUP - cleanup [11] +# closing Stored at FEATURE - a feature [9] +# closing Stored at SETUP - setup [8] +# closing Stored at ITERATION_EXECUTION - null [6] +# closing Stored at INITIALIZER - null [5] + after FEATURE_EXECUTION - null +# closing Stored at FEATURE_EXECUTION - null [4] + before FEATURE_EXECUTION - null + prev: Stored at SETUP_SPEC - setupSpec [3] + replaced: null + put: Stored at FEATURE_EXECUTION - null [12] + before INITIALIZER - null + prev: Stored at FEATURE_EXECUTION - null [12] + replaced: null + put: Stored at INITIALIZER - null [13] + after INITIALIZER - null + before ITERATION_EXECUTION - null + prev: Stored at INITIALIZER - null [13] + replaced: Stored at INITIALIZER - null [13] + put: Stored at ITERATION_EXECUTION - null [14] + before SETUP - null + prev: Stored at ITERATION_EXECUTION - null [14] + replaced: Stored at ITERATION_EXECUTION - null [14] + put: Stored at SETUP - null [15] + before SETUP - setup + prev: Stored at SETUP - null [15] + replaced: Stored at SETUP - null [15] + put: Stored at SETUP - setup [16] +Store contents at [setup] is: Stored at SETUP - setup [16] + after SETUP - setup + after SETUP - null + before FEATURE - data driven feature + prev: Stored at SETUP - setup [16] + replaced: Stored at SETUP - setup [16] + put: Stored at FEATURE - data driven feature [17] +Store contents at [feature 'data driven feature'] is: Stored at FEATURE - data driven feature [17] + after FEATURE - data driven feature + before CLEANUP - null + prev: Stored at FEATURE - data driven feature [17] + replaced: Stored at FEATURE - data driven feature [17] + put: Stored at CLEANUP - null [18] + before CLEANUP - cleanup + prev: Stored at CLEANUP - null [18] + replaced: Stored at CLEANUP - null [18] + put: Stored at CLEANUP - cleanup [19] +Store contents at [cleanup] is: Stored at CLEANUP - cleanup [19] + after CLEANUP - cleanup + after CLEANUP - null + after ITERATION_EXECUTION - null +# closing Stored at CLEANUP - cleanup [19] +# closing Stored at FEATURE - data driven feature [17] +# closing Stored at SETUP - setup [16] +# closing Stored at ITERATION_EXECUTION - null [14] +# closing Stored at INITIALIZER - null [13] + before INITIALIZER - null + prev: Stored at FEATURE_EXECUTION - null [12] + replaced: null + put: Stored at INITIALIZER - null [20] + after INITIALIZER - null + before ITERATION_EXECUTION - null + prev: Stored at INITIALIZER - null [20] + replaced: Stored at INITIALIZER - null [20] + put: Stored at ITERATION_EXECUTION - null [21] + before SETUP - null + prev: Stored at ITERATION_EXECUTION - null [21] + replaced: Stored at ITERATION_EXECUTION - null [21] + put: Stored at SETUP - null [22] + before SETUP - setup + prev: Stored at SETUP - null [22] + replaced: Stored at SETUP - null [22] + put: Stored at SETUP - setup [23] +Store contents at [setup] is: Stored at SETUP - setup [23] + after SETUP - setup + after SETUP - null + before FEATURE - data driven feature + prev: Stored at SETUP - setup [23] + replaced: Stored at SETUP - setup [23] + put: Stored at FEATURE - data driven feature [24] +Store contents at [feature 'data driven feature'] is: Stored at FEATURE - data driven feature [24] + after FEATURE - data driven feature + before CLEANUP - null + prev: Stored at FEATURE - data driven feature [24] + replaced: Stored at FEATURE - data driven feature [24] + put: Stored at CLEANUP - null [25] + before CLEANUP - cleanup + prev: Stored at CLEANUP - null [25] + replaced: Stored at CLEANUP - null [25] + put: Stored at CLEANUP - cleanup [26] +Store contents at [cleanup] is: Stored at CLEANUP - cleanup [26] + after CLEANUP - cleanup + after CLEANUP - null + after ITERATION_EXECUTION - null +# closing Stored at CLEANUP - cleanup [26] +# closing Stored at FEATURE - data driven feature [24] +# closing Stored at SETUP - setup [23] +# closing Stored at ITERATION_EXECUTION - null [21] +# closing Stored at INITIALIZER - null [20] + after FEATURE_EXECUTION - null +# closing Stored at FEATURE_EXECUTION - null [12] + before CLEANUP_SPEC - null + prev: Stored at SETUP_SPEC - setupSpec [3] + replaced: Stored at SETUP_SPEC - setupSpec [3] + put: Stored at CLEANUP_SPEC - null [27] + before CLEANUP_SPEC - cleanupSpec + prev: Stored at CLEANUP_SPEC - null [27] + replaced: Stored at CLEANUP_SPEC - null [27] + put: Stored at CLEANUP_SPEC - cleanupSpec [28] +Store contents at [cleanupSpec] is: Stored at CLEANUP_SPEC - cleanupSpec [28] + after CLEANUP_SPEC - cleanupSpec + after CLEANUP_SPEC - null after SPEC_EXECUTION - null -# closing Stored at CLEANUP_SPEC - null [20] -# closing Stored at SETUP_SPEC - null [2] +# closing Stored at CLEANUP_SPEC - cleanupSpec [28] +# closing Stored at SETUP_SPEC - setupSpec [3] # closing Stored at SPEC_EXECUTION - null [1] # closing Stored at SHARED_INITIALIZER - null [0] \ No newline at end of file diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____3.txt b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____3.txt index 50a2e480b4..a1027835f7 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____3.txt +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____3.txt @@ -41,12 +41,8 @@ public class apackage/TestSpec extends spock/lang/Specification implements groov ALOAD 3 POP ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - LDC Lorg/spockframework/runtime/SpecificationContext;.class - INVOKESTATIC org/codehaus/groovy/runtime/ScriptBytecodeAdapter.castToType (Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; - CHECKCAST org/spockframework/runtime/SpecificationContext ICONST_0 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lspock/lang/Specification;I)V ACONST_NULL POP L0 @@ -97,21 +93,13 @@ public class apackage/TestSpec extends spock/lang/Specification implements groov L13 FRAME SAME ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - LDC Lorg/spockframework/runtime/SpecificationContext;.class - INVOKESTATIC org/codehaus/groovy/runtime/ScriptBytecodeAdapter.castToType (Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; - CHECKCAST org/spockframework/runtime/SpecificationContext ICONST_0 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lspock/lang/Specification;I)V ACONST_NULL POP ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - LDC Lorg/spockframework/runtime/SpecificationContext;.class - INVOKESTATIC org/codehaus/groovy/runtime/ScriptBytecodeAdapter.castToType (Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; - CHECKCAST org/spockframework/runtime/SpecificationContext ICONST_1 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lspock/lang/Specification;I)V ACONST_NULL POP ALOAD 0 @@ -158,21 +146,13 @@ public class apackage/TestSpec extends spock/lang/Specification implements groov L16 FRAME SAME ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - LDC Lorg/spockframework/runtime/SpecificationContext;.class - INVOKESTATIC org/codehaus/groovy/runtime/ScriptBytecodeAdapter.castToType (Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; - CHECKCAST org/spockframework/runtime/SpecificationContext ICONST_1 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lspock/lang/Specification;I)V ACONST_NULL POP ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - LDC Lorg/spockframework/runtime/SpecificationContext;.class - INVOKESTATIC org/codehaus/groovy/runtime/ScriptBytecodeAdapter.castToType (Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; - CHECKCAST org/spockframework/runtime/SpecificationContext ICONST_2 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lspock/lang/Specification;I)V ACONST_NULL POP L17 @@ -187,12 +167,8 @@ public class apackage/TestSpec extends spock/lang/Specification implements groov INVOKEINTERFACE org/codehaus/groovy/runtime/callsite/CallSite.callCurrent (Lgroovy/lang/GroovyObject;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; (itf) POP ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - LDC Lorg/spockframework/runtime/SpecificationContext;.class - INVOKESTATIC org/codehaus/groovy/runtime/ScriptBytecodeAdapter.castToType (Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; - CHECKCAST org/spockframework/runtime/SpecificationContext ICONST_2 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lspock/lang/Specification;I)V ACONST_NULL POP ALOAD 0 diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____4.txt b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____4.txt index 0887d0dff6..4a58402510 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____4.txt +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/Primitive_types_are_used_in_AST_transformation_Groovy____4.txt @@ -52,16 +52,8 @@ public class apackage/TestSpec extends spock/lang/Specification implements groov ALOAD 2 POP ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - INVOKEDYNAMIC cast(Lorg/spockframework/lang/ISpecificationContext;)Lorg/spockframework/runtime/SpecificationContext; [ - // handle kind 0x6 : INVOKESTATIC - org/codehaus/groovy/vmplugin/v8/IndyInterface.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;I)Ljava/lang/invoke/CallSite; - // arguments: - "()", - 0 - ] ICONST_0 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lspock/lang/Specification;I)V ACONST_NULL POP L0 @@ -112,29 +104,13 @@ public class apackage/TestSpec extends spock/lang/Specification implements groov L13 FRAME SAME ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - INVOKEDYNAMIC cast(Lorg/spockframework/lang/ISpecificationContext;)Lorg/spockframework/runtime/SpecificationContext; [ - // handle kind 0x6 : INVOKESTATIC - org/codehaus/groovy/vmplugin/v8/IndyInterface.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;I)Ljava/lang/invoke/CallSite; - // arguments: - "()", - 0 - ] ICONST_0 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lspock/lang/Specification;I)V ACONST_NULL POP ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - INVOKEDYNAMIC cast(Lorg/spockframework/lang/ISpecificationContext;)Lorg/spockframework/runtime/SpecificationContext; [ - // handle kind 0x6 : INVOKESTATIC - org/codehaus/groovy/vmplugin/v8/IndyInterface.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;I)Ljava/lang/invoke/CallSite; - // arguments: - "()", - 0 - ] ICONST_1 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lspock/lang/Specification;I)V ACONST_NULL POP ALOAD 0 @@ -186,29 +162,13 @@ public class apackage/TestSpec extends spock/lang/Specification implements groov L16 FRAME SAME ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - INVOKEDYNAMIC cast(Lorg/spockframework/lang/ISpecificationContext;)Lorg/spockframework/runtime/SpecificationContext; [ - // handle kind 0x6 : INVOKESTATIC - org/codehaus/groovy/vmplugin/v8/IndyInterface.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;I)Ljava/lang/invoke/CallSite; - // arguments: - "()", - 0 - ] ICONST_1 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lspock/lang/Specification;I)V ACONST_NULL POP ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - INVOKEDYNAMIC cast(Lorg/spockframework/lang/ISpecificationContext;)Lorg/spockframework/runtime/SpecificationContext; [ - // handle kind 0x6 : INVOKESTATIC - org/codehaus/groovy/vmplugin/v8/IndyInterface.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;I)Ljava/lang/invoke/CallSite; - // arguments: - "()", - 0 - ] ICONST_2 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockEntered (Lspock/lang/Specification;I)V ACONST_NULL POP L17 @@ -226,16 +186,8 @@ public class apackage/TestSpec extends spock/lang/Specification implements groov ] POP ALOAD 0 - INVOKEVIRTUAL org/spockframework/lang/SpecInternals.getSpecificationContext ()Lorg/spockframework/lang/ISpecificationContext; - INVOKEDYNAMIC cast(Lorg/spockframework/lang/ISpecificationContext;)Lorg/spockframework/runtime/SpecificationContext; [ - // handle kind 0x6 : INVOKESTATIC - org/codehaus/groovy/vmplugin/v8/IndyInterface.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;I)Ljava/lang/invoke/CallSite; - // arguments: - "()", - 0 - ] ICONST_2 - INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lorg/spockframework/runtime/SpecificationContext;I)V + INVOKESTATIC org/spockframework/runtime/SpockRuntime.callBlockExited (Lspock/lang/Specification;I)V ACONST_NULL POP ALOAD 0 diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_can_render_everything.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_can_render_everything.groovy index ce864b0430..7ffba1c2db 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_can_render_everything.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_can_render_everything.groovy @@ -7,9 +7,9 @@ public class apackage.ASpec extends spock.lang.Specification { @org.spockframework.runtime.model.FeatureMetadata(name = 'a feature', ordinal = 0, line = 1, blocks = [@org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.SETUP, texts = [])], parameterNames = []) public void $spock_feature_0_0() { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.lang.Object nothing = null - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_can_render_everything__Groovy_4_0_2__.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_can_render_everything__Groovy_4_0_2__.groovy index 11ddc426bf..fd88bc3283 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_can_render_everything__Groovy_4_0_2__.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_can_render_everything__Groovy_4_0_2__.groovy @@ -7,9 +7,9 @@ public class apackage.ASpec extends spock.lang.Specification implements groovy.l @org.spockframework.runtime.model.FeatureMetadata(name = 'a feature', ordinal = 0, line = 1, blocks = [@org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.SETUP, texts = [])], parameterNames = []) public void $spock_feature_0_0() { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.lang.Object nothing = null - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_renders_only_methods_and_its_annotation_by_default.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_renders_only_methods_and_its_annotation_by_default.groovy index a690ad70c0..dd6b84996a 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_renders_only_methods_and_its_annotation_by_default.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceFeatureBody_renders_only_methods_and_its_annotation_by_default.groovy @@ -6,9 +6,9 @@ class ASpec extends Specification { /*--------- tag::snapshot[] ---------*/ @org.spockframework.runtime.model.FeatureMetadata(name = 'a feature', ordinal = 0, line = 1, blocks = [@org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.SETUP, texts = [])], parameterNames = []) public void $spock_feature_0_0() { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.lang.Object nothing = null - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceSpecBody_renders_only_methods__fields__properties__object_initializers_and_their_annotation_by_default.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceSpecBody_renders_only_methods__fields__properties__object_initializers_and_their_annotation_by_default.groovy index 31d9795be5..6e4e7d6fae 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceSpecBody_renders_only_methods__fields__properties__object_initializers_and_their_annotation_by_default.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/AstSpec/astToSourceSpecBody_renders_only_methods__fields__properties__object_initializers_and_their_annotation_by_default.groovy @@ -12,9 +12,9 @@ private java.lang.Object $spock_initializeFields() { @org.spockframework.runtime.model.FeatureMetadata(name = 'a feature', ordinal = 0, line = 3, blocks = [@org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.SETUP, texts = [])], parameterNames = []) public void $spock_feature_0_0() { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.lang.Object nothing = null - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_GString_labels.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_GString_labels.groovy index 00650532dc..398e103783 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_GString_labels.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_GString_labels.groovy @@ -9,10 +9,10 @@ public void $spock_feature_0_0() { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() java.lang.Integer idx = 0 - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) "given ${( idx )++}" - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), '\"expect \${idx++}\"', 3, 13, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(2), "${$spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), ( idx )++)}expect ")) } @@ -20,11 +20,11 @@ public void $spock_feature_0_0() { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, '\"expect \${idx++}\"', 3, 13, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 2) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 2) "when ${( idx )++}" - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 2) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 3) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 2) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 3) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), '\"then \${idx++}\"', 5, 11, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(2), "${$spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), ( idx )++)}then ")) } @@ -32,7 +32,7 @@ public void $spock_feature_0_0() { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, '\"then \${idx++}\"', 5, 11, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 3) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 3) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_empty_labels.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_empty_labels.groovy index bdf57f9c28..a8d52bacf0 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_empty_labels.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_empty_labels.groovy @@ -8,14 +8,14 @@ class ASpec extends Specification { public void $spock_feature_0_0() { java.lang.Throwable $spock_feature_throwable try { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 2) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 2) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 3) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 3) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 2) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 2) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 3) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 3) } catch (java.lang.Throwable $spock_tmp_throwable) { $spock_feature_throwable = $spock_tmp_throwable @@ -27,8 +27,8 @@ public void $spock_feature_0_0() { if ( $spock_feature_throwable != null) { $spock_failedBlock = this.getSpecificationContext().getCurrentBlock() } - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 4) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 4) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 4) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 4) } catch (java.lang.Throwable $spock_tmp_throwable) { if ( $spock_feature_throwable != null) { diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_labels_and_blocks.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_labels_and_blocks.groovy index 69434818ef..a22c5e5f8a 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_labels_and_blocks.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/BlocksAst/all_observable_blocks_with_labels_and_blocks.groovy @@ -8,16 +8,16 @@ class ASpec extends Specification { public void $spock_feature_0_0() { java.lang.Throwable $spock_feature_throwable try { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 2) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 2) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 3) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 3) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 4) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 4) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 2) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 2) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 3) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 3) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 4) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 4) } catch (java.lang.Throwable $spock_tmp_throwable) { $spock_feature_throwable = $spock_tmp_throwable @@ -29,8 +29,8 @@ public void $spock_feature_0_0() { if ( $spock_feature_throwable != null) { $spock_failedBlock = this.getSpecificationContext().getCurrentBlock() } - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 5) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 5) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 5) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 5) } catch (java.lang.Throwable $spock_tmp_throwable) { if ( $spock_feature_throwable != null) { diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/CleanupBlocksAstSpec/cleanup_rewrite_keeps_correct_method_reference.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/CleanupBlocksAstSpec/cleanup_rewrite_keeps_correct_method_reference.groovy index 12acd40e97..5c50479987 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/CleanupBlocksAstSpec/cleanup_rewrite_keeps_correct_method_reference.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/CleanupBlocksAstSpec/cleanup_rewrite_keeps_correct_method_reference.groovy @@ -13,10 +13,10 @@ public void $spock_feature_0_0() { java.lang.Object foobar java.lang.Throwable $spock_feature_throwable try { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) foobar = this.foobar() - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) try { org.spockframework.runtime.SpockRuntime.verifyMethodCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'println(foobar)', 6, 3, null, this, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), 'println'), new java.lang.Object[]{$spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), foobar)}, $spock_valueRecorder.realizeNas(4, false), false, 3) } @@ -24,7 +24,7 @@ public void $spock_feature_0_0() { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'println(foobar)', 6, 3, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) } catch (java.lang.Throwable $spock_tmp_throwable) { $spock_feature_throwable = $spock_tmp_throwable @@ -36,9 +36,9 @@ public void $spock_feature_0_0() { if ( $spock_feature_throwable != null) { $spock_failedBlock = this.getSpecificationContext().getCurrentBlock() } - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 2) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 2) foobar.size() - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 2) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 2) } catch (java.lang.Throwable $spock_tmp_throwable) { if ( $spock_feature_throwable != null) { diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/CleanupBlocksAstSpec/cleanup_rewrite_keeps_correct_method_reference_for_multi_assignments.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/CleanupBlocksAstSpec/cleanup_rewrite_keeps_correct_method_reference_for_multi_assignments.groovy index 9b4a45cfc3..66ebf79c64 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/CleanupBlocksAstSpec/cleanup_rewrite_keeps_correct_method_reference_for_multi_assignments.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/CleanupBlocksAstSpec/cleanup_rewrite_keeps_correct_method_reference_for_multi_assignments.groovy @@ -13,10 +13,10 @@ public void $spock_feature_0_0() { def (java.lang.Object foobar, java.lang.Object b) = [null, null] java.lang.Throwable $spock_feature_throwable try { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) (foobar, b) = this.foobar() - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) try { org.spockframework.runtime.SpockRuntime.verifyMethodCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'println(foobar)', 6, 3, null, this, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), 'println'), new java.lang.Object[]{$spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), foobar)}, $spock_valueRecorder.realizeNas(4, false), false, 3) } @@ -24,7 +24,7 @@ public void $spock_feature_0_0() { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'println(foobar)', 6, 3, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) } catch (java.lang.Throwable $spock_tmp_throwable) { $spock_feature_throwable = $spock_tmp_throwable @@ -36,9 +36,9 @@ public void $spock_feature_0_0() { if ( $spock_feature_throwable != null) { $spock_failedBlock = this.getSpecificationContext().getCurrentBlock() } - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 2) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 2) foobar.size() - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 2) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 2) } catch (java.lang.Throwable $spock_tmp_throwable) { if ( $spock_feature_throwable != null) { diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataAstSpec/multi_parameterization.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataAstSpec/multi_parameterization.groovy index 201d1c5fd8..5f8070d8fd 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataAstSpec/multi_parameterization.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataAstSpec/multi_parameterization.groovy @@ -8,7 +8,7 @@ class ASpec extends Specification { public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b) { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'a == b', 1, 83, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(2), $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), a) == $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), b))) } @@ -16,7 +16,7 @@ public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b) { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'a == b', 1, 83, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataAstSpec/nested_multi_parameterization.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataAstSpec/nested_multi_parameterization.groovy index 215215d6ce..8dfb9a8902 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataAstSpec/nested_multi_parameterization.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataAstSpec/nested_multi_parameterization.groovy @@ -8,7 +8,7 @@ class ASpec extends Specification { public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b) { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'a == b', 1, 83, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(2), $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), a) == $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), b))) } @@ -16,7 +16,7 @@ public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b) { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'a == b', 1, 83, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[0].groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[0].groovy index 3ad733861b..c958c492df 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[0].groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[0].groovy @@ -7,7 +7,7 @@ class ASpec extends Specification { public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b, java.lang.Object c) { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'true', 2, 7, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), true)) } @@ -15,7 +15,7 @@ public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b, java.lang org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'true', 2, 7, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[1].groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[1].groovy index 3ad733861b..c958c492df 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[1].groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[1].groovy @@ -7,7 +7,7 @@ class ASpec extends Specification { public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b, java.lang.Object c) { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'true', 2, 7, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), true)) } @@ -15,7 +15,7 @@ public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b, java.lang org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'true', 2, 7, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[2].groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[2].groovy index 3ad733861b..c958c492df 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[2].groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/data_tables_with__separators_can_be_combined-[2].groovy @@ -7,7 +7,7 @@ class ASpec extends Specification { public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b, java.lang.Object c) { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'true', 2, 7, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), true)) } @@ -15,7 +15,7 @@ public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b, java.lang org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'true', 2, 7, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/filter_block_becomes_its_own_method.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/filter_block_becomes_its_own_method.groovy index eb157c19b4..5703093d13 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/filter_block_becomes_its_own_method.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/DataTablesAstSpec/filter_block_becomes_its_own_method.groovy @@ -7,7 +7,7 @@ class ASpec extends Specification { public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b) { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'true', 2, 7, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), true)) } @@ -15,7 +15,7 @@ public void $spock_feature_0_0(java.lang.Object a, java.lang.Object b) { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'true', 2, 7, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) this.getSpecificationContext().getMockController().leaveScope() } diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/collection_condition_matchCollectionsAsSet_is_transformed_correctly.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/collection_condition_matchCollectionsAsSet_is_transformed_correctly.groovy index e11a1a15e8..b1038ef214 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/collection_condition_matchCollectionsAsSet_is_transformed_correctly.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/collection_condition_matchCollectionsAsSet_is_transformed_correctly.groovy @@ -8,10 +8,10 @@ class ASpec extends Specification { public void $spock_feature_0_0() { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.lang.Object x = [1] - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) try { org.spockframework.runtime.SpockRuntime.verifyMethodCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'x =~ [1]', 4, 9, null, org.spockframework.runtime.SpockRuntime, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), 'matchCollectionsAsSet'), new java.lang.Object[]{$spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), x), $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(3), [$spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(2), 1)])}, $spock_valueRecorder.realizeNas(6, false), false, 5) } @@ -19,7 +19,7 @@ public void $spock_feature_0_0() { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'x =~ [1]', 4, 9, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/collection_condition_matchCollectionsInAnyOrder_is_transformed_correctly.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/collection_condition_matchCollectionsInAnyOrder_is_transformed_correctly.groovy index 6e11bd81a6..266ad18ba2 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/collection_condition_matchCollectionsInAnyOrder_is_transformed_correctly.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/collection_condition_matchCollectionsInAnyOrder_is_transformed_correctly.groovy @@ -8,10 +8,10 @@ class ASpec extends Specification { public void $spock_feature_0_0() { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.lang.Object x = [1] - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) try { org.spockframework.runtime.SpockRuntime.verifyMethodCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'x ==~ [1]', 4, 9, null, org.spockframework.runtime.SpockRuntime, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), 'matchCollectionsInAnyOrder'), new java.lang.Object[]{$spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), x), $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(3), [$spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(2), 1)])}, $spock_valueRecorder.realizeNas(6, false), false, 5) } @@ -19,7 +19,7 @@ public void $spock_feature_0_0() { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'x ==~ [1]', 4, 9, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/regex_find_conditions_are_transformed_correctly.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/regex_find_conditions_are_transformed_correctly.groovy index 00647881b6..a7702be146 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/regex_find_conditions_are_transformed_correctly.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/regex_find_conditions_are_transformed_correctly.groovy @@ -8,10 +8,10 @@ class ASpec extends Specification { public void $spock_feature_0_0() { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.lang.Object x = '[1]' - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'x =~ /\\d/', 4, 9, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(2), org.spockframework.runtime.SpockRuntime.matchCollectionsAsSet($spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), x), $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), '\\d')))) } @@ -19,7 +19,7 @@ public void $spock_feature_0_0() { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'x =~ /\\d/', 4, 9, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/regex_match_conditions_are_transformed_correctly.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/regex_match_conditions_are_transformed_correctly.groovy index 4ce13e20d9..a095e0c2a3 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/regex_match_conditions_are_transformed_correctly.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/CollectionConditionAstSpec/regex_match_conditions_are_transformed_correctly.groovy @@ -8,10 +8,10 @@ class ASpec extends Specification { public void $spock_feature_0_0() { org.spockframework.runtime.ErrorCollector $spock_errorCollector = org.spockframework.runtime.ErrorRethrower.INSTANCE org.spockframework.runtime.ValueRecorder $spock_valueRecorder = new org.spockframework.runtime.ValueRecorder() - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.lang.Object x = 'a1b' - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) try { org.spockframework.runtime.SpockRuntime.verifyCondition($spock_errorCollector, $spock_valueRecorder.reset(), 'x ==~ /a\\db/', 4, 9, null, $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(2), org.spockframework.runtime.SpockRuntime.matchCollectionsInAnyOrder($spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(0), x), $spock_valueRecorder.record($spock_valueRecorder.startRecordingValue(1), 'a\\db')))) } @@ -19,7 +19,7 @@ public void $spock_feature_0_0() { org.spockframework.runtime.SpockRuntime.conditionFailedWithException($spock_errorCollector, $spock_valueRecorder, 'x ==~ /a\\db/', 4, 9, null, $spock_condition_throwable)} finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/ExceptionConditionsAstSpec/thrown_rewrite_keeps_correct_method_reference.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/ExceptionConditionsAstSpec/thrown_rewrite_keeps_correct_method_reference.groovy index 2a5315379b..8977bec80f 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/ExceptionConditionsAstSpec/thrown_rewrite_keeps_correct_method_reference.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/ExceptionConditionsAstSpec/thrown_rewrite_keeps_correct_method_reference.groovy @@ -9,7 +9,7 @@ public java.lang.Object foobar() { public void $spock_feature_0_0() { java.lang.Object foobar - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) this.getSpecificationContext().setThrownException(null) try { foobar = this.foobar() @@ -19,10 +19,10 @@ public void $spock_feature_0_0() { } finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) this.thrownImpl(null, null, java.lang.IllegalStateException) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/ExceptionConditionsAstSpec/thrown_rewrite_keeps_correct_method_reference_for_multi_assignments.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/ExceptionConditionsAstSpec/thrown_rewrite_keeps_correct_method_reference_for_multi_assignments.groovy index 9a592abdd8..0a302a10ce 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/ExceptionConditionsAstSpec/thrown_rewrite_keeps_correct_method_reference_for_multi_assignments.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/condition/ExceptionConditionsAstSpec/thrown_rewrite_keeps_correct_method_reference_for_multi_assignments.groovy @@ -9,7 +9,7 @@ public java.lang.Object foobar() { public void $spock_feature_0_0() { def (java.lang.Object foobar, java.lang.Object b) = [null, null] - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) this.getSpecificationContext().setThrownException(null) try { (foobar, b) = this.foobar() @@ -19,10 +19,10 @@ public void $spock_feature_0_0() { } finally { } - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) this.thrownImpl(null, null, java.lang.IllegalStateException) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/ diff --git a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/mock/MocksAstSpec/simple_interaction.groovy b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/mock/MocksAstSpec/simple_interaction.groovy index 4a79964dc0..d1e0a23ccd 100644 --- a/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/mock/MocksAstSpec/simple_interaction.groovy +++ b/spock-specs/src/test/resources/snapshots/org/spockframework/smoke/ast/mock/MocksAstSpec/simple_interaction.groovy @@ -6,17 +6,17 @@ class ASpec extends Specification { /*--------- tag::snapshot[] ---------*/ @org.spockframework.runtime.model.FeatureMetadata(name = 'a feature', ordinal = 0, line = 1, blocks = [@org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.SETUP, texts = []), @org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.WHEN, texts = []), @org.spockframework.runtime.model.BlockMetadata(kind = org.spockframework.runtime.model.BlockKind.THEN, texts = [])], parameterNames = []) public void $spock_feature_0_0() { - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 0) java.util.List list = this.MockImpl('list', java.util.List) this.getSpecificationContext().getMockController().enterScope() this.getSpecificationContext().getMockController().addInteraction(new org.spockframework.mock.runtime.InteractionBuilder(8, 5, '1 * list.add(1)').setFixedCount(1).addEqualTarget(list).addEqualMethodName('add').setArgListKind(true, false).addEqualArg(1).build()) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 0) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 1) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 0) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 1) list.add(1) - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 1) - org.spockframework.runtime.SpockRuntime.callBlockEntered(this.getSpecificationContext(), 2) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 1) + org.spockframework.runtime.SpockRuntime.callBlockEntered(this, 2) this.getSpecificationContext().getMockController().leaveScope() - org.spockframework.runtime.SpockRuntime.callBlockExited(this.getSpecificationContext(), 2) + org.spockframework.runtime.SpockRuntime.callBlockExited(this, 2) this.getSpecificationContext().getMockController().leaveScope() } /*--------- end::snapshot[] ---------*/