Ecosystem:Infinispan

From PostgreSQL wiki
Jump to navigationJump to search

Test procedure

Infinispan's source code distribution includes a regression test suite for using Infinispan as a key/value persistent store. The test uses H2 by default. You can use other DBMSs by changing some configuration files.

Prepare an arbitrary database to store test tables. For example, run "createdb test".

Download Infinispan's source code from GitHub and unzip it.

Add the PostgreSQL JDBC driver as a dependency of the test suite by adding the following fragment under <dependencies> element in persistence/jdbc/pom.xml.

    <dependency>
       <groupId>org.postgresql</groupId>
       <artifactId>postgresql</artifactId>
       <scope>test</scope>
    </dependency>

Modify several configuration files under persistence/jdbc/src/test/resources/configs to switch the DBMS from H2 to PostgreSQL. Two changes are necessary. One is the JDBC connection configuration like this:

    <simple-connection connection-url="jdbc:postgresql://localhost:5432/test" driver="org.postgresql.Driver" username="postgres"/>

The other is the data type of a table column. Substitute "bytea" for "BINARY" as follows:

    <data-column name="DATA_COLUMN" type="bytea" />

Finally, run the test in persistence/jdbc. Maven automatically downloads and uses the PostgreSQL JDBC driver which you added as a dependency.

$ mvn clean test