[ 
https://issues.apache.org/jira/browse/NIFI-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15407885#comment-15407885
 ] 

ASF GitHub Bot commented on NIFI-2407:
--------------------------------------

Github user jtstorck commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/778#discussion_r73537740
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java
 ---
    @@ -258,6 +264,28 @@ public void testURLClassLoaderGetConnection() throws 
ClassNotFoundException, Mal
             DriverManager.deregisterDriver(shim);
         }
     
    +    @Test
    +    public void testPropertiesUseVariableRegistry() throws 
InitializationException, SQLException {
    +        final VariableRegistry variableRegistry = 
mock(VariableRegistry.class);
    +        
given(variableRegistry.getVariableValue("databaseurl")).willReturn("jdbc:derby:"
 + DB_LOCATION + ";create=true");
    +        
given(variableRegistry.getVariableValue("drivername")).willReturn("org.apache.derby.jdbc.EmbeddedDriver");
    +        
given(variableRegistry.getVariableValue("username")).willReturn("tester");
    +        
given(variableRegistry.getVariableValue("password")).willReturn("testerp");
    +
    +        final TestRunner runner = 
TestRunners.newTestRunner(mock(org.apache.nifi.processor.Processor.class), 
variableRegistry);
    +        final DBCPConnectionPool service = new DBCPConnectionPool();
    +        runner.addControllerService("dbcpService", service);
    +
    +        runner.setProperty(service, DBCPConnectionPool.DATABASE_URL, 
"${databaseurl}");
    +        runner.setProperty(service, DBCPConnectionPool.DB_DRIVERNAME, 
"${drivername}");
    +        runner.setProperty(service, DBCPConnectionPool.DB_USER, 
"${username}");
    +        runner.setProperty(service, DBCPConnectionPool.DB_PASSWORD, 
"${password}");
    +
    +        runner.enableControllerService(service);
    +
    +        
then(variableRegistry).should(times(4)).getVariableValue(anyString());
    --- End diff --
    
    I agree.  Also, one of the changes I made to the AbstractHadoopProcessor is 
to enable the checking of evaluateAttributeExpressions() if the Directory 
property enables EL.  I'll remove the mocking usage from the tests I already 
modified.


> Add EL support to processors/controller services
> ------------------------------------------------
>
>                 Key: NIFI-2407
>                 URL: https://issues.apache.org/jira/browse/NIFI-2407
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Jeff Storck
>            Assignee: Jeff Storck
>             Fix For: 1.0.0
>
>
> Add support for EL:
> * "Directory" property for GetHDFS and ListHDFS processors
> * "Destination Name" property for ConsumeJMS and PublishJMS processors
> * "MQ ConnectionFactory Implementation", "MQ client library path", "Broker 
> URI" properties for the JMS Connection Factory Provider
> * "Database Connection URL", "Database Driver Class Name", "DB Driver jar 
> url", "DB username", and "DB password" properties for the DBCP Connection Pool



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to