GithubHelp home page GithubHelp logo

dbfit / dbfit Goto Github PK

View Code? Open in Web Editor NEW
227.0 40.0 90.0 6.92 MB

DbFit is a database testing framework that supports easy test-driven development of your database code.

Home Page: http://dbfit.github.io/dbfit

License: GNU General Public License v2.0

CSS 2.23% JavaScript 3.51% Shell 3.47% Ruby 0.83% Java 84.20% PLSQL 2.07% C 0.18% HTML 2.27% Batchfile 0.01% PLpgSQL 0.21% TSQL 1.02%

dbfit's Introduction

dbfit's People

Contributors

anaclcastro avatar avskor avatar benilovj avatar bhuesemann avatar crasu avatar dependabot[bot] avatar gojko avatar hal9ccc avatar igieon avatar javornikolov avatar jeremysimmons avatar jmirc avatar marcusrehm avatar markhop avatar mikepatrick avatar mitchelldavis avatar mmatten avatar nickolay avatar nickpileggi947 avatar pal avatar pascalsem avatar pstnotpd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbfit's Issues

Add support for expressing expectations of Exceptions

Would be good if we can express tests for database calls (something like JUnit's @test (expected=...). This could be useful for many statements:

  • insert/update - we may expect some trigger to fire error; or unique constraint violation to be faced
  • stored procedure may explicitly raise exception based on business rule
  • table query may be expected to fail confirming our lack of permissions
  • others

Matching exception by various attributes (error code, message, etc) would be useful so that we can clarify specifics of the expected exception. (http://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html)

  • Pattern matching (e.g. by regexp) may be handy (this may appear to be useful for other kinds of tests)

Insert table: unclear stack trace when one parameter doesn't exist

image

The exception:

java.lang.NullPointerException
  at dbfit.api.DbTable.getDbParameterAccessor(DbTable.java:32)
  at dbfit.fixture.DbObjectExecutionFixture.getAccessors(DbObjectExecutionFixture.java:87)
  at dbfit.fixture.DbObjectExecutionFixture.doRows(DbObjectExecutionFixture.java:62)
  at fit.Fixture.doTable(Fixture.java:154)
  at fitlibrary.traverse.AlienTraverseHandler.doTable(AlienTraverseHandler.java:18)
  at fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretWholeTable(DoTraverseInterpreter.java:99)
  at fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretWholeTable(DoTraverseInterpreter.java:87)
  at fitlibrary.DoFixture.interpretWholeTable(DoFixture.java:69)
  at fitlibrary.suite.InFlowPageRunner.run(InFlowPageRunner.java:34)
  at fitlibrary.DoFixture.interpretTables(DoFixture.java:42)
  at dbfit.DatabaseTest.interpretTables(DatabaseTest.java:25)
  at fit.Fixture.doTables(Fixture.java:80)
  at fit.FitServer.process(FitServer.java:81)
  at fit.FitServer.run(FitServer.java:56)
  at fit.FitServer.main(FitServer.java:41)

Bump FitLibrary version up

Latest version of FitLibrary seems to be 2.0 (from year 2011) while dbfit is still based on an older release from 2008. Maybe would be good to bump it up in dbfit.
(I've been using dbfit 1.1 with FitLibrary 2.0 past year - I haven't faced issues)

Add useful recipe for measuring performance with dbfit

!|dbfit.OracleTest|

!|Connect|localhost:1521|dftest|dftest|XE|

|set parameter|threshold|10|

!|query|select TO_CHAR(SYSTIMESTAMP, 'SSSSS') AS start_time FROM DUAL|
|start_time?                                                         |
|>>start_time                                                        |

!|execute procedure|ConcatenateStrings        |
|firstString       |secondString|concatenated?|
|a                 |b           |a b          |

!|query|SELECT (TO_CHAR(SYSTIMESTAMP, 'SSSSS') - :start_time) AS duration FROM DUAL|
|duration?                                                                         |
|>>duration                                                                        |

!|query stats|
|query|is empty?|
|SELECT :duration FROM DUAL WHERE :duration > :threshold|yes|

Oracle: Unclear stacktrace when the JDBC connector is missing

e.g. for Oracle, if the ojdbc jar is missing, the following occurs:

java.lang.NoClassDefFoundError: oracle/sql/TIMESTAMP
    at dbfit.environment.OracleEnvironment.(OracleEnvironment.java:86)
    at dbfit.OracleTest.(OracleTest.java:7)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at fit.FixtureClass.newInstance(FixtureClass.java:24)
    at fit.FixtureLoader.instantiateFixture(FixtureLoader.java:62)
    at fit.FixtureLoader.instantiateFirstValidFixtureClass(FixtureLoader.java:84)
    at fit.FixtureLoader.disgraceThenLoad(FixtureLoader.java:44)
    at fit.Fixture.loadFixture(Fixture.java:141)
    at fit.Fixture.getLinkedFixtureWithArgs(Fixture.java:133)
    at fit.Fixture.doTables(Fixture.java:78)
    at fit.FitServer.process(FitServer.java:81)
    at fit.FitServer.run(FitServer.java:56)
    at fit.FitServer.main(FitServer.java:41)
Caused by: java.lang.ClassNotFoundException: oracle.sql.TIMESTAMP
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 18 more

It might be good to have a self-test of some kind which checks the presence of the driver and falls over if it's unavailable.

Oracle JDBC version - 11gR2 version should be used instead of 10g

I see current README is still referring to 10g version of JDBC drivers.

I would suggest using latest version (currently for 11.2.0.3) - jar file name is ojdbc6.jar. The 10g one had some issue/limitation with Date fields containing non-zero time part (FAQ page as Why does DbFit not see the time portion of my Date fields?)

(The 11.2 JDBC used to work fine for me with the previous version of dbfit in a setup config as I posted on dbfit google group: https://groups.google.com/d/topic/dbfit/mHjSDTKWGcg/discussion. I haven' tried it with dbfit 2.0 though - I'll try and give a feedback here soon).

Missing docs: helping users get started with appropriate DbFit implementation

Users have (justifiably, IMHO), asking which is the appropriate DbFit implementation for them. This isn't really explained anywhere, as far as I can see, which I would like to correct.

I am thinking to post something along these lines:


Which DbFit?

I'm new to FitNesse

I want to only test database code:

  • MySql
  • PostgreSQL
  • Oracle, etc.... => DbFit 2.0
  • SQL Server => FitSharp

I want to combine database and application interaction in the same test:

  • My team does Java (or another JVM language) => DbFit 2.0
  • My team does C#/VB.NET (or another CLR language) => FitSharp
  • My team does Ruby => currently not supported

I already use FitNesse

I want to test databases and application code, but not in the same test:

  • MySql
  • PostgreSQL
  • Oracle, etc.... => DbFit 2.0
  • SQL Server => FitSharp

I want to combine database and application fixtures in the same test:

  • I use Fit => DbFit 2.0
  • I use Slim => currently not supported
  • I use FitLibrary/FLW => FitLibrary 2.0
  • I use FitSharp => FitSharp

cc @jediwhale @MMatten @gojko : does that look sensible? Any corrections?

Execute procedure: double stacktrace when number of parameters doesn't match procedure

image

The stacktrace:

java.lang.Error: java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BY_REGION'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

  at dbfit.fixture.DbObjectExecutionFixture.doRows(DbObjectExecutionFixture.java:72)
  at fit.Fixture.doTable(Fixture.java:154)
  at fitlibrary.traverse.AlienTraverseHandler.doTable(AlienTraverseHandler.java:18)
  at fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretWholeTable(DoTraverseInterpreter.java:99)
  at fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretWholeTable(DoTraverseInterpreter.java:87)
  at fitlibrary.DoFixture.interpretWholeTable(DoFixture.java:69)
  at fitlibrary.suite.InFlowPageRunner.run(InFlowPageRunner.java:34)
  at fitlibrary.DoFixture.interpretTables(DoFixture.java:42)
  at dbfit.DatabaseTest.interpretTables(DatabaseTest.java:25)
  at fit.Fixture.doTables(Fixture.java:80)
  at fit.FitServer.process(FitServer.java:81)
  at fit.FitServer.run(FitServer.java:56)
  at fit.FitServer.main(FitServer.java:41)
Caused by: java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BY_REGION'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
  at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
  at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:218)
  at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:969)
  at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
  at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
  at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3476)
  at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4400)
  at dbfit.fixture.DbObjectExecutionFixture.doRows(DbObjectExecutionFixture.java:59)
  ... 12 more

