[ 
https://issues.apache.org/jira/browse/BEAM-3702?focusedWorklogId=81298&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-81298
 ]

ASF GitHub Bot logged work on BEAM-3702:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Mar/18 17:56
            Start Date: 16/Mar/18 17:56
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #4683: 
[BEAM-3702] adding fromJvm to create pipelineoptions from the system properties
URL: https://github.com/apache/beam/pull/4683#discussion_r175169354
 
 

 ##########
 File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/options/PipelineOptionsFactoryTest.java
 ##########
 @@ -1797,6 +1799,44 @@ public void serialize(JacksonIncompatible 
jacksonIncompatible, JsonGenerator jso
     }
   }
 
+  @Test
+  public void testPipelineOptionsFactoryFromProperties() {
+    assertEquals("testAppName", PipelineOptionsFactory.fromProperties(new 
Properties() {{
+      put("appName", "testAppName");
+    }}).as(ApplicationNameOptions.class).getAppName());
+  }
+
+  @Test
+  public void testPipelineOptionsFactoryFromPropertiesWithPrefix() {
+    assertEquals(
+      "testAppName",
+      PipelineOptionsFactory.fromProperties("prefix.", new Properties() {{
+        put("prefix.appName", "testAppName");
+      }}).as(ApplicationNameOptions.class).getAppName());
+  }
+
+  @Test
+  public void testPipelineOptionsFactoryFromPropertiesWithLongPrefix() {
+    assertEquals(
+      "testAppName",
+      PipelineOptionsFactory.fromProperties("org.apache.beam.", new 
Properties() {{
+        put("org.apache.beam.appName", "testAppName");
+      }}).as(ApplicationNameOptions.class).getAppName());
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void testPipelineOptionsFactoryFromNullProperties() {
+    assertNotNull(PipelineOptionsFactory.fromProperties(null));
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void testPipelineOptionsFactoryFromPropertiesAndNullPrefix() {
+    assertEquals(
 
 Review comment:
   drop the assertEquals as it does nothing

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 81298)
    Time Spent: 9h 50m  (was: 9h 40m)

> Support system properties source for pipeline options
> -----------------------------------------------------
>
>                 Key: BEAM-3702
>                 URL: https://issues.apache.org/jira/browse/BEAM-3702
>             Project: Beam
>          Issue Type: Task
>          Components: sdk-java-core
>            Reporter: Romain Manni-Bucau
>            Assignee: Romain Manni-Bucau
>            Priority: Major
>             Fix For: 2.5.0
>
>          Time Spent: 9h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to