I had a similar problem and this was the fix. Perhaps, it may work for you as 
well:
Comment out the following import statments:
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.Test;
Add these instead:
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
Ultimately, the annotations should be used as follow:
    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

Hope this helps.



    On Tuesday, May 19, 2020, 3:20:25 AM GMT+4:30, Greenberg, Gary 
<ggree...@visa.com.invalid> wrote:  
 
 #yiv7491570158 #yiv7491570158 -- _filtered {} _filtered {} _filtered {} 
_filtered {} _filtered {}#yiv7491570158 #yiv7491570158 
p.yiv7491570158MsoNormal, #yiv7491570158 li.yiv7491570158MsoNormal, 
#yiv7491570158 div.yiv7491570158MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:New 
serif;}#yiv7491570158 a:link, #yiv7491570158 span.yiv7491570158MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv7491570158 a:visited, #yiv7491570158 
span.yiv7491570158MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;}#yiv7491570158 
p.yiv7491570158msonormal0, #yiv7491570158 li.yiv7491570158msonormal0, 
#yiv7491570158 div.yiv7491570158msonormal0 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:New 
serif;}#yiv7491570158 p.yiv7491570158msonormal, #yiv7491570158 
li.yiv7491570158msonormal, #yiv7491570158 div.yiv7491570158msonormal 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:New 
serif;}#yiv7491570158 p.yiv7491570158msochpdefault, #yiv7491570158 
li.yiv7491570158msochpdefault, #yiv7491570158 div.yiv7491570158msochpdefault 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:New 
serif;}#yiv7491570158 span.yiv7491570158msohyperlink {}#yiv7491570158 
span.yiv7491570158msohyperlinkfollowed {}#yiv7491570158 
span.yiv7491570158emailstyle17 {}#yiv7491570158 p.yiv7491570158msonormal1, 
#yiv7491570158 li.yiv7491570158msonormal1, #yiv7491570158 
div.yiv7491570158msonormal1 
{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;}#yiv7491570158
 span.yiv7491570158msohyperlink1 
{color:#0563C1;text-decoration:underline;}#yiv7491570158 
span.yiv7491570158msohyperlinkfollowed1 
{color:#954F72;text-decoration:underline;}#yiv7491570158 
span.yiv7491570158emailstyle171 
{font-family:sans-serif;color:windowtext;}#yiv7491570158 
p.yiv7491570158msochpdefault1, #yiv7491570158 li.yiv7491570158msochpdefault1, 
#yiv7491570158 div.yiv7491570158msochpdefault1 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:sans-serif;}#yiv7491570158
 span.yiv7491570158EmailStyle28 
{font-family:sans-serif;color:#1F497D;}#yiv7491570158 
.yiv7491570158MsoChpDefault {font-size:10.0pt;} _filtered {}#yiv7491570158 
div.yiv7491570158WordSection1 {}#yiv7491570158 
Sure, Here is the whole test file attached.
 
  
 
Gary GreenbergError
 
Staff Software Engineer
 
Data Product Development, BI-A
 
E: ggree...@visa.com
 
M: 650-269-7902
 
  
 

 
  
 
From: HRH <hrh...@yahoo.com.INVALID>
Sent: Monday, May 18, 2020 3:30 PM
To: users@netbeans.apache.org; Greenberg, Gary <ggree...@visa.com.INVALID>
Subject: Re: Strange JUnit behavior
 
  
 
Can you post the import statments used in your test file?
 
  
 
On Tuesday, May 19, 2020, 2:54:47 AM GMT+4:30, Greenberg, Gary 
<ggree...@visa.com.invalid> wrote:
 
  
 
  
 
I have created a Junit test for one of my classes using Netbeans 
Tools->Create/Update Tests menu.
 
My class has just a single public method, therefore, test class contains only 
one @Test method.
 
I did edited it to reflect my functionality, but when I run this test file I am 
getting
 

 
Where these two erroneous tests are coming from, is a secret for me.
 
If someone can give me a clue, how to find why I am getting these errors and 
how to get rid of them,
I will appreciate it greatly.
 
Thanks,
 
Gary Greenberg
 
Staff Software Engineer
 
Data Product Development, BI-A
 
E:ggree...@visa.com
 
M: 650-269-7902
 
 
 

 
 
 
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists  

Attachment: MetricEvaluatorTest.java
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to