-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing compilation errors and adding tests
- Loading branch information
Showing
7 changed files
with
177 additions
and
45 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
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
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
39 changes: 39 additions & 0 deletions
39
data-tck/src/main/groovy/io/micronaut/data/tck/TestSqlExecutionObserver.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,39 @@ | ||
package io.micronaut.data.tck | ||
|
||
import io.micronaut.data.model.DataType | ||
import io.micronaut.data.runtime.operations.internal.sql.SqlExecutionObserver | ||
import jakarta.inject.Singleton | ||
|
||
@Singleton | ||
class TestSqlExecutionObserver implements SqlExecutionObserver { | ||
public List<Invocation> invocations = new ArrayList<>() | ||
|
||
@Override | ||
void query(String query) { | ||
invocations.add(new Invocation(query)) | ||
} | ||
|
||
@Override | ||
void parameter(int index, Object value, DataType datatype) { | ||
invocations.last().parameters[index] = value | ||
} | ||
|
||
@Override | ||
void updatedRecords(Number result) { | ||
invocations.last().affected = result | ||
} | ||
|
||
void clear() { | ||
invocations.clear() | ||
} | ||
|
||
class Invocation { | ||
String query | ||
Map<Integer, Object> parameters = [:] | ||
Number affected | ||
|
||
Invocation(String query) { | ||
this.query = query | ||
} | ||
} | ||
} |
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