From jira-return-9634-archive-asf-public=cust-asf.ponee.io@kafka.apache.org Tue Feb 6 19:50:11 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 4BFED180657 for ; Tue, 6 Feb 2018 19:50:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3B8B9160C45; Tue, 6 Feb 2018 18:50:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 844B4160C37 for ; Tue, 6 Feb 2018 19:50:10 +0100 (CET) Received: (qmail 38867 invoked by uid 500); 6 Feb 2018 18:50:04 -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 38775 invoked by uid 99); 6 Feb 2018 18:50:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2018 18:50:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 36BA31A08A2 for ; Tue, 6 Feb 2018 18:50:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 2HBuH5n5DnLT for ; Tue, 6 Feb 2018 18:50:03 +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 734845F216 for ; Tue, 6 Feb 2018 18:50:02 +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 593DCE02AA for ; Tue, 6 Feb 2018 18:50:01 +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 3D93E24106 for ; Tue, 6 Feb 2018 18:50:00 +0000 (UTC) Date: Tue, 6 Feb 2018 18:50:00 +0000 (UTC) From: "Matthias J. Sax (JIRA)" To: jira@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (KAFKA-5253) TopologyTestDriver must handle streams created with patterns 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-5253?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias J. Sax updated KAFKA-5253: ----------------------------------- Affects Version/s: (was: 0.10.2.1) 1.1.0 > TopologyTestDriver must handle streams created with patterns > ------------------------------------------------------------ > > Key: KAFKA-5253 > URL: https://issues.apache.org/jira/browse/KAFKA-5253 > Project: Kafka > Issue Type: Bug > Components: streams, unit tests > Affects Versions: 1.1.0 > Reporter: Wim Van Leuven > Priority: Major > Labels: beginner, needs-kip, newbie > > *Context* > -KStreamTestDriver-=C2=A0TopologyTestDriver (added via KIP-247) is being= used to unit test topologies while developing KStreams apps. > One such topology uses a Pattern to consume from multiple topics at once. > *Problem* > The unit test of the topology fails because -KStreamTestDriver-=C2=A0Top= ologyTestDriver fails to deal with Patterns properly. > *Example* > Underneath is a unit test explaining what I understand should happen, bu= t is failing. > Explicitly adding a source topic matching the topic pattern, generates an= exception as the topology builder explicitly checks overlapping topic name= s and patterns, in any order of adding pattern and topic. So, it is intende= d behaviour. > {code:java} > @Test > public void shouldProcessFromSourcesThatDoMatchThePattern() { > // -- setup stream pattern > final KStream source =3D builder.stream(Pattern.c= ompile("topic-source-\\d")); > source.to("topic-sink"); > // -- setup processor to capture results > final MockProcessorSupplier processorSupplier =3D= new MockProcessorSupplier<>(); > source.process(processorSupplier); > // -- add source to stream data from > //builder.addSource(builder.newName(KStreamImpl.SOURCE_NAME), "to= pic-source-3"); > // -- build test driver > driver =3D new KStreamTestDriver(builder); > driver.setTime(0L); > // -- test > driver.process("topic-source-3", "A", "aa"); > // -- validate > // no exception was thrown > assertEquals(Utils.mkList("A:aa"), processorSupplier.processed); > } > {code} > *Solution* > If anybody can help in defining the solution, I can create a pull reques= t for this change. -- This message was sent by Atlassian JIRA (v7.6.3#76005)