Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
211010717
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
211010717
Commits
2bd39c9e
Unverified
Commit
2bd39c9e
authored
4 years ago
by
张嘉伟
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
optimize: optimize StatementProxyTest unit test (#3383)
parent
5d4c9915
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rm-datasource/src/test/java/io/seata/rm/datasource/StatementProxyTest.java
+9
-0
9 additions, 0 deletions
.../test/java/io/seata/rm/datasource/StatementProxyTest.java
with
9 additions
and
0 deletions
rm-datasource/src/test/java/io/seata/rm/datasource/StatementProxyTest.java
+
9
−
0
View file @
2bd39c9e
...
...
@@ -30,12 +30,15 @@ import com.google.common.collect.Lists;
import
io.seata.common.loader.EnhancedServiceLoader
;
import
io.seata.rm.datasource.mock.MockConnection
;
import
io.seata.rm.datasource.mock.MockDriver
;
import
io.seata.sqlparser.SQLRecognizerFactory
;
import
io.seata.sqlparser.SqlParserType
;
import
io.seata.sqlparser.druid.DruidDelegatingSQLRecognizerFactory
;
import
io.seata.sqlparser.druid.SQLOperateRecognizerHolder
;
import
io.seata.sqlparser.druid.SQLOperateRecognizerHolderFactory
;
import
io.seata.sqlparser.util.JdbcConstants
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.Assertions
;
import
org.junit.jupiter.api.BeforeAll
;
import
org.junit.jupiter.api.MethodOrderer
;
...
...
@@ -93,6 +96,11 @@ public class StatementProxyTest {
.
load
(
SQLRecognizerFactory
.
class
,
SqlParserType
.
SQL_PARSER_TYPE_DRUID
);
}
@AfterEach
public
void
clear
()
throws
SQLException
{
statementProxy
.
clearBatch
();
}
@Test
public
void
testStatementProxy
()
{
Assertions
.
assertNotNull
(
statementProxy
);
...
...
@@ -116,6 +124,7 @@ public class StatementProxyTest {
Assertions
.
assertDoesNotThrow
(()
->
statementProxy
.
execute
(
sql
,
new
int
[]{
1
}));
Assertions
.
assertDoesNotThrow
(()
->
statementProxy
.
execute
(
sql
,
new
String
[]{
"id"
}));
Assertions
.
assertDoesNotThrow
(()
->
statementProxy
.
executeBatch
());
Assertions
.
assertDoesNotThrow
(()
->
statementProxy
.
clearBatch
());
}
@Test
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment