Added SerializationTest for object payload (which is probably the most important)
This commit is contained in:
@ -42,7 +42,7 @@ abstract class JdbcHelper {
|
||||
|
||||
static {
|
||||
Flyway flyway = new Flyway();
|
||||
flyway.setDataSource(DB_URL, DB_USER, null);
|
||||
flyway.setDataSource(DB_URL, DB_USER, DB_PWD);
|
||||
flyway.migrate();
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class JdbcInventory extends JdbcHelper implements Inventory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeObject(int version, ObjectMessage object) {
|
||||
public void storeObject(ObjectMessage object) {
|
||||
try {
|
||||
PreparedStatement ps = getConnection().prepareStatement("INSERT INTO Inventory (hash, stream, expires, data, type, version) VALUES (?, ?, ?, ?, ?, ?)");
|
||||
InventoryVector iv = object.getInventoryVector();
|
||||
@ -82,7 +82,7 @@ public class JdbcInventory extends JdbcHelper implements Inventory {
|
||||
ps.setLong(3, object.getExpiresTime());
|
||||
writeBlob(ps, 4, object);
|
||||
ps.setLong(5, object.getType());
|
||||
ps.setInt(6, version);
|
||||
ps.setLong(6, object.getVersion());
|
||||
ps.executeUpdate();
|
||||
} catch (SQLException e) {
|
||||
LOG.error("Error storing object of type " + object.getPayload().getClass().getSimpleName(), e);
|
||||
|
@ -44,7 +44,7 @@ public class SimpleInventory implements Inventory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeObject(int version, ObjectMessage object) {
|
||||
public void storeObject(ObjectMessage object) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
@ -4,5 +4,5 @@ CREATE TABLE Inventory (
|
||||
expires BIGINT NOT NULL,
|
||||
data BLOB NOT NULL,
|
||||
type BIGINT NOT NULL,
|
||||
version INT NOT NULL
|
||||
version BIGINT NOT NULL
|
||||
);
|
Reference in New Issue
Block a user