citrusframework / citrus-db Goto Github PK
View Code? Open in Web Editor NEWDatabase driver and server for relational DBMS simulation via JDBC
License: Apache License 2.0
Database driver and server for relational DBMS simulation via JDBC
License: Apache License 2.0
If you define a XML Result set during a JDBC response, it should look like this:
<dataset>
<row>
<whateverColumn>value</whateverColumn>
</row>
</dataset>
If you leave out the row
tag, the XmlDataSetProducer
does not throw an appropriate exception, which states that the dataset specification is invalid.
Instead, a dataset with empty rows is produced causing a null pointer during data access in the result set.
This makes it hard for the user to find out, that the dataset specification is invalid.
As a citrus-db user, I want to be able to provide a query and a result set via an API or GUI so that the server responds with the result if the query hits the server. This will fasten the way to create rules while testing.
As a citurs-db user, I want to be able to insert a SQL statement into a test field, push a button and get the result from the server, so that I'm able to test my mappings in the server without a DB Client
Callable statements are prepared and executed via JDCB prepareStmt() and execute() method. The execute method does not have a return value. Therefore it is not possible to provide a result set as outcome. The JDBC API is designed to call getResultSet() on the prepared statement in order to retrieve the result set as outcome.
Add possibility in citrus-db-server to provide a result set for callable statements.
As a test designer, I want to be able to specify und which conditions a SQLException should be thrown, to be able to test the behavior of the software in case of an error. In addition, the exceptions should be thrown as an SQLException from the driver implementation.
Hi!
jdbcPreparedStatement.setInt(1, 2);
jdbcPreparedStatement.setInt(1, 42);
Currently the prepared statement would contain two parameters:
If the prepared statement is reused, the 42 should replace the 2 instead of being added.
Hi!
Because the driver is currently not fully implemented, some exceptions might be thrown depending on the interactions between the SQL-Client and the driver. Currently the exception text is "Not Supported". To make it easier to find the required operation, one should add some additional information to the exception messages.
BR,
Sven
User story
As a citrus user, I want to be able to test CallableStatements
with OutParameters
or InOutParameters
so that I'm able to test all of my callable statement implementations.
Additional information
The issue is located in the JdbcCallableStatement within the driver implementation. All out parameter methods are currently not implemented. That's why the parameters are not passed to the server or noted in the requests.
In unserem Tibco SQl Direct versucht TIBCO automatisch getUpdateCount und getMoreResults aufzurufen, die aktuelle Citrus-DB-Treiber Version wirft eine SQLEXception "Not supported JDBC statement function 'getUpdateCount'" bzw. "Not supported JDBC statement function 'getMoreResults'" .
Ich habe den Treiber angepasst und als Rückgabewert für getUpdateCount -1 und für getMoreResults false eingefügt. Dann funktioniert alles ohne Porbleme.
Wäre noch zu prüfen in welchem Fall dieser Fix Probleme bereiten könnte.
Hi!
While trying to test the citrus-db-driver, one found out, that the dependencies are missing in version 0.1.0.
One should add the dependencies to the artifact for the next release.
Workaround
<dependency>
<groupId>com.consol.citrus</groupId>
<artifactId>citrus-db-driver</artifactId>
<version>0.1.0</version>
</dependency>
As a software developer, I want to be able to add a agent implementation to my jvm that redirects the database communication to the citrus jdbc driver, so that I don't have to exchange my jdbc driver.
As a test designer, I want to be able to specify a response delay/timeout behavior of the database server to be able to test resilience use cases
When executing update statements driver throws exception:
java.sql.SQLException: Not supported JDBC prepared statement function 'setClob'"
As a test designer, I want to be able to specify und which conditions a SQLException should be thrown, to be able to test the behavior of the software in case of an error. In addition, the exceptions should be thrown as an SQLException from the driver implementation.
#3 already implemented the embedded variant. Here is the outcome from that issue concerning the standalone server.
thenThrow
with thenRefuse
thenRefuse
accepts no parameter or a Exception
instancecitrus-db-driver module has to package all dependencies to a fat/full jar in order to avoid classpath issues in system under test
As a citurs-db user, I want the citrus-db server to create rules from the communication between a client and a real database, so that I don't have to create rules manually.
As a citrus-db user, I want to be able to use DDL and a given set of data to create scenarios the server will answer, to easily create scenarios from my database schemas.
Due to security issues, com.sparkjava:spark-core should be updated to 2.7.2 or later.
Add file /META-INF/services/java.sql.Driver
holding the full qualified class name of the Driver implementation. This file is used for auto registering the driver without having to use Class.forName()
see also https://docs.oracle.com/javase/7/docs/api/java/sql/DriverManager.html
As a test designer, I want to be able to access the state of the db server through a graphical user interface showing me all stored information, so that I'm able to identify missing scenarios or adapt my tests to the existing ones.
Due to security issues, com.fasterxml.jackson.core:jackson-databind should be updated to 2.9.8 or later.
As a test designer, I want to be able to create, execute and validate stored procedures calls to the database to ensure, that my software is calling the procedures correctly. In addition exceptions should be thrown if the stored procedure does not exist or does not match.
@laura098 commented on Wed Sep 26 2018
The batch update function of tibco is not supported in the citrus jdbc adapter. This function is needed for all inserts that affect more than one row. And all updates which gets a list of different where-clauses.
Please see the attached file for some screenshots.
Best Regards,
Laura
JDBC-Batch Update-Bug.docx
@svettwer commented on Mon Oct 01 2018
Hi!
Yes this is absolutely the case. We've just implemented a set of driver functionality with the idea of extending the driver over time and on demand.
Thx for reporting your demand on this feature! 👍
BR,
Sven
@svettwer commented on Mon Nov 26 2018
Further refinement information:
The interface for batch functionality includes three methods:
void addBatch( String sql ) throws SQLException;
void clearBatch() throws SQLException;
int[] executeBatch() throws SQLException;
executeBatch()
requires some more implementation on driver side to ensure that the updated rows count is simulated accurately. The exchanged Citrus JDBC messages contain the amount of affected rows, so that there should be minimum changes required on server side if any.
When a SUT interacts with the driver and this interaction leads to an exception, it is hard not possible to identify this in a test case. Nor is it possible to make the exception transparent at all, das the exception is part of the SUTs log, which is not in scope of the Citrus test case, suite or general setup.
Therefore, I propose to escalate exceptions to and endpoint of the Citrus JDBC Server and then pass the exception into the test case, so that an issue during driver interaction is escalated to the test case through the JDBC Server.
BR,
Sven
Hallo,
wir haben Probleme mit dem NumberOfUpdates nach einem SQL-Update-Aufruf.
Es werden standardmäßig als NumberOfUpdates 0 zurückgegeben.
Können wir hier selbst etwas anpassen oder liegt das bei euch? Wir prüfen in unserem Programm genau diesen Fall und laufen dadurch immerwieder auf Fehler.
Viele Grüße
Sven
As a test designer, I want to be able to specify test scenarios for transactions including exceptions on commit, to be able to verify the transaction behavior of my application.
Driver gives 0.1.0 as version information - change to 0.1.2
This issue should cleanup some now unnecessary, historically grown index manipulation.
It might cause unnecessary confusion when skimming through the code.
Concerning the scope of this PR it's not required to be updated, but I'd suggest to turn it into an improvement / cleanup issue.
_Originally posted by @s1hofmann in https://github.com/citrusframework/citrus-db/pull/35/files/e7fde80404933913e7d647f7c8324f02e5b4d854#diff-f5ae36b893e151011d2cfe071732d23f
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.