source: src/test/java/negotiator/repository/ProfileRepItemTest.java@ 346

Last change on this file since 346 was 75, checked in by Wouter Pasman, 6 years ago

#28 test profilerepitem

File size: 1.1 KB
Line 
1package negotiator.repository;
2
3import static org.junit.Assert.assertEquals;
4
5import java.io.StringWriter;
6import java.net.MalformedURLException;
7import java.net.URL;
8
9import javax.xml.bind.JAXBContext;
10import javax.xml.bind.JAXBException;
11import javax.xml.bind.Marshaller;
12
13import org.junit.Before;
14import org.junit.Test;
15
16import genius.core.repository.ProfileRepItem;
17
18public class ProfileRepItemTest {
19
20 private ProfileRepItem normalItem;
21 private String normalString = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><profileRepItem url=\"file:test\"/>";
22
23 @Before
24 public void before() throws MalformedURLException {
25 normalItem = new ProfileRepItem(new URL("file:test"), null);
26 }
27
28 @Test
29 public void testNormalItem() throws JAXBException, MalformedURLException {
30
31 StringWriter writer = new StringWriter();
32
33 JAXBContext context = JAXBContext.newInstance(ProfileRepItem.class);
34 Marshaller m = context.createMarshaller();
35 m.marshal(normalItem, writer);
36
37 assertEquals(normalString, writer.toString());
38 System.out.println(writer.toString());
39
40 }
41}
Note: See TracBrowser for help on using the repository browser.