-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace the use of threadlocal with @Enter annotation
Signed-off-by: Paolo Di Tommaso <[email protected]>
- Loading branch information
1 parent
7e93ba5
commit 5b08799
Showing
4 changed files
with
48 additions
and
28 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
25 changes: 25 additions & 0 deletions
25
src/test/groovy/io/seqera/debug/AllocationContextTest.groovy
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,25 @@ | ||
package io.seqera.debug | ||
|
||
import java.time.Instant | ||
|
||
import spock.lang.Specification | ||
|
||
/** | ||
* | ||
* @author Paolo Di Tommaso <[email protected]> | ||
*/ | ||
class AllocationContextTest extends Specification { | ||
|
||
def 'should create alloc context' () { | ||
when: | ||
def c1 = AllocationContext.create('foo', 1, 2) | ||
|
||
then: | ||
c1.name == 'foo' | ||
c1.size == 1 | ||
c1.address == 2 | ||
c1.createdAt.compareTo(Instant.now())<=0 | ||
c1.stackTrace.startsWith(' java.base/jdk.internal.reflect.NativeMethodAccessorImpl') | ||
} | ||
|
||
} |
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