-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restrict '@ExclusiveResources' target to 'TYPE'.
Issue: #2677
- Loading branch information
Vladimir Dmitrienko
committed
Jul 22, 2024
1 parent
b55a937
commit b703172
Showing
9 changed files
with
59 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...c/main/java/org/junit/jupiter/api/parallel/MethodNameBasedExclusiveResourcesProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.junit.jupiter.api.parallel; | ||
|
||
import static org.apiguardian.api.API.Status.STABLE; | ||
|
||
import java.lang.reflect.Method; | ||
import java.util.Collections; | ||
import java.util.Set; | ||
|
||
import org.apiguardian.api.API; | ||
|
||
// Which 'status' and 'since' values should I use? | ||
@API(status = STABLE, since = "?") | ||
public final class MethodNameBasedExclusiveResourcesProvider implements ExclusiveResourcesProvider { | ||
|
||
private static final ExclusiveResource LOCK = ExclusiveResource.readWriteLockOf("method_lock"); | ||
|
||
public MethodNameBasedExclusiveResourcesProvider() { | ||
} | ||
|
||
@Override | ||
public Set<ExclusiveResource> provideForMethod(Method testMethod) { | ||
if (testMethod.getName().contains("give_me_lock")) { | ||
return Collections.singleton(LOCK); | ||
} | ||
return Collections.emptySet(); | ||
} | ||
} |
41 changes: 0 additions & 41 deletions
41
...upiter-api/src/main/java/org/junit/jupiter/api/parallel/MyExclusiveResourcesProvider.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 0 additions & 71 deletions
71
...g/junit/platform/engine/support/hierarchical/ExclusiveResourcesProviderOnMethodTests.java
This file was deleted.
Oops, something went wrong.
68 changes: 0 additions & 68 deletions
68
...it/platform/engine/support/hierarchical/ExclusiveResourcesProviderOnNestedClassTests.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters