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 3441478
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:33:29+00:00 2026-05-18T08:33:29+00:00

I am writing my unit test cases for a Java project using Scala (JUnit

  • 0

I am writing my unit test cases for a Java project using Scala (JUnit 4). I am running the tests using Maven.

I have written a src/test/scala/com.xxx.BaseTest class for the tests to provide some common functionality (@BeforeClass, etc.), but no actual @Test cases.

Whenever I run the tests using mvn on the command line, it insists on trying to look for tests in the BaseTest class, and gets an error because there are none present.

Other than using an @Ignore, is there any way to have Maven/Scala/Surefire not try to run the BaseTest class? Adding the @Ignore is not a big deal, but my test run shows one more test than I actually have with the label “Skipped: 1”.

UPDATE: I found a solution. I renamed BaseTest to Base; Maven now ignores it. Is there any other way?

  • 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-18T08:33:29+00:00Added an answer on May 18, 2026 at 8:33 am

    You can either rename the base test class not to have *Test ending, for example BaseTestCase.java. This is what I would recommend.

    Most likely maven executes tests with surefire plugin, so alternatively you just can configure surefire plugin to skip BaseTest.java. I think, by default surefire assumes that all classes ending with *Test are test classes. Something like this in the pom.xml.

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.6</version>
            <configuration>
              <excludes>
                <exclude>**/BaseTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using linq to nhibernate on my project, and I'm writing unit tests
I am writing unit tests for some of my code and have run into
In which parts of a project writing unit tests is nearly or really impossible?
I'm writing Unit test cases in Visual Studio 2008. I'm facing a weird problem.
I am writing unit test cases for a game I am working on. When
I'm working on writing simple unit tests for a Rails 3 project, but I'm
I am writing unit test for zend project, I want to know <?php class
I am writing unit tests for objects that are cloned, serialized, and/or written to
Im writing a unit test for a c# class, One of my tests should
I'm creating a program with LWJGL and Maven, and I'm writing unit tests for

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.