mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-27 21:01:15 +08:00
Add thread safety test for ConstructorExpression
This commit is contained in:
parent
0d2a6e4eba
commit
1833e64855
@ -19,6 +19,7 @@ import java.util.Arrays;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.querydsl.core.testutil.ThreadSafety;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.core.types.dsl.StringPath;
|
||||
|
||||
@ -101,4 +102,16 @@ public class ConstructorExpressionTest {
|
||||
assertEquals("1234", projection.text);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void threadSafety() {
|
||||
final ConstructorExpression<String> expr = Projections.constructor(String.class);
|
||||
Runnable invoker = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
expr.newInstance();
|
||||
}
|
||||
};
|
||||
ThreadSafety.check(invoker, invoker);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user