本文整理汇总了Java中net.floodlightcontroller.storage.IStorageSourceListener.rowsModified方法的典型用法代码示例。如果您正苦于以下问题:Java IStorageSourceListener.rowsModified方法的具体用法?Java IStorageSourceListener.rowsModified怎么用?Java IStorageSourceListener.rowsModified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.floodlightcontroller.storage.IStorageSourceListener
的用法示例。
在下文中一共展示了IStorageSourceListener.rowsModified方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}