Search in sources :

Example 16 with DbStorage

use of com.axway.ats.rbv.db.DbStorage in project ats-framework by Axway.

the class Test_DbFolder method getMetaDataCountsSecondPollingDataChanged.

@Test
public void getMetaDataCountsSecondPollingDataChanged() throws Exception {
    MockDbProvider dbProvider = new MockDbProvider();
    DbStorage storage = new DbStorage(dbProvider);
    Matchable folder = storage.getFolder(new DbSearchTerm(""));
    folder.open();
    folder.getNewMetaData();
    //change the meta data for one of the records
    dbProvider.incrementSeed();
    folder.getNewMetaData();
    assertEquals("Total DB records: 2, new DB records: 2", folder.getMetaDataCounts());
    folder.close();
}
Also used : DbStorage(com.axway.ats.rbv.db.DbStorage) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) Matchable(com.axway.ats.rbv.storage.Matchable) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 17 with DbStorage

use of com.axway.ats.rbv.db.DbStorage in project ats-framework by Axway.

the class Test_DbFolder method getMetaDataCountsNegativeFolderNotOpen.

@Test(expected = MatchableNotOpenException.class)
public void getMetaDataCountsNegativeFolderNotOpen() throws RbvStorageException {
    DbStorage storage = new DbStorage(new MockDbProvider());
    Matchable folder = storage.getFolder(new DbSearchTerm(""));
    folder.getMetaDataCounts();
}
Also used : DbStorage(com.axway.ats.rbv.db.DbStorage) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) Matchable(com.axway.ats.rbv.storage.Matchable) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 18 with DbStorage

use of com.axway.ats.rbv.db.DbStorage in project ats-framework by Axway.

the class Test_DbFolder method getNewMetaDataNegativeFolderNotOpen.

@Test(expected = MatchableNotOpenException.class)
public void getNewMetaDataNegativeFolderNotOpen() throws RbvException {
    DbStorage storage = new DbStorage(new MockDbProvider());
    Matchable folder = storage.getFolder(new DbSearchTerm(""));
    folder.getNewMetaData();
}
Also used : DbStorage(com.axway.ats.rbv.db.DbStorage) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) Matchable(com.axway.ats.rbv.storage.Matchable) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 19 with DbStorage

use of com.axway.ats.rbv.db.DbStorage in project ats-framework by Axway.

the class Test_DbFolder method getMetaDataCountsBeforePolling.

@Test(expected = RbvStorageException.class)
public void getMetaDataCountsBeforePolling() throws Exception {
    DbStorage storage = new DbStorage(new MockDbProvider());
    Matchable folder = storage.getFolder(new DbSearchTerm(""));
    folder.open();
    folder.getMetaDataCounts();
}
Also used : DbStorage(com.axway.ats.rbv.db.DbStorage) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) Matchable(com.axway.ats.rbv.storage.Matchable) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 20 with DbStorage

use of com.axway.ats.rbv.db.DbStorage in project ats-framework by Axway.

the class Test_DbFolder method getAllMetaData.

@Test
public void getAllMetaData() throws Exception {
    DbStorage storage = new DbStorage(new MockDbProvider());
    Matchable folder = storage.getFolder(new DbSearchTerm(""));
    folder.open();
    List<MetaData> metaData = folder.getAllMetaData();
    assertEquals(2, metaData.size());
    folder.close();
}
Also used : DbStorage(com.axway.ats.rbv.db.DbStorage) MetaData(com.axway.ats.rbv.MetaData) DbSearchTerm(com.axway.ats.rbv.db.DbSearchTerm) Matchable(com.axway.ats.rbv.storage.Matchable) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

DbStorage (com.axway.ats.rbv.db.DbStorage)25 DbSearchTerm (com.axway.ats.rbv.db.DbSearchTerm)24 Test (org.junit.Test)24 Matchable (com.axway.ats.rbv.storage.Matchable)22 BaseTest (com.axway.ats.rbv.BaseTest)16 MockDbProvider (com.axway.ats.rbv.db.MockDbProvider)9 Monitor (com.axway.ats.rbv.Monitor)8 SimpleMonitorListener (com.axway.ats.rbv.SimpleMonitorListener)8 DbFieldsRule (com.axway.ats.rbv.db.rules.DbFieldsRule)8 DbStringFieldRule (com.axway.ats.rbv.db.rules.DbStringFieldRule)8 ArrayList (java.util.ArrayList)8 PollingParameters (com.axway.ats.rbv.PollingParameters)4 MetaData (com.axway.ats.rbv.MetaData)2 Before (org.junit.Before)1