-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix-waiting-for-start-replaying'
# Conflicts: # pom.xml # protocol-common-jdbc/src/main/java/org/kendar/plugins/JdbcRecordPlugin.java # protocol-common/src/main/java/org/kendar/plugins/JdbcReplayingPlugin.java # protocol-common/src/main/java/org/kendar/plugins/MockPlugin.java # protocol-common/src/main/java/org/kendar/plugins/PluginDescriptor.java # protocol-common/src/main/java/org/kendar/plugins/ProtocolPluginDescriptor.java # protocol-common/src/main/java/org/kendar/plugins/RecordPlugin.java # protocol-common/src/main/java/org/kendar/plugins/ReplayPlugin.java # protocol-common/src/main/java/org/kendar/plugins/RewritePlugin.java # protocol-common/src/main/java/org/kendar/storage/FileStorageRepository.java # protocol-common/src/main/java/org/kendar/storage/NullStorageRepository.java # protocol-common/src/main/java/org/kendar/storage/generic/StorageRepository.java # protocol-http/src/main/java/org/kendar/http/plugins/HttpErrorPlugin.java # protocol-http/src/main/java/org/kendar/http/plugins/HttpLatencyPlugin.java # protocol-http/src/main/java/org/kendar/http/plugins/HttpRateLimitPlugin.java # protocol-http/src/main/java/org/kendar/http/plugins/HttpRecordPlugin.java # protocol-http/src/main/java/org/kendar/http/plugins/HttpReplayPlugin.java # protocol-http/src/test/java/org/kendar/http/BasicTest.java # protocol-http/src/test/java/org/kendar/http/ReplayRecordFilters.java # protocol-http/src/test/java/org/kendar/http/RewriterPluginTest.java # protocol-http/src/test/java/org/kendar/http/SimpleTest.java # protocol-mysql/src/test/java/org/kendar/mysql/BasicTest.java # protocol-postgres/src/test/java/org/kendar/postgres/BasicTest.java # protocol-runner/src/main/java/org/kendar/Main.java # protocol-runner/src/main/java/org/kendar/command/Amqp091Runner.java # protocol-runner/src/main/java/org/kendar/command/HttpRunner.java # protocol-runner/src/main/java/org/kendar/command/JdbcRunner.java # protocol-runner/src/main/java/org/kendar/command/MongoRunner.java # protocol-runner/src/main/java/org/kendar/command/MqttRunner.java # protocol-runner/src/main/java/org/kendar/command/RedisRunner.java # sample-plugins/src/main/java/org/kendar/sample/plugins/Amqp091Filter.java # sample-plugins/src/main/java/org/kendar/sample/plugins/HttpFilter.java # sample-plugins/src/main/java/org/kendar/sample/plugins/PostgresFilter.java
- Loading branch information
Showing
105 changed files
with
1,779 additions
and
11,321 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
5 changes: 3 additions & 2 deletions
5
...amqp/v09/plugins/AmqpRecordingPlugin.java → ...ar/amqp/v09/plugins/AmqpRecordPlugin.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.kendar.protocol</groupId> | ||
<artifactId>protocol-master</artifactId> | ||
<version>${revision}</version> | ||
</parent> | ||
|
||
<artifactId>protocol-common-jdbc</artifactId> | ||
|
||
<properties> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.pf4j</groupId> | ||
<artifactId>pf4j</artifactId> | ||
<version>${pl4j.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.xml.bind</groupId> | ||
<artifactId>jaxb-api</artifactId> | ||
<version>${jaxb.api.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kendar.protocol</groupId> | ||
<artifactId>protocol-common</artifactId> | ||
<version>${revision}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.kendar.protocol</groupId> | ||
<artifactId>protocol-test</artifactId> | ||
<version>${revision}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
protocol-common-jdbc/src/main/java/org/kendar/plugins/JdbcReplayPlugin.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,33 @@ | ||
package org.kendar.plugins; | ||
|
||
import org.kendar.plugins.settings.BasicReplayPluginSettings; | ||
import org.kendar.protocol.context.ProtoContext; | ||
import org.kendar.proxy.PluginContext; | ||
import org.kendar.sql.jdbc.SelectResult; | ||
import org.kendar.sql.jdbc.proxy.JdbcCall; | ||
import org.kendar.sql.jdbc.storage.JdbcResponse; | ||
import org.kendar.storage.generic.LineToRead; | ||
|
||
public abstract class JdbcReplayPlugin extends ReplayPlugin<BasicReplayPluginSettings>{ | ||
|
||
public abstract String getProtocol(); | ||
|
||
@Override | ||
protected void buildState(PluginContext pluginContext, ProtoContext context, Object in, Object outputItem, Object aClass, LineToRead lineToRead) { | ||
var outObj = (SelectResult)aClass; | ||
var req = (JdbcCall)in; | ||
if (lineToRead != null && lineToRead.getStorageItem() != null | ||
&& lineToRead.getStorageItem().getOutput() != null) { | ||
var source = lineToRead.getStorageItem().retrieveOutAs(JdbcResponse.class); | ||
outObj.fill(source.getSelectResult()); | ||
} else if (lineToRead != null && lineToRead.getCompactLine() != null) {// if(in.getQuery().trim().toLowerCase().startsWith("set")){ | ||
//completedIndexes.add((int) lineToRead.getCompactLine().getIndex()); | ||
if (lineToRead.getCompactLine().getTags().get("isIntResult").equalsIgnoreCase("true")) { | ||
SelectResult resultset = new SelectResult(); | ||
resultset.setIntResult(true); | ||
resultset.setCount(Integer.parseInt(lineToRead.getCompactLine().getTags().get("resultsCount"))); | ||
outObj.fill(resultset); | ||
} | ||
} | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.