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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:20:30+00:00 2026-05-30T04:20:30+00:00

I have (Test-A) fully annotated testng test in one project. Note: this test runs

  • 0

I have (Test-A) fully annotated testng test in one project. Note: this test runs successfully. Then I have another testng test (Test-B) in a different project extending (Test-A). This new (Test-B) does not have any annotations since its extending a class that does. My expectation is that when you run this test (Test-B), it should run the test-cases in the super class in addition to the testcase defineed within it which is the object-oriented way. The problem is that testng does not even recognize it as test since there is no annotation within it. I guess testng annotation processing does not consider super-class’s annotation??

  • 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-30T04:20:31+00:00Added an answer on May 30, 2026 at 4:20 am

    (Note, using plain old JUnit 4 here, not TestNG)

    Eclipse does appear to look up the class hierarchy for @Test annotations if the parent class is in the same project. The following example worked for me:

    public class A {
        @Test public void a() {
    
        }
    }
    
    public class B extends A {
    
    }
    

    When running B as a JUnit Test, it executes a() and passes.

    I then created two Eclipse projects, Test A and Test B. I made project B link to project A and repeated the above steps like you did, with class A in project A etc. Now, running class B as a unit test says ‘No JUnit tests found.’ Then, adding a @Test to class B solves the problem.

    So, we can deduce that Eclipse doesn’t leave the bounds of the current project when looking for test cases. I think your workaround of adding a single @Test to your class is a reasonable one, although I’m not sure why you would want to do this.

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

Sidebar

Related Questions

I have a test project using MbUnit and TestDriven.Net. If I right-click on an
I have a test in Excel VBA: If (test1) And (test2) And (test3) Then
I have fully isolated this problem to a very simple play app I think
I have defined my struct like this: struct Test { private string assayName; public
I have a collection of files with fully qualified paths (root/test/thing1/thing2/file.txt). I want to
I have test database and a production database. When developing I of course work
I've tryed mylyn but i cant find that feature, if anyone have test mantis
I have a test environment for a database that I want to reload with
I have a test web service replicating a live web service that hasn't been
I have a test generator written in Perl. It generates tests that connect to

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.