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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:29:48+00:00 2026-06-05T15:29:48+00:00

Using JUnit 4.10 here is my test. package geometry; import org.junit.Assert.*; import org.junit.Test; public

  • 0

Using JUnit 4.10 here is my test.

package geometry;

import org.junit.Assert.*;
import org.junit.Test;

public class SegmentTest extends junit.framework.TestCase {

    @Test
    public void SegmentParallelTest() {
        Segment a = new Segment(10, 5, 20, 11);
        Segment b = new Segment(20, 6, 30, 11);
        assertFalse(a.isParallel(b));
    }

    public static junit.framework.Test suite() {
        return new junit.framework.JUnit4TestAdapter(SegmentTest.class);
    }

    public static void main(String args[]) {
        org.junit.runner.JUnitCore.main("geometry.SegmentTest");
    }
}

Which produces the following error message…

junit.framework.AssertionFailedError: No tests found in geometry.SegmentTest
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

What is wrong with this approach?

  • 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-05T15:29:49+00:00Added an answer on June 5, 2026 at 3:29 pm

    You are extending TestCase which expects test methods to start with test in their name. Remove the extends junit.framework.TestCase and it will work fine.

    package geometry;
    
    import org.junit.Test;
    import static org.junit.Assert.assertFalse;
    
    public class SegmentTest {
    
        @Test
        public void segmentParallelTest() {
            Segment a = new Segment(10, 5, 20, 11);
            Segment b = new Segment(20, 6, 30, 11);
            assertFalse(a.isParallel(b));
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my JUnit test class: package com.bynarystudio.tests.storefront; import java.util.List; import org.junit.Assert; import org.junit.Test;
I am having issues with the following code in Scala import org.junit.Test import org.junit.Assert._
Given the following example (using JUnit with Hamcrest matchers): Map<String, Class<? extends Serializable>> expected
I want to test my class MyTypeDAO implemented with Hibernate 4.1 using JUnit 4.9.
I have a basic question: When using JUnit, in your test suite (the class
I read in a few posts that using JUnit to test concurrency is not
I have organised my junit tests using one inner class per method as described:
I am using data-driven test suites running JUnit 3 based on Rainsberger's JUnit Recipes
I'm writing a JUnit test and also using Mockito, and I want to call
I am trying to execute a SQL script in my JUnit test using Spring.

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.