#[JAVA] cannot find symbol @Test
9 messages · Page 1 of 1 (latest)
Could you share your code? And maybe the results as text (in a codeblock, not encoded in pixels)
Of course, the code:
public class Lasagna {
private final int MINUTES_PER_LAYER = 2;
// TODO: define the 'expectedMinutesInOven()' method
public int expectedMinutesInOven() {
return 40;
}
// TODO: define the 'remainingMinutesInOven()' method
public int remainingMinutesInOven(int actualMinutes) {
return this.expectedMinutesInOven() - actualMinutes;
}
// TODO: define the 'preparationTimeInMinutes()' method
public int preparationTimeInMinutes(int layers) {
return layers * MINUTES_PER_LAYER;
}
// TODO: define the 'totalTimeInMinutes()' method
public int totalTimeInMinutes(int layers, int timeInOven) {
return this.preparationTimeInMinutes(layers) + timeInOven;
}
}
The result:
AN ERROR OCCURRED
We received the following error when we ran your code:
./src/test/java/LasagnaTest.java:1: error: package org.junit does not exist
import org.junit.Test;
^./src/test/java/LasagnaTest.java:9: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:22: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:27: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:40: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:45: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:58: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:63: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:68: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:81: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTest./src/test/java/LasagnaTest.java:86: error: cannot find symbol
@Test
^
symbol: class Test
location: class LasagnaTestNote: ./src/test/java/utils/ReflectionProxy.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.
This might be worth reporting on the forum for the track maintainer. Did you modify the test file?
No, I just run the tests before submit my code. I have no access to test files, I think.
I'll report this. Thanks for the help Isaac o/
Problem solved.
I access again the plataform and I was asked to update the site, after this the tests runned with no problems.
Thanks for the help @upper frigate
I'm glad you got it working