Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9205187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:53:36+00:00 2026-06-17T23:53:36+00:00

As mentioned on different locations, maven (version 3.0.1) doesn’t support a CLASSPATH outside the

  • 0

As mentioned on different locations, maven (version 3.0.1) doesn’t support a CLASSPATH outside the project. Thus when a jUnitTest want to launch an external application (like OpenOffice i.e.) it fails when launching the command ‘$> mvn test’.
In eclipse I can manualy add the CLASSPATH in ‘run configuration’ and then it works fine.

My question: Can I add code inside my jUnitTest source which verifies that I’m in Eclipse? As this will just skip the tests on the command line. While other tests still continue on the command line.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:53:38+00:00Added an answer on June 17, 2026 at 11:53 pm

    Write a class that verifies if the class you want to use is loaded (will need to be a separate class due to how classloaders work. it will be something like

    public class OODetector {
      public static boolean isOOOnClassPath() {
        try {
          OODetector.class.getClassLoader().loadClass("org.... class name here ...");
          return true;
        } catch (Throwable t) {
          return false;
        }
      } 
    }
    

    Now at the start of any test that requires the class on the classpath, just put Assume.assumeThat(OODetector.isOOOnClassPath(), is(true)); and your test will be skipped in such cases, e.g.

    public class OOTests {
      @Test
      public void smokes() throws Exception {
        Assume.assumeThat(OODetector.isOOOnClassPath(), is(true));
        // rest of test
      }
    }
    

    or better yet, put it in the @BeforeClass, e.g.

    public class OOTests {
      @BeforeClass
      public static void smokes() throws Exception {
        Assume.assumeThat(OODetector.isOOOnClassPath(), is(true));
      }
    
      // tests
    }
    

    That will skip all the tests in the class if OO is not on the classpath, does not affect failed count, but keeps the total test count valid, and when you figure out the correct way to get the runtime dependencies onto your Maven-launched test classpath then the tests will magically start running

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below mentioned is my XML, <?xml version=1.0 encoding=utf-8?> <soap:Envelopexmlns:soap=http://schemas.xmlsoap.org/soap/envelope/xmlns:xsi=http://www.w3.org/2001/XMLSchema-instancexmlns:xsd=http://www.w3.org/2001/XMLSchema> <soap:Body> <Response xmlns=http://tempuri.org/> <Result> <mp_response>
i want to have a group of check boxes like CheckListBox with different back
I want to move full text catalogue for 1 database to a different location
as mentioned in some other threads i'm a having trouble to setText inside a
somebody mentioned that the function (in this case a method) below is no good
As mentioned in the title, my launcher icon is showing up fine on the
Joel mentioned counting the number of set bits in a byte as a programming
I get the error mentioned here: C++ Templates Error: no matching function for call
In the examples mentioned for Out-of-order writes for double-checked locking scenarios (ref: IBM article
I the below mentioned program: string s; cout<<Enter a string:; gets(s); I expect my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.