Junit5: How to start a JUnit test from Eclipse console with JUnit as an application with main() method?

Created on 2 Oct 2020  路  13Comments  路  Source: junit-team/junit5

I tried at least 10 different parameter combinations - nothing works:

Unbessdsdnannt

And when i look at https://stackoverflow.com/questions/52373469/how-to-launch-junit-5-platform-from-the-command-line-without-maven-gradle/52373592#52373592 or https://junit.org/junit5/docs/current/user-guide/#running-tests-console-launcher i can't find any useful (concrete) examples...

...just things like: java -jar junit-platform-console-standalone-<version>.jar <Options> - that can also be shown with -help-paramter on "java -jar JUnit.jar ..."

Thank you for your feedbacks.

With kind regards,
Jan

Platform question

Most helpful comment

nobody needs that,

WTF?!?!

PHUCK that s**t!!!!!!!!!!!!!!

Doesn't meet our Code of Conduct.

All 13 comments

What i want is:

  1. To define a directory location where all test classes are like /ECLIPSE_PROJECT/classes/com/xxx/testing/junit/*

AND

  1. To define a path for a single class like /ECLIPSE_PROJECT/classes/com/xxx/testing/junit/MyJUnitTest(.class ???)

Doesn't work:

--disable-banner 鈥搒elect-class testing.junit.MyExampleJUnit5UnitTest

Doesn't work:

--disable-banner 鈥搒elect-class testing/junit/MyExampleJUnit5UnitTest

Doesn't work:

--disable-banner 鈥搒elect-class testing/junit/MyExampleJUnit5UnitTest.class

Doesn't work:

--disable-banner testing/junit/MyExampleJUnit5UnitTest.class

Doesn't work:

--disable-banner testing/junit/MyExampleJUnit5UnitTest

Doesn't work:

--disable-banner 鈥搒elect-class=testing.junit.MyExampleJUnit5UnitTest

-> It's EXACTLY THAT WHAT HELP PARAMETERS SAYS:

-c, --select-class=CLASS Select a class for test discovery. This option can be repeated.

Content of my test class:

package testing.junit;

import org.junit.jupiter.api.Test;

public class MyExampleJUnit5UnitTest {

    @Test
    public void abc() {

    }

    @Test
    public void cba() {

    }
}

nobody needs that,

WTF?!?!

PHUCK that s**t!!!!!!!!!!!!!!

Doesn't meet our Code of Conduct.

I'm sorry, now i've deleted / edited my posts...

The problem was there seems to be a "long" minus character i've copied from the internet. I works with computers since more than years, but i didn't know there is a min minus character besides the "normal" one.

On my keyboard there are to ones, but both are the same: One one the "normal" keyboard area, the other one one the numberic area.

Sry. again and thanks.

With kind regards,
Jan

The problem was there seems to be a "long" minus character i've copied from the internet. I works with computers since more than years, but i didn't know there is a min minus character besides the "normal" one.

Yes, you likely copied an m-dash when you needed a hyphen: https://www.punctuationmatters.com/hyphen-dash-n-dash-and-m-dash/

Glad you sorted it out!

Thank you very much for your information!! :-)

Was this page helpful?
0 / 5 - 0 ratings