accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlmar...@comcast.net
Subject Re: Using powermock-api-mockito in tests?
Date Fri, 22 Mar 2013 02:03:16 GMT

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" <david.medinets@gmail.com> 
To: dev@accumulo.apache.org 
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. 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message