You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by joewitt <gi...@git.apache.org> on 2016/07/31 19:16:22 UTC

[GitHub] nifi pull request #754: NIFI-2208 refactored as per comments in JIRA

GitHub user joewitt opened a pull request:

    https://github.com/apache/nifi/pull/754

    NIFI-2208 refactored as per comments in JIRA

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/joewitt/incubator-nifi NIFI-2208-refactor

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/754.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #754
    
----
commit 1513b8435d862e9db3fb12228be31e9f5920e38e
Author: joewitt <jo...@apache.org>
Date:   2016-07-31T19:14:22Z

    NIFI-2208 refactored as per comments in JIRA

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #754: NIFI-2208 refactored as per comments in JIRA

Posted by YolandaMDavis <gi...@git.apache.org>.
Github user YolandaMDavis commented on the issue:

    https://github.com/apache/nifi/pull/754
  
    @joewitt review in progress, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #754: NIFI-2208 refactored as per comments in JIRA

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/nifi/pull/754


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi pull request #754: NIFI-2208 refactored as per comments in JIRA

Posted by YolandaMDavis <gi...@git.apache.org>.
Github user YolandaMDavis commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/754#discussion_r73013984
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/util/TestFileBasedVariableRegistry.java ---
    @@ -0,0 +1,45 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.nifi.util;
    +
    +import java.nio.file.Path;
    +import java.nio.file.Paths;
    +import java.util.Map;
    +import org.apache.nifi.registry.VariableDescriptor;
    +import org.apache.nifi.registry.VariableRegistry;
    +import org.junit.Test;
    +import static org.junit.Assert.assertTrue;
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + *
    + */
    +public class TestFileBasedVariableRegistry {
    +
    +    @Test
    +    public void testCreateCustomVariableRegistry() {
    +        final Path fooPath = Paths.get("src/test/resources/TestVariableRegistry/foobar.properties");
    +        final Path testPath = Paths.get("src/test/resources/TestVariableRegistry/test.properties");
    +        Path[] paths = {fooPath, testPath};
    +        final String vendorUrl = System.getProperty("java.vendor.url");
    +        VariableRegistry variableRegistry = new FileBasedVariableRegistry(paths);
    +        final Map<VariableDescriptor, String> variables = variableRegistry.getVariableMap();
    +        assertTrue(variables.containsKey(new VariableDescriptor("fake.property.3")));
    +        assertEquals(vendorUrl, variableRegistry.getVariableValue("java.vendor.url"));
    +        assertEquals("test me out 3, test me out 4", variableRegistry.getVariableValue("fake.property.3"));
    +    }
    --- End diff --
    
    Just would recommend some negative tests e.g. file doesn't exist no errors


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] nifi issue #754: NIFI-2208 refactored as per comments in JIRA

Posted by YolandaMDavis <gi...@git.apache.org>.
Github user YolandaMDavis commented on the issue:

    https://github.com/apache/nifi/pull/754
  
    @joewitt all looks good tested on standalone and on cluster including tests ensuring precedence on attribute lookup was maintained. Also negative integration test for non existent files ran without issue. 
    
    Recommend to note in documentation that with the current implementation the concept of cluster scope vs node scope is not yet available therefore each node in a cluster environment would need to be configured with the same custom properties to ensure any matching expected across the cluster.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---