Git Product home page Git Product logo

Comments (10)

sormuras avatar sormuras commented on June 24, 2024

Thanks for creating this new issue and providing more details.

One more question: what is the file/class name of you JUnit 4 test?

from junit5-samples.

k-bhavitha avatar k-bhavitha commented on June 24, 2024

CalculatorJunit4Tests.java

from junit5-samples.

sormuras avatar sormuras commented on June 24, 2024

Okay, the s is at the end. If you want to include classes ending with Test you need to include them like:

        <junitlauncher haltOnFailure="true" printSummary="true">
            <classpath refid="test.classpath"/>
            <testclasses outputdir="build/test-report">
                <fileset dir="build/test">
                    <include name="**/*Tests.class"/>
                    <include name="**/*Test.class"/>
                </fileset>
...

Now to the content of CalculatorJunit4Tests.java. Can you please post it here, too?

from junit5-samples.

sormuras avatar sormuras commented on June 24, 2024

Looks like <junitlauncher> is started twice. Could be an issue with the task implementation.

from junit5-samples.

k-bhavitha avatar k-bhavitha commented on June 24, 2024

package com.example.project;

import org.junit.Test;
class CalculatortJunit4Tests{
@Test(expected = AssertionError.class)
public void assertErrorOldStyle() 	{throw new AssertionError(); 	}
}

from junit5-samples.

sormuras avatar sormuras commented on June 24, 2024

JUnit 3 and 4 classes need to be public.
@test is lower-case?! Added formatting your post. See https://guides.github.com/features/mastering-markdown/ for formatting features.

from junit5-samples.

k-bhavitha avatar k-bhavitha commented on June 24, 2024

Thanks! that worked..but a quick question
Are we not supposed to add the vintage jars/jupiter for junitlauncher task ?
How is that working without any

from junit5-samples.

sormuras avatar sormuras commented on June 24, 2024

Are we not supposed to add the vintage jars for junitlauncher task ?

Yes, we are, and we do. Via the JUnit 5 standalone distribution "all-deps-are-in" happy jar being copied to the ${ANT_HOME}/lib directory by the build.sh script:

wget --timestamping --continue --directory-prefix "${ant_folder}/lib" "http://central.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/${junit_platform_version}/junit-platform-console-standalone-${junit_platform_version}.jar"

This standalone jar contains all what it is needed to run Jupiter and Vintage (JUnit 3 + 4) tests.

from junit5-samples.

k-bhavitha avatar k-bhavitha commented on June 24, 2024

Great! Thanks

from junit5-samples.

sormuras avatar sormuras commented on June 24, 2024

You're welcome.

from junit5-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.