本文整理汇总了Java中org.fosstrak.ale.server.type.FileSubscriberOutputChannel类的典型用法代码示例。如果您正苦于以下问题:Java FileSubscriberOutputChannel类的具体用法?Java FileSubscriberOutputChannel怎么用?Java FileSubscriberOutputChannel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileSubscriberOutputChannel类属于org.fosstrak.ale.server.type包,在下文中一共展示了FileSubscriberOutputChannel类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例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());
}
示例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);
}
示例4: testOnlyLocalFilesAllowed
import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入依赖的package包/类
@Test(expected = InvalidURIException.class)
public void testOnlyLocalFilesAllowed() throws InvalidURIException{
new FileSubscriberOutputChannel("file://192.168.1.1/dir/dir");
}
示例5: testOnlyLocalFilesAllowed2
import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入依赖的package包/类
@Test(expected = InvalidURIException.class)
public void testOnlyLocalFilesAllowed2() throws InvalidURIException{
new FileSubscriberOutputChannel("file://myhost.com/dir/dir");
}
示例6: testInvalidFileURIs_noPath
import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入依赖的package包/类
@Test(expected = InvalidURIException.class)
public void testInvalidFileURIs_noPath() throws Exception {
new FileSubscriberOutputChannel("file://localhost");
}
示例7: testInvalidFileURIs_noFile
import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入依赖的package包/类
@Test(expected = InvalidURIException.class)
public void testInvalidFileURIs_noFile() throws Exception {
new FileSubscriberOutputChannel("file://localhost/dir/dir/");
}
示例8: testInvalidFileURIs_wrongScheme
import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入依赖的package包/类
@Test(expected = InvalidURIException.class)
public void testInvalidFileURIs_wrongScheme() throws Exception {
new FileSubscriberOutputChannel("ftp://localhost/dir/dira");
}
示例9: testInvalidFileURIs_InvalidURI
import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入依赖的package包/类
@Test(expected = InvalidURIException.class)
public void testInvalidFileURIs_InvalidURI() throws Exception {
new FileSubscriberOutputChannel(null);
}
示例10: testInvalidFileURIsdfs_InvalidURI
import org.fosstrak.ale.server.type.FileSubscriberOutputChannel; //导入依赖的package包/类
@Test
public void testInvalidFileURIsdfs_InvalidURI() throws Exception {
new FileSubscriberOutputChannel("file:///c:/test");
}