Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

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


+
David Medinets 2013-03-21, 20:59
+
dlmarion@... 2013-03-21, 21:11
+
Dave Marion 2013-03-21, 22:40
+
David Medinets 2013-03-22, 01:26
+
dlmarion@... 2013-03-22, 01:44
+
Josh Elser 2013-03-21, 22:43
+
Dave Marion 2013-03-21, 23:11
+
dlmarion@... 2013-03-22, 01:50
Copy link to this message
-
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.
+
dlmarion@... 2013-03-22, 02:03
+
David Medinets 2013-03-22, 02:08
+
dlmarion@... 2013-03-22, 02:16
+
Keith Turner 2013-03-22, 14:11
+
Jim Klucar 2013-03-22, 14:42
+
David Medinets 2013-03-22, 21:42
+
Dave Marion 2013-03-22, 22:48
+
David Medinets 2013-03-22, 23:54
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB