本文整理汇总了Java中net.floodlightcontroller.storage.IStorageSourceListener类的典型用法代码示例。如果您正苦于以下问题:Java IStorageSourceListener类的具体用法?Java IStorageSourceListener怎么用?Java IStorageSourceListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IStorageSourceListener类属于net.floodlightcontroller.storage包,在下文中一共展示了IStorageSourceListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testInsertNotification
import net.floodlightcontroller.storage.IStorageSourceListener; //导入依赖的package包/类
@Test
public void testInsertNotification() {
// Set up the listener and record the expected notification
IStorageSourceListener mockListener = createNiceMock(IStorageSourceListener.class);
Set<Object> expectedKeys = new HashSet<Object>();
expectedKeys.add("999-99-9999");
mockListener.rowsModified(PERSON_TABLE_NAME, expectedKeys);
replay(mockListener);
// Now try it for real
storageSource.addListener(PERSON_TABLE_NAME, mockListener);
// Create a new person, which should trigger the listener
Object[] newPerson = {"999-99-9999", "Serena", "Williams", 22, true};
insertPerson(newPerson);
verify(mockListener);
}
示例2: testUpdateNotification
import net.floodlightcontroller.storage.IStorageSourceListener; //导入依赖的package包/类
@Test
public void testUpdateNotification() {
// Set up the listener and record the expected notification
IStorageSourceListener mockListener = createNiceMock(IStorageSourceListener.class);
Set<Object> expectedKeys = new HashSet<Object>();
expectedKeys.add("111-11-1111");
mockListener.rowsModified(PERSON_TABLE_NAME, expectedKeys);
replay(mockListener);
// Now try it for real
storageSource.addListener(PERSON_TABLE_NAME, mockListener);
// Create a new person, which should trigger the listener
Map<String,Object> updateValues = new HashMap<String,Object>();
updateValues.put(PERSON_FIRST_NAME, "Tennis");
storageSource.updateRow(PERSON_TABLE_NAME, "111-11-1111", updateValues);
verify(mockListener);
}
示例3: testDeleteNotification
import net.floodlightcontroller.storage.IStorageSourceListener; //导入依赖的package包/类
@Test
public void testDeleteNotification() {
IStorageSourceListener mockListener = createNiceMock(IStorageSourceListener.class);
Set<Object> expectedKeys = new HashSet<Object>();
expectedKeys.add("111-11-1111");
mockListener.rowsDeleted(PERSON_TABLE_NAME, expectedKeys);
replay(mockListener);
// Now try it for real
storageSource.addListener(PERSON_TABLE_NAME, mockListener);
// Create a new person, which should trigger the listener
storageSource.deleteRow(PERSON_TABLE_NAME, "111-11-1111");
verify(mockListener);
}