mercredi 17 mai 2017

junit - test won't run and receiving lots of errors

I have downloaded my old project that was built on a different computer. I have Java environment installed on the current one. I have also downloaded junit to get things work. When I run my tests using build.rb and run_test.rb - files that worked previously, I receive lots of errors negating the entire code. Here's the example

$ ruby build.rb
shop_basket\Cashdesk.java:4: error: class CashDesk is public, should be 
declared in a file named CashDesk.java
public class CashDesk{
   ^
1 error
shop_basketSpec\CashdeskTest.java:5: error: class CashDeskTest is public, 
should be declared in a file named CashDeskTest.java
public class CashDeskTest{
   ^
shop_basketSpec\BasketTest.java:2: error: package org.junit does not exist
import org.junit.*;
^
shop_basketSpec\BasketTest.java:3: error: package org.junit does not exist
import static org.junit.Assert.*;
                   ^
shop_basketSpec\CashdeskTest.java:2: error: package org.junit does not exist
import org.junit.*;
^
shop_basketSpec\CashdeskTest.java:3: error: package org.junit does not exist
import static org.junit.Assert.*;
                   ^
shop_basketSpec\CashdeskTest.java:7: error: cannot find symbol
CashDesk cashdesk;
 ^
symbol:   class CashDesk
location: class CashDeskTest
shop_basketSpec\CustomerTest.java:2: error: package org.junit does not exist
import org.junit.*;
^
 shop_basketSpec\CustomerTest.java:3: error: package org.junit does not 
 exist
 import static org.junit.Assert.*;   ^
 shop_basketSpec\ProductTest.java:2: error: package org.junit does not exist
 import org.junit.*;
  ^

and there are more errors like this as if they concerned the entire code structure. I don't get why. All the CLASSPATH etc seems to be set on my windows OS. The entire thing irritates as I cannot move with my coding. Thanks for help

Aucun commentaire:

Enregistrer un commentaire