flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yanghua <...@git.apache.org>
Subject [GitHub] flink pull request #5573: [FLINK-8756][Client] Support ClusterClient.getAccu...
Date Tue, 20 Mar 2018 12:08:28 GMT
Github user yanghua commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5573#discussion_r175741738
  
    --- Diff: flink-clients/src/test/java/org/apache/flink/client/program/rest/RestClusterClientTest.java
---
    @@ -542,6 +549,68 @@ public void testListJobs() throws Exception {
     		}
     	}
     
    +	@Test
    +	public void testGetAccumulators() throws Exception {
    +		TestAccumulatorHandlers accumulatorHandlers = new TestAccumulatorHandlers();
    +		TestAccumulatorHandlers.TestAccumulatorHandler accumulatorHandler = accumulatorHandlers.new
TestAccumulatorHandler();
    +
    +		try (TestRestServerEndpoint ignored = createRestServerEndpoint(accumulatorHandler)){
    +
    +			JobID id = new JobID();
    +
    +			{
    +				Map<String, Object> accumulators = restClusterClient.getAccumulators(id);
    +				assertNotNull(accumulators);
    +				assertEquals(1, accumulators.size());
    +
    +				assertEquals(true, accumulators.containsKey("testKey"));
    +				assertEquals("testValue", accumulators.get("testKey").toString());
    +			}
    +		}
    +	}
    +
    +	private class TestAccumulatorHandlers  {
    --- End diff --
    
    this follows the `TestSavepointHandlers` in `RestClusterClientTest`, I will remove it.


---

Mime
View raw message