1 package be.dvw.administration.test; 2 3 import be.dvw.administration.util.CastorUtils; 4 import be.dvw.administration.services.scores.ScoreService; 5 import be.dvw.administration.services.scores.ScoreServiceCastorImpl; 6 import be.dvw.administration.model.Score; 7 import junit.framework.TestCase; 8 import org.exolab.castor.xml.ValidationException; 9 import org.exolab.castor.xml.MarshalException; 10 11 import java.io.IOException; 12 import java.io.FileNotFoundException; 13 import java.io.File; 14 import java.util.List; 15 16 /*** 17 * User: Toon 18 * Date: 4-jul-2005 19 * Time: 19:00:46 20 */ 21 public class TestScoreService extends TestCase 22 23 24 { 25 ScoreService pServ = new ScoreServiceCastorImpl(); 26 27 public void testGetAllscores() throws Exception 28 { 29 assertEquals(3, pServ.getAll().size()); 30 } 31 32 public void testCreatePartituur() throws Exception 33 { 34 Score p = new Score(); 35 p.setComposer("Jacob De Haan"); 36 p.setName("Ross Roy"); 37 p.setDescription(""); 38 p.setPrice(100); 39 40 pServ.save(p, true); 41 } 42 43 public void testLoadPartituur() throws Exception 44 { 45 Score p = pServ.load(2); 46 assertEquals(2,p.getId()); 47 assertEquals("Bert kwappermont", p.getComposer()); 48 assertEquals("Absalon", p.getName()); 49 assertEquals(100,0 ,p.getPrice()); 50 51 52 } 53 54 }