Hi Adrian, Yes, I tried it with a pure JUnit test in eclipse.
I have submitted https://issues.apache.org/jira/browse/HBASE-7718 for this issue. I tried it into Eclipse and with mvn command line and both are working fine. JM 2013/1/30, Adrian Muraru <[email protected]>: > Hi JM, > > You are running the test as a pure Junit test in eclipse right? > This is expected given the assumption that the test is run through > surefire plugin: > https://github.com/apache/hbase/blob/0.94/src/test/java/org/apache/hadoop/h > base/coprocessor/TestClassLoading.java#L171 > > > Additional class path tweaking is needed there to make it working from > eclipse. > > /adrian > > > On 1/30/13 4:03 PM, "Jean-Marc Spaggiari" <[email protected]> wrote: > >>Hi Ted, >> >>You have a point for the JVM! >> >>MVN is running with: Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre >>And Eclikpse with /usr/local/jdk1.7.0_05/ >> >>I change alligned the 2 to point to 1.7 but I'm still getting the same >>results. >> >> > >From mvn: >>Running org.apache.hadoop.hbase.coprocessor.TestClassLoading >>Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 40.215 sec >> >> >> > >From the eclipse console, for TestClassLoading.testHBase3810 I can see >>this: >> >>2013-01-30 08:46:04,962 DEBUG [main] >>coprocessor.TestClassLoading(178): Setting classpath to: >>/home/jmspaggi/workspace/hbase/hbase-server/./target/classes:null >>/home/jmspaggi/workspace/hbase/hbase-server/target/test-data/62cedbf2-dfb4 >>-4d6c-af05-bd9af0e46c77/src/TestCP1.java:1: >>cannot access com.google.common.collect.ImmutableList >>class file for com.google.common.collect.ImmutableList not found >>import org.apache.hadoop.hbase.coprocessor.*;public class TestCP1 >>extends BaseRegionObserver {} >> > >From the eclipse console, for >>TestClassLoading.testClassLoadingFromLibDirInJar I can see this: >>2013-01-30 08:57:24,838 DEBUG [main] >>coprocessor.TestClassLoading(178): Setting classpath to: >>/home/jmspaggi/workspace/hbase/hbase-server/./target/classes:null >>/home/jmspaggi/workspace/hbase/hbase-server/target/test-data/4585d7e8-a341 >>-45a5-810e-cc6157e740fe/src/TestCP1.java:1: >>cannot access com.google.common.collect.ImmutableList >>class file for com.google.common.collect.ImmutableList not found >>import org.apache.hadoop.hbase.coprocessor.*;public class TestCP1 >>extends BaseRegionObserver {} >> >>Exact same 2 issues. >> >>Here is the related code: >> String classpath = >> currentDir + File.separator + "target"+ File.separator + >>"classes" + >> System.getProperty("path.separator") + >> // Note that the below trick only works if mvn is running the >>test; >> // doesn't work in eclipse for example. >> System.getProperty("surefire.test.class.path"); >> >>That's why it's not working in Eclipse ;) >> >>We should read the classpath from eclipse and add it too to this string... >> >>JM >> >>2013/1/30, Ted <[email protected]>: >>> What test failure did you see ? >>> >>> Test output would help us understand. >>> >>> Btw jdk in eclipse is the same as jdk version you use in shell, right ? >>> >>> On Jan 30, 2013, at 4:54 AM, Jean-Marc Spaggiari >>><[email protected]> >>> wrote: >>> >>>> Hi, >>>> >>>> JUnit tests are failing in Eclipse for TestClassLoading but are >>>> working fine with mvn command line. >>>> >>>> Does anyone know why and how to fix that? >>>> >>>> JM >>> > >
