From jira-return-11230-archive-asf-public=cust-asf.ponee.io@kafka.apache.org Tue Mar 27 23:04:21 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6B9C818064E for ; Tue, 27 Mar 2018 23:04:18 +0200 (CEST) Received: (qmail 15708 invoked by uid 500); 27 Mar 2018 21:04:17 -0000 Mailing-List: contact jira-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@kafka.apache.org Delivered-To: mailing list jira@kafka.apache.org Received: (qmail 15697 invoked by uid 99); 27 Mar 2018 21:04:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2018 21:04:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EC30518009A for ; Tue, 27 Mar 2018 21:04:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id amN6jZmqgO4U for ; Tue, 27 Mar 2018 21:04:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 17A215FB59 for ; Tue, 27 Mar 2018 21:04:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 020D6E00A9 for ; Tue, 27 Mar 2018 21:04:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id AC2A421509 for ; Tue, 27 Mar 2018 21:04:01 +0000 (UTC) Date: Tue, 27 Mar 2018 21:04:01 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: jira@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KAFKA-6473) Add MockProcessorContext to public test-utils MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KAFKA-6473?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1641= 6246#comment-16416246 ]=20 ASF GitHub Bot commented on KAFKA-6473: --------------------------------------- mjsax closed pull request #4736: KAFKA-6473: Add MockProcessorContext to pu= blic test-utils URL: https://github.com/apache/kafka/pull/4736 =20 =20 =20 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/build.gradle b/build.gradle index 8de03efeba0..d5fd7d5fd7b 100644 --- a/build.gradle +++ b/build.gradle @@ -1002,6 +1002,10 @@ project(':streams:examples') { compile project(':streams') compile project(':connect:json') // this dependency should be removed= after we unify data API compile libs.slf4jlog4j + + testCompile project(':clients').sourceSets.test.output // for org.apac= he.kafka.test.IntegrationTest + testCompile project(':streams:test-utils') + testCompile libs.junit } =20 javadoc { diff --git a/docs/streams/developer-guide/dsl-api.html b/docs/streams/devel= oper-guide/dsl-api.html index 34ac89ffe05..8552bcc8674 100644 --- a/docs/streams/developer-guide/dsl-api.html +++ b/docs/streams/developer-guide/dsl-api.html @@ -66,6 +66,7 @@
  • Writing streams back to Kafka
  • +
  • Testing a Streams application
  • @@ -3154,6 +3155,10 @@

    Overview<= /a>

    +
    +

    Testing a Streams application

    + Kafka Streams comes with a test-utils module to h= elp you test your application here. +
    =20 =20 diff --git a/docs/streams/developer-guide/processor-api.html b/docs/streams= /developer-guide/processor-api.html index b51bc22cfe2..e3432b79b7c 100644 --- a/docs/streams/developer-guide/processor-api.html +++ b/docs/streams/developer-guide/processor-api.html @@ -41,13 +41,16 @@

    Table of Contents

    @@ -98,11 +101,12 @@

    Overview= PunctuationType types within the same pro= cessor by calling Proc= essorContext#schedule() multiple times inside init() method.

    -

    Attention

    +

    Attention

    Stream-time is only advanced if all inpu= t partitions over all input topics have new data (with newer timestamps) av= ailable. If at least one partition does not have any new data a= vailable, stream-time will not be advanced and thus punctuate() will not be trigger= ed if PunctuationType.= STREAM_TIME was specified. This behavior is independent of the configured timesta= mp extractor, i.e., using WallclockTimestampExtractor does not enable wall-clock tr= iggering of punctuate(= ).

    +

    Example

    The following example Processor defines a simple word-count algorit= hm and the following actions are performed:

    • In the init() method, schedule the punctuation every 1000 time= units (the time unit is normally milliseconds, which in this example would= translate to punctuation every 1 second) and retrieve the local state stor= e by its name “Counts”.
    • @@ -159,6 +163,16 @@

      Overviewstate stores documentation.

      +
      +

      + Unit Testing Proces= sors + +

      +

      + Kafka Streams comes with a test-utils module = to help you write unit tests for your + processors here. +

      +

      State Stores

      To implement a stateful Processor or Transformer, you mu= st provide one or more state stores to the processor diff --git a/docs/streams/developer-guide/testing.html b/docs/streams/devel= oper-guide/testing.html index e6886a1689f..ea2ae987c7e 100644 --- a/docs/streams/developer-guide/testing.html +++ b/docs/streams/developer-guide/testing.html @@ -18,26 +18,40 @@ =20 =20