Connecting to Teradata using LDAP

From #7:

"From looking at TeradataEnvironment.java it seems like it's using the wrong authorization mechanism - the default is TD and we're using LDAP. According to http://terahelp.blogspot.no/2009/08/connecting-to-database-using-teradata.html this is a simple parameter you can add to the JDBC connection string. I tried specifying the database parameter as "databasename,LOGMECH=LDAP" and then it connected perfectly."

This should be handled in code and/or documented.

Postgres Modules Strange Build Behaviour

When building the postgre module I have a bit of an anomoly. If I run mvn package from dbfit/dbfit-java then the dbdeploy plugin fails as it cannot find the org.postgres.Driver class.

[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 2 source files to C:\Users\Mark\Documents\GitHub\dbfit\dbfit-java\postgre\target\classes
[INFO] [dbdeploy:update {execution: default}]
dbdeploy 3.0M3
[ERROR]
java.lang.ClassNotFoundException: org.postgresql.Driver
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
        at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
        at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
        at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

However if I run it from the postgre directory it works

C:\Users\Mark\Documents\GitHub\dbfit\dbfit-java\postgre>mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building DBFit PostGreSQL engine
[INFO]    task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\Mark\Documents\GitHub\dbfit\dbfit-java\postgre\src\main\resources
Downloading: http://repo1.maven.org/maven2/org/fitnesse/fitlibrary/20081102/fitlibrary-20081102.pom
[INFO] Unable to find resource 'org.fitnesse:fitlibrary:pom:20081102' in repository maven-central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/fitnesse/fitlibrary/20081102/fitlibrary-20081102.pom
[INFO] Unable to find resource 'org.fitnesse:fitlibrary:pom:20081102' in repository central (http://repo1.maven.org/maven2)
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [dbdeploy:update {execution: default}]
dbdeploy 3.0M3
Reading change scripts from directory C:\Users\Mark\Documents\GitHub\dbfit\dbfit-java\postgre\src\test\resources...
Changes currently applied to database:
  1
Scripts available:
  1
To be applied:
  (none)
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 1 source file to C:\Users\Mark\Documents\GitHub\dbfit\dbfit-java\postgre\target\test-classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: C:\Users\Mark\Documents\GitHub\dbfit\dbfit-java\postgre\target\surefire-reports

Do you also see this behaviour or is it just me?

Work through synonyms fails

When working through synonyms (in Oracle db) - attempt to work with them results in errors. E.g. - in following example DEMOTABLE is synonym to table in another schema:

|insert|DEMOTABLE|
|ID    |STATUS|
|1     |Success|

It fails:

java.sql.SQLException: Cannot retrieve list of columns for DEMOTABLE - check spelling and access rights
    at dbfit.api.DbTable.(DbTable.java:19)
    at dbfit.fixture.Insert.getTargetDbObject(Insert.java:33)
    at dbfit.fixture.DbObjectExecutionFixture.doRows(DbObjectExecutionFixture.java:56)
    at fit.Fixture.doTable(Fixture.java:154)
    at fitlibrary.traverse.AlienTraverseHandler.doTable(AlienTraverseHandler.java:18)
    at fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretWholeTable(DoTraverseInterpreter.java:99)
    at fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretWholeTable(DoTraverseInterpreter.java:87)
    at fitlibrary.DoFixture.interpretWholeTable(DoFixture.java:69)
    at fitlibrary.suite.InFlowPageRunner.run(InFlowPageRunner.java:34)
    at fitlibrary.DoFixture.interpretTables(DoFixture.java:42)
    at dbfit.DatabaseTest.interpretTables(DatabaseTest.java:25)
    at fit.Fixture.doTables(Fixture.java:80)
    at fit.FitServer.process(FitServer.java:81)
    at fit.FitServer.run(FitServer.java:56)
    at fit.FitServer.main(FitServer.java:41)

Slim support

The background

Currently, as the name would suggest, DbFit only supports the Fit test system for FitNesse. This feature is about adding Slim test system (note that we don't want to drop Fit support any time soon).

The main complexity of this feature will come from having to untangle the Fit-specific table and data type parsing from the test-framework part of the DbFit core.

Another current unknown is how DbFit's flow mode will translate to Slim; flow mode makes sure that the test automatically executes in a transaction, so that the user doesn't have to worry about it.

Definition of Done

This is a substancial piece of work to do cleanly, involving the following:

  • an initial spike to figure out how flow mode will work in Slim
  • defining a DbFit-equivalent syntax in Slim. This is analysis work which involves:
    • learning what's possible within Slim
    • identifying the least-noisy syntax to achieve the same thing as in DbFit)
  • separating the database and Fit-specific logic in classes within the core component (currently, there's quite tight coupling in a few places) - this is Java refactoring work.
  • implementing the Slim fixtures
  • porting the acceptance tests to Slim

This feature will involve touching most of the core of DbFit. I would like to use this opportunity to pay back a lot of tech debt, specifically:

  • introduce better separation of the following concerns (ie distinct, separate classes and packages):
    • the table parsing
    • test framework code
    • database access parts of dbfit should all be distinct)
  • introduce unit tests

The proposed technical approach

I would like to apply an acceptance-test-driven approach:

  1. pick a existing DbFit acceptance test from the Derby test suite (Derby because it's the only test suite that's in pure java, making it suitable to run outside of the VM).
  2. define the equivalent Slim FitNesse page
  3. stub out enough of the Slim fixtures for the test to fail (as opposed to raising exceptions)
  4. refactor the existing Fit-based code to allow clean integration with the Slim fixtures
  5. wire up the Slim fixtures until the test passes
  6. repeat steps 1-5 with the next Derby test, etc

Create a "DbFit features and patterns with examples" page

Suggestions by @MMatten:

I guess more of a tutorial than the dbfit acceptance tests. But in particular:

  • stored units
  • stored proc output to db tables
  • stored proc output to out-params
  • stored proc output result set
  • stored functions
  • data Set Up and Tear Down.
  • Standalone vs flow mode
  • integrating with ETL tools

Query table doesn't provide good feedback when there is an SQL error

image

There is STDERR output in this case:

 java.sql.SQLException: ORA-00942: table or view does not exist

  at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
  at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
  at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
  at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:813)
  at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1049)
  at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:854)
  at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1154)
  at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
  at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3415)
  at dbfit.fixture.Query.getDataTable(Query.java:42)
  at dbfit.fixture.RowSetFixture.doRows(RowSetFixture.java:78)
  at fit.Fixture.doTable(Fixture.java:154)
  at fitlibrary.traverse.AlienTraverseHandler.doTable(AlienTraverseHandler.java:18)
  at fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretWholeTable(DoTraverseInterpreter.java:99)
  at fitlibrary.traverse.workflow.DoTraverseInterpreter.interpretWholeTable(DoTraverseInterpreter.java:87)
  at fitlibrary.DoFixture.interpretWholeTable(DoFixture.java:69)
  at fitlibrary.suite.InFlowPageRunner.run(InFlowPageRunner.java:34)
  at fitlibrary.DoFixture.interpretTables(DoFixture.java:42)
  at dbfit.DatabaseTest.interpretTables(DatabaseTest.java:25)
  at fit.Fixture.doTables(Fixture.java:80)
  at fit.FitServer.process(FitServer.java:81)
  at fit.FitServer.run(FitServer.java:56)
  at fit.FitServer.main(FitServer.java:41)

java.lang.NoClassDefFoundError: oracle/sql/TIMESTAMP Oracle test error in RC2 and RC3

I'm getting this error in versions RC2 and RC3 when running an Oracle test that works fine in RC1:

dbfit.OracleTest
java.lang.NoClassDefFoundError: oracle/sql/TIMESTAMP
    at dbfit.environment.OracleEnvironment.(OracleEnvironment.java:86)
    at dbfit.OracleTest.(OracleTest.java:7)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at fit.FixtureClass.newInstance(FixtureClass.java:24)
    at fit.FixtureLoader.instantiateFixture(FixtureLoader.java:62)
    at fit.FixtureLoader.instantiateFirstValidFixtureClass(FixtureLoader.java:84)
    at fit.FixtureLoader.disgraceThenLoad(FixtureLoader.java:44)
    at fit.Fixture.loadFixture(Fixture.java:141)
    at fit.Fixture.getLinkedFixtureWithArgs(Fixture.java:133)
    at fit.Fixture.doTables(Fixture.java:78)
    at fit.FitServer.process(FitServer.java:81)
    at fit.FitServer.run(FitServer.java:56)
    at fit.FitServer.main(FitServer.java:41)
Caused by: java.lang.ClassNotFoundException: oracle.sql.TIMESTAMP
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 18 more

More efficient comparison of large resultsets

  • make CompareStoredQueries more efficient than O(nĀ²): solved in case of comparing sorted sets
  • add a way to hide successfully matched rows (so that only failures appear in the test results and the results aren't too bloated)

NCLOB support is broken for JDBC 11gR2

This is blocker for #28.

Example of failing snipped is described in #28.

The problem with NCLOB is that there is oracle.sql.NCLOB data type in JDBC 11.2 which didn't exist in earlier version of JDBC.

Some ideas for workarounds:

  • Bump up JDBC version to 11.2. Then it will be possible to explicitly use java.sql.NCLOB in code.
  • Modify TypeNormaliserFactory lookup to search for parent classes too. Currently there is only exact match lookup. (oracle.sql.NCLOB is subclass of oracle.sql.CLOB.)
  • Use String or something else instead of Class as key in TypeNormaliserFactory map

SQL Server: support for Geography datatypes

I am trying to test some tables that use a geography datatype in several columns. The first column is a simple geography column and two (latitude and longitude) are computed columns that use the .Lat and .Long functions of the geography object. I am unable to use INSERT or a simple QUERY statement in DbFit without generating errors. The QUERY statement produces this error:

System.ApplicationException: Can't parse Microsoft.SqlServer.Types.SqlGeography because it doesn't have a static Parse() method
   at fit.TypeAdapter.Parse(String theInput, Type theType)
   at fitnesse.handlers.AbstractCellHandler.HandleEvaluate(Fixture fixture, Parse cell, Accessor accessor)
   at dbfit.AbstractDataTableFixture.FindMatchingTableRow(Parse row, DataTable table) in D:\work\dbfit\impl\dotnet\src\fixture\AbstractDataTableFixture.cs:line 77
   at dbfit.AbstractDataTableFixture.DoRows(Parse rows) in D:\work\dbfit\impl\dotnet\src\fixture\AbstractDataTableFixture.cs:line 54
   at fit.Fixture.DoTables(Parse theTables)

The INSERT statement produces this error:

System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
   at System.Data.SqlClient.SqlBuffer.get_String()
   at dbfit.SqlServerEnvironment.ReadIntoParams(String objname, String query) in D:\work\dbfit\impl\dotnet\src\environment\SqlServerEnvironment.cs:line 85
   at dbfit.fixture.Insert.InitParameters(Parse headerCells) in D:\work\dbfit\impl\dotnet\src\fixture\Insert.cs:line 96
   at dbfit.fixture.Insert.DoRows(Parse rows) in D:\work\dbfit\impl\dotnet\src\fixture\Insert.cs:line 48
   at fit.Fixture.DoTables(Parse theTables)

I can work around the INSERT not working as I use EXECUTE with a SQL Insert statement, but I'd like to be able to use the built in DbFit Fixtures.

Create a pure-java "fast build"

Right now, the barrier to contribution is too high because of setting up a VM with all the databases in it. It's possible to avoid this by having a "fast build" that:

  • compiles the code
  • runs the unit tests
  • runs the acceptance tests for the pure-java databases

This could also allow running the fast build on Travis CI

Better support for connecting to several schemas in the same test

This is currently possible, but somewhat clunky (connections need to be opened and closed serially in standalone mode).

This is valuable when:

  • querying two databases and comparing the results
  • checking transactionality constraints

From discussion on groups.dbfit:

# Let's say t1 and t2 are different transactions/connections to db. How to declare and initiate them is out for scope for now

t1: start
t2: start

t1: |execute procedure|p1|
t1: wait

t2: |execute procedure|p1|

t2: commit
t1: continue
t1: commit


# and here we add some other tests to check if data in db looks OK. E.g. - expected balance account in a table is 110.

and

So basically, being able to name connections/transactions and being able to switch which is the active one them is the idea.

Then this could be used to test interactions/isolation/contention between multiple concurrent transactions.

I guess also for things like 2-phase commits (across different DBs).

FitLibrary has some kind of similar construct to switch between different flow mode fixtures on the page. I think it's 'select' to choose the active one.

This could all be done using stand alone mode but may be more elegant with a 'select' type of mechanism....?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.