当前位置: 首页>>代码示例>>Java>>正文


Java FileSubscriberOutputChannel.notify方法代码示例

本文整理汇总了Java中org.fosstrak.ale.server.type.FileSubscriberOutputChannel.notify方法的典型用法代码示例。如果您正苦于以下问题:Java FileSubscriberOutputChannel.notify方法的具体用法?Java FileSubscriberOutputChannel.notify怎么用?Java FileSubscriberOutputChannel.notify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.fosstrak.ale.server.type.FileSubscriberOutputChannel的用法示例。


在下文中一共展示了FileSubscriberOutputChannel.notify方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testFileNotExistsCannotCreate

import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入方法依赖的package包/类
@Test(expected = ImplementationException.class)
public void testFileNotExistsCannotCreate() throws Exception {
	final String filename = "file://localhost/dir/dir";
	
	File mock = EasyMock.createMock(File.class);
	EasyMock.expect(mock.exists()).andReturn(false);
	EasyMock.expect(mock.createNewFile()).andThrow(new IOException());
	EasyMock.replay(mock);
	FileSubscriberOutputChannel tcp = new NotifyFile(filename, mock);
	tcp.notify(ECElementsUtils.createECReports());
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:12,代码来源:FileSubscriberOutputChannelTest.java

示例2: testFileNotFileCannotCreate

import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入方法依赖的package包/类
@Test(expected = ImplementationException.class)
public void testFileNotFileCannotCreate() throws Exception {
	final String filename = "file://localhost/dir/dir";
	
	File mock = EasyMock.createMock(File.class);
	EasyMock.expect(mock.exists()).andReturn(true);
	EasyMock.expect(mock.isFile()).andReturn(false);
	EasyMock.expect(mock.createNewFile()).andThrow(new IOException());
	EasyMock.replay(mock);
	FileSubscriberOutputChannel tcp = new NotifyFile(filename, mock);
	tcp.notify(ECElementsUtils.createECReports());
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:13,代码来源:FileSubscriberOutputChannelTest.java

示例3: testNotify_File

import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入方法依赖的package包/类
@Test
public void testNotify_File() throws Exception {
	// create file
	File notificationFile = folder.newFile("test");		
	// create notification listener
	FileSubscriberOutputChannel file = new FileSubscriberOutputChannel("file:///" + notificationFile.getAbsolutePath());
	// create reports
	ECReports reports = ECElementsUtils.createECReports();
	// notify listener about reports
	file.notify(reports);
	// read file
	ECReports resultReports = DeserializerUtil.deserializeECReports(new FileInputStream(notificationFile));
	// check result
	ECElementsUtils.assertEquals(reports, resultReports);
}
 
开发者ID:Auto-ID-Lab-Japan,项目名称:fosstrak-fc,代码行数:16,代码来源:FileSubscriberOutputChannelTest.java


注:本文中的org.fosstrak.ale.server.type.FileSubscriberOutputChannel.notify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。