Skip to main content



      Home
Home » Newcomers » Newcomers » Syntax error on token "package", assert expected(MyScrapBook error)
Syntax error on token "package", assert expected [message #1338998] Wed, 07 May 2014 09:15 Go to next message
Eclipse UserFriend

I recieve the following error after "Inspect"of my scrapbook and I can not find the sollution.! I did add the import Assert in the source and the junit.framework.Assert in the import for MyScrapBook, but it is not helping

error I see: Syntax error on token "package", assert expected

package nl.visionfactory.www;
import java.util.ArrayList;
import junit.framework.TestCase;
import junit.framework.Assert;

class MyLibraryTest {

private Book b0;
private Book b1;
private Book b2;
private Person p0;
private Person p1;
private Person p3;
private MyLibrary ml;
//test the constructor for this library
public void testMyLibrary(){
ml = new MyLibrary ("Test");
assertEquals("Test", ml.name);
assertTrue(ml.books instanceof ArrayList);
assertTrue(ml.people instanceof ArrayList);
}
}
Re: Syntax error on token "package", assert expected [message #1339824 is a reply to message #1338998] Wed, 07 May 2014 17:23 Go to previous message
Eclipse UserFriend
The scrapbook isn't meant to contain an entire source file, just statements as would be within a method. Put this into a normal class and inspect the result of new nl.visionfactory.www.MyLibraryTest().testMyLibrary() instead.
Previous Topic:Eclipse and JRE
Next Topic:Need Help !! the emulator crashes !!
Goto Forum:
  


Current Time: Fri Jun 13 13:30:55 EDT 2025

Powered by FUDForum. Page generated in 0.08389 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top