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

  • Home
  • SEARCH
  • 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 472713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T00:06:54+00:00 2026-05-13T00:06:54+00:00

I have a set of unit test cases that depend on a test.properties file.

  • 0

I have a set of unit test cases that depend on a test.properties file. When I run the tests under Mac OSX or Linux using Maven (‘mvn test’), they work fine. But when running under Windows 7, they can’t find the file unless I copy it directly to the class folder. The code to return the properties is the following two methods:

private void loadProperties() {
    try {
         properties.load(HibernateTestCase.class.getResourceAsStream(getPropertiesFilePath()));
    } catch (Exception ioExc) {
        ioExc.printStackTrace();
    }
}

private String getPropertiesFilePath() {
    return File.separator + "test.properties";
}

What’s the real deal here? Is it all about the file path being set wrong somewhere? Thanks in advance!

  • 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-05-13T00:06:54+00:00Added an answer on May 13, 2026 at 12:06 am

    The separator in resource names is always ‘/’. File.separator varies from platform to platform (on UNIX variants it will generally be /, on Windows it will not).

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

Sidebar

Related Questions

I have a unit-test that tests a variety of cases, like this: public void
I have a unit test that contains several test cases. I set them up
HI, I want to have set configuration settings for a unit test project that
I'm using Google Test Framework to set some unit tests. I have got three
I have a set of Visual Studio Team System unit (integration really) tests that
I have MS Test unit tests that ensure that an Exception is thrown when
I have a set of Unit Tests run in parallel ( this is important,
I have some written a number of unit tests that test a wrapper around
After I have set up all the unit test cases for my android application
I have a set of unit tests, each with a bunch of methods, each

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.