本文整理汇总了Java中org.apache.nifi.util.TestRunner.assertNotValid方法的典型用法代码示例。如果您正苦于以下问题:Java TestRunner.assertNotValid方法的具体用法?Java TestRunner.assertNotValid怎么用?Java TestRunner.assertNotValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.nifi.util.TestRunner
的用法示例。
在下文中一共展示了TestRunner.assertNotValid方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateNotValidForNonExistingLibPath
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void validateNotValidForNonExistingLibPath() throws Exception {
TestRunner runner = TestRunners.newTestRunner(mock(Processor.class));
JMSConnectionFactoryProvider cfProvider = new JMSConnectionFactoryProvider();
runner.addControllerService("cfProvider", cfProvider);
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.BROKER_URI, "myhost:1234");
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.CLIENT_LIB_DIR_PATH, "foo");
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.CONNECTION_FACTORY_IMPL,
"org.apache.nifi.jms.testcflib.TestConnectionFactory");
runner.assertNotValid(cfProvider);
}
示例2: validateFailsIfURINotHostPortAndNotActiveMQ
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test(expected = AssertionError.class)
public void validateFailsIfURINotHostPortAndNotActiveMQ() throws Exception {
TestRunner runner = TestRunners.newTestRunner(mock(Processor.class));
JMSConnectionFactoryProvider cfProvider = new JMSConnectionFactoryProvider();
runner.addControllerService("cfProvider", cfProvider);
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.BROKER_URI, "myhost");
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.CLIENT_LIB_DIR_PATH, "test-lib");
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.CONNECTION_FACTORY_IMPL,
"org.apache.nifi.jms.testcflib.TestConnectionFactory");
runner.enableControllerService(cfProvider);
runner.assertNotValid(cfProvider);
}
示例3: validateNotValidForNonDirectoryPath
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void validateNotValidForNonDirectoryPath() throws Exception {
TestRunner runner = TestRunners.newTestRunner(mock(Processor.class));
JMSConnectionFactoryProvider cfProvider = new JMSConnectionFactoryProvider();
runner.addControllerService("cfProvider", cfProvider);
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.BROKER_URI, "myhost:1234");
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.CLIENT_LIB_DIR_PATH, "pom.xml");
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.CONNECTION_FACTORY_IMPL,
"org.apache.nifi.jms.testcflib.TestConnectionFactory");
runner.assertNotValid(cfProvider);
}
示例4: validateNotValidForNonExistingLibPath
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void validateNotValidForNonExistingLibPath() throws Exception {
TestRunner runner = TestRunners.newTestRunner(mock(Processor.class));
JNDIConnectionFactoryProvider cfProvider = new JNDIConnectionFactoryProvider();
runner.addControllerService("cfProvider", cfProvider);
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.BROKER_URI, "myhost:1234");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.JNDI_CF_LOOKUP, "ConnectonFactory");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.CLIENT_LIB_DIR_PATH, "foo");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.CONNECTION_FACTORY_IMPL,
"org.apache.nifi.jms.testcflib.TestConnectionFactory");
runner.assertNotValid(cfProvider);
}
示例5: validateFailsIfURICfAndNotSolace
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test(expected = AssertionError.class)
public void validateFailsIfURICfAndNotSolace() throws Exception {
TestRunner runner = TestRunners.newTestRunner(mock(Processor.class));
JNDIConnectionFactoryProvider cfProvider = new JNDIConnectionFactoryProvider();
runner.addControllerService("cfProvider", cfProvider);
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.BROKER_URI, "myhost:1234");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.JNDI_CF_LOOKUP, "ConnectonFactory");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.CLIENT_LIB_DIR_PATH, "test-lib");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.CONNECTION_FACTORY_IMPL,
"org.apache.nifi.jms.testcflib.TestConnectionFactory");
runner.enableControllerService(cfProvider);
runner.assertNotValid(cfProvider);
}
示例6: validateNotValidForNonDirectoryPath
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void validateNotValidForNonDirectoryPath() throws Exception {
TestRunner runner = TestRunners.newTestRunner(mock(Processor.class));
JNDIConnectionFactoryProvider cfProvider = new JNDIConnectionFactoryProvider();
runner.addControllerService("cfProvider", cfProvider);
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.BROKER_URI, "myhost:1234");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.JNDI_CF_LOOKUP, "ConnectonFactory");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.CLIENT_LIB_DIR_PATH, "pom.xml");
runner.setProperty(cfProvider, JNDIConnectionFactoryProvider.CONNECTION_FACTORY_IMPL,
"org.apache.nifi.jms.testcflib.TestConnectionFactory");
runner.assertNotValid(cfProvider);
}
示例7: testInvalid
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void testInvalid() {
TestRunner runner = TestRunners.newTestRunner(DelayProcessor.class);
runner.setValidateExpressionUsage(false);
runner.setProperty(DelayProcessor.TIME_PERIOD, "10 kb");
runner.assertNotValid();
}
示例8: validating_incomplete_auth_inputs_4
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void validating_incomplete_auth_inputs_4() throws InitializationException {
final TestRunner runner = TestRunners.newTestRunner(TestProcessor.class);
final StandardMongoClientService service = new StandardMongoClientService();
Map<String, String> props = new HashMap<>();
props.put(StandardMongoClientService.HOSTS.getName(), "localhost:27017");
props.put(StandardMongoClientService.USERNAME.getName(), "mongouser");
props.put(StandardMongoClientService.PASSWORD.getName(), "mongouser");
runner.addControllerService("test_hosts", service, props);
runner.assertNotValid(service);
}
示例9: createSimpleIndexBadTest2
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void createSimpleIndexBadTest2() throws Exception {
final TestRunner runner = TestRunners.newTestRunner(new StoreInMongo());
addMongoService(runner);
runner.setProperty(MongoProps.DATABASE, MONGO_DATABASE_NAME);
runner.setProperty(MongoProps.COLLECTION, "index_test");
runner.setProperty(MongoProps.INDEX, "{\"a\": 1}");
runner.assertNotValid();
}
示例10: validating_incomplete_auth_inputs_1
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void validating_incomplete_auth_inputs_1() throws InitializationException {
final TestRunner runner = TestRunners.newTestRunner(TestProcessor.class);
final StandardMongoClientService service = new StandardMongoClientService();
Map<String, String> props = new HashMap<>();
props.put(StandardMongoClientService.HOSTS.getName(), "localhost:27017");
props.put(StandardMongoClientService.USERNAME.getName(), "mongouser");
runner.addControllerService("test_hosts", service, props);
runner.assertNotValid(service);
}
示例11: validating_incomplete_auth_inputs_2
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void validating_incomplete_auth_inputs_2() throws InitializationException {
final TestRunner runner = TestRunners.newTestRunner(TestProcessor.class);
final StandardMongoClientService service = new StandardMongoClientService();
Map<String, String> props = new HashMap<>();
props.put(StandardMongoClientService.HOSTS.getName(), "localhost:27017");
props.put(StandardMongoClientService.PASSWORD.getName(), "mongouser");
runner.addControllerService("test_hosts", service, props);
runner.assertNotValid(service);
}
示例12: validating_incomplete_auth_inputs_5
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void validating_incomplete_auth_inputs_5() throws InitializationException {
final TestRunner runner = TestRunners.newTestRunner(TestProcessor.class);
final StandardMongoClientService service = new StandardMongoClientService();
Map<String, String> props = new HashMap<>();
props.put(StandardMongoClientService.HOSTS.getName(), "localhost:27017");
props.put(StandardMongoClientService.USERNAME.getName(), "mongouser");
props.put(StandardMongoClientService.AUTH_DATABASE.getName(), "mongouser");
runner.addControllerService("test_hosts", service, props);
runner.assertNotValid(service);
}
示例13: testInvalidConfig
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void testInvalidConfig() {
TestRunner runner = TestRunners.newTestRunner(new GenerateTimeSeriesFlowFile());
runner.setProperty(GenerateTimeSeriesFlowFile.SIMULATOR_CONFIG, "/my/invalid/path");
runner.assertNotValid();
}
示例14: testMissingAttributeName
import org.apache.nifi.util.TestRunner; //导入方法依赖的package包/类
@Test
public void testMissingAttributeName() {
TestRunner runner = TestRunners.newTestRunner(CalculateLatencyStatistics.class);
runner.assertNotValid();
}