apache / apache/netbeans

Java with Ant - JUnit Bug

Open
#7,819 4 comments 0 reactions 0 assignees View on GitHub
Ant Java kind:bug needs:triage tests
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 23

### What happened

I created a simple unit test, but it generates the following error when running the test:

/home/ajvelez/.cache/netbeans/23/executor-snippets/junit.xml:184: The following error occurred while executing this line:
/home/ajvelez/.cache/netbeans/23/executor-snippets/junit.xml:128: The or for must include junit.jar if not in Ant's own classpath

### Language / Project Type / NetBeans Component

Java / Java with Ant / JUnit execute

### How to reproduce

Create a Java with Ant y execute the next test

```java
public class NewEmptyJUnitTest {

public NewEmptyJUnitTest() { }

@Test
public void hello() {
assertEquals(20, 20);
}
}
```

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Fedora 40

### JDK

JDK17 and JDK22

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the Java with Ant JUnit test in Apache NetBeans 23 using JDK 17 or 22 and Fedora 40. Inspect the generated executor-snippets/junit.xml references at lines 128 and 184; done means the sample test runs without the missing junit.jar classpath or modulepath error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.