apex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chinmay Kolhatkar <chin...@apache.org>
Subject Re: Unit tests not picking maven dependencies for LocalMode
Date Fri, 22 Apr 2016 07:11:13 GMT
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 …
>
> I believe in the actual scenario when deploying it to an Apex server, the
> metadata file that is used in packaging the application artefacts specifies
> 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 = LocalMode.newInstance();
>         Configuration conf = new Configuration(false);
>         conf.addResource(this.getClass().getResourceAsStream("/dag-test-props.xml"));
>         lma.prepareDAG(new CassandraEventDetailsStreamingApp(), conf);
>         LocalMode.Controller lc = lma.getController();
>         lc.run();
>     } catch (ConstraintViolationException e) {
>         Assert.fail("constraint violations: " + e.getConstraintViolations());
>     }
> }
>
>
>
> Regards,
> Ananth
>

Mime
View raw message