Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo >> mail # dev >> Using powermock-api-mockito in tests?


Copy link to this message
-
Re: Using powermock-api-mockito in tests?
+1 to Dave's comment. I don't think we should be spending effort supporting
compiling on an unsupported runtime environment. If something fails because
it is too *nix-y then just skip that test with a local pom.xml override or
something.
On Fri, Mar 22, 2013 at 10:11 AM, Keith Turner <[EMAIL PROTECTED]> wrote:

> On Thu, Mar 21, 2013 at 10:16 PM,  <[EMAIL PROTECTED]> wrote:
> >
> > So we are getting into an area where you want to compile the software on
> a platform that is not supported. If you want to compile on an unsupported
> platform, then I would suggest just ignoring the tests that won't work on
> that system.
>
> My thought on this is that if changes to make it work on windows
> improve the test and/or build process, then thats good.  On the other
> hand I would be opposed to making test and/or build more complex
> inorder to support windows.   I would define increasing complexity as
> making it more difficult to run, maintain, or improve the test and/or
> build process.
>
> >
> > I don't think that this needs to be changed now as Hadoop only supports
> *nix based systems and we are close to a 1.5.0 release. If you want to
> tackle this in 1.6 (trunk) thats a different story.
> >
> >
> > ----- Original Message -----
> > From: "David Medinets" <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Sent: Thursday, March 21, 2013 10:08:48 PM
> > Subject: Re: Using powermock-api-mockito in tests?
> >
> > I hate ignoring things. It makes me uneasy. I'm looking at the other
> > tests as well. For example, the AccumuloDFSBase class depends on
> > running /bin/sh to find a umask. No reason that dependency can't be
> > mocked out during testing... If nothing else, this research will form
> > my own set of Accumulo Zen Koans.
> >
> > On Thu, Mar 21, 2013 at 10:03 PM, <[EMAIL PROTECTED]> wrote:
> >>
> >> Take a look at my other email on this subject, it might be better to
> just add the profile that I mentioned and add this to the list of ignored
> tests for now. I know that there is a ticket for removing ACCUMULO_HOME in
> all places.
> >>
> >> ----- Original Message -----
> >> From: "David Medinets" <[EMAIL PROTECTED]>
> >> To: [EMAIL PROTECTED]
> >> Sent: Thursday, March 21, 2013 9:58:18 PM
> >> Subject: Re: Using powermock-api-mockito in tests?
> >>
> >> Dave, you were very close. Here is the mocking code that I used.
> >>
> >> Map<String, String> mockSystemProperties = new HashMap<String,
> String>();
> >> mockSystemProperties.put("ACCUMULO_HOME", System.getenv("HOME"));
> >>
> >> PowerMock.mockStaticPartial(System.class, "getenv");
> >>
> EasyMock.expect(System.getenv()).andReturn(mockSystemProperties).anyTimes();
> >>
> EasyMock.expect(System.getenv("ACCUMULO_XTRAJARS")).andReturn("").anyTimes();
> >> PowerMock.replayAll();
> >>
> >> I'd like write a JIRA ticket and commit this code. I'll wait until
> >> tomorrow for feedback though. No rush for this kind of change.
> >>
> >> The message that started this investigation was:
> >>
> >>
> testDefaultConfig(org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoaderTest):
> >> Could not find file with URI "/lib/ext/[^.].*.jar" because it is a
> >> relative path, and no base URI was provided.
> >>
> >> It occured on line 135 of AccumuloVFSClassLoader.java because
> >> ACCUMULO_HOME was blank and therefore no base URI was provided.
>