My code:
import org.junit.Test;
import static org.junit.Assert.*;
public class AListTest {
@Test
public void testEmptySize() {
AList L = new AList();
assertEquals(0, L.size());
}
@Test
public void testAddAndSize() {
AList L = new AList();
L.addLast(99);
L.addLast(99);
assertEquals(2, L.size());
}
...rest of testing
}
I have both junit 4.13.2 and also 5.9.1 jupiter included in my dependencies because I was confused about what package to put in my project stucture/dependencies.
I am following this class by the way and I am trying to follow the commands at this part of this video…
The commands I am trying to run are
javac *.java
-and also-
time java speedtestAList
I have tried compiling with every permutation of those packages and none in my dependencies. I keep getting the same errors no matter what:
AListTest.java:1: error: package org.junit does not exist
import org.junit.Test;
^
AListTest.java:2: error: package org.junit does not exist
import static org.junit.Assert.*;
^
SpeedTestSLList.java:1: error: package org.junit does not exist
import org.junit.Test;
^
AListTest.java:9: error: cannot find symbol
@Test
^
symbol: class Test
location: class AListTest
AListTest.java:15: error: cannot find symbol
@Test
^
symbol: class Test
location: class AListTest
AListTest.java:24: error: cannot find symbol
@Test
....on like that through my file
I don’t know why testing is always so hard for me. I use C# normally and Xunit and moq give me so so much trouble too. I am so confused and stressed and overwhelmed honestly. Please can someone help me understand what I am doing wrong?
I have tried including different dependencies and using ai to troubleshoot. I have asked a couple friends who have been unable to help so far. I googled of course. I tried to rebuild the project every time I changed dependencies. I tried to “invalidated the caches” in intellij.