Return-Path: X-Original-To: apmail-apex-users-archive@minotaur.apache.org Delivered-To: apmail-apex-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7265B1899F for ; Fri, 22 Apr 2016 07:11:17 +0000 (UTC) Received: (qmail 54606 invoked by uid 500); 22 Apr 2016 07:11:17 -0000 Delivered-To: apmail-apex-users-archive@apex.apache.org Received: (qmail 54563 invoked by uid 500); 22 Apr 2016 07:11:17 -0000 Mailing-List: contact users-help@apex.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@apex.incubator.apache.org Delivered-To: mailing list users@apex.incubator.apache.org Received: (qmail 54554 invoked by uid 99); 22 Apr 2016 07:11: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; Fri, 22 Apr 2016 07:11: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 D8F42180572 for ; Fri, 22 Apr 2016 07:11:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.021 X-Spam-Level: X-Spam-Status: No, score=-2.021 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id pT7vHP_q9lu9 for ; Fri, 22 Apr 2016 07:11:15 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 51D705F23E for ; Fri, 22 Apr 2016 07:11:15 +0000 (UTC) Received: (qmail 54546 invoked by uid 99); 22 Apr 2016 07:11:14 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Apr 2016 07:11:14 +0000 Received: from mail-qk0-f174.google.com (mail-qk0-f174.google.com [209.85.220.174]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 60D101A01BB for ; Fri, 22 Apr 2016 07:11:14 +0000 (UTC) Received: by mail-qk0-f174.google.com with SMTP id x7so35330404qkd.3 for ; Fri, 22 Apr 2016 00:11:14 -0700 (PDT) X-Gm-Message-State: AOPr4FWYz79jHhqZxTlaQAmvDDcyPY6VEHnEZcWE53f3xxvdxmGdNuqJkL9zpPyKxI7tA1HtuUS9irBHk0wtZGi6 MIME-Version: 1.0 X-Received: by 10.55.135.4 with SMTP id j4mr3315762qkd.163.1461309073478; Fri, 22 Apr 2016 00:11:13 -0700 (PDT) Received: by 10.55.212.142 with HTTP; Fri, 22 Apr 2016 00:11:13 -0700 (PDT) In-Reply-To: References: Date: Fri, 22 Apr 2016 12:41:13 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Unit tests not picking maven dependencies for LocalMode From: Chinmay Kolhatkar To: users@apex.incubator.apache.org Content-Type: multipart/alternative; boundary=94eb2c07480a3b87d905310d8875 --94eb2c07480a3b87d905310d8875 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Ananth, You can have a full cycle of run in local mode for apex app. This seems to be a dependency related issue. Can you please share the code snippet of pom.xml where the missing maven dependency is added? Also, are you trying the load a class from that jar dependency using any class loader? Thanks, Chinmay. On Fri, Apr 22, 2016 at 12:24 PM, Ananth Gundabattula < agundabattula@gmail.com> wrote: > > Hello All, > > Some of my unit tests are not able to execute a flow end to end because a > jar is not being picked up at runtime though it is part of the maven > dependencies etc =E2=80=A6 > > I believe in the actual scenario when deploying it to an Apex server, the > metadata file that is used in packaging the application artefacts specifi= es > an application path etc. However in my unit tests , this does not seem to > apply/take effect. Am I right in assuming that we cannot achieve a full > cycle of run using the local mode setup of the Apex app in a unit test ? > > Are there any recommendations to get around this issue ? > > Here is the code snippet that I am trying : > > @Test > public void testApplication() throws IOException, Exception { > try { > LocalMode lma =3D LocalMode.newInstance(); > Configuration conf =3D new Configuration(false); > conf.addResource(this.getClass().getResourceAsStream("/dag-test-p= rops.xml")); > lma.prepareDAG(new CassandraEventDetailsStreamingApp(), conf); > LocalMode.Controller lc =3D lma.getController(); > lc.run(); > } catch (ConstraintViolationException e) { > Assert.fail("constraint violations: " + e.getConstraintViolations= ()); > } > } > > > > Regards, > Ananth > --94eb2c07480a3b87d905310d8875 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Ananth,

You can have a full cycle of run in local mode = for apex app. This seems to be a dependency related issue.

Can you pl= ease share the code snippet of pom.xml where the missing maven dependency i= s added?
Also, are you trying the load a class from that jar dependency usi= ng any class loader?

Thanks,
Chinmay.


On Fri, Apr 22, 2016 at 12:= 24 PM, Ananth Gundabattula <agundabattula@gmail.com> w= rote:
Hello All,

Some of my unit tests are not able to execute a flow end= to end because a jar is not being picked up at runtime though=C2=A0 it is = part of the maven dependencies etc =E2=80=A6

I believe in the actua= l scenario when deploying it to an Apex server, the metadata file that is u= sed in packaging the application artefacts specifies an application path et= c. However in my unit tests , this does not seem to apply/take effect. Am I= right in assuming that we cannot achieve a full cycle of run using the loc= al mode setup of the Apex app in a unit test ?

Are there any recomme= ndations to get around this issue ?

Here is the code snippet = that I am trying :

@Test
public void testApplica= tion() throws IOExcepti= on, Exception {
try {
LocalMode lma =3D Lo= calMode.newInstance();
Configuration conf =3D new Configuration(false);
conf.addResource(this.getClass().getResourceAsStream("/dag-test-props.xml"));
= lma.prepareDAG(new = CassandraEventDetailsStreamingApp(), = conf);
LocalMode.Controller lc =3D lma.g= etController();
lc.run();
}= catch (ConstraintViolationExc= eption e) {
Assert.= fail("constraint violations: " + e.getConstraintViolations());
}
}


Regards,
Ananth

--94eb2c07480a3b87d905310d8875--