source: profileconnection/src/test/java/geniusweb/profileconnection/FileProfileConnTest.java@ 52

Last change on this file since 52 was 52, checked in by ruud, 14 months ago

Fixed small issues in domaineditor.

File size: 917 bytes
Line 
1package geniusweb.profileconnection;
2
3import static org.junit.Assert.assertEquals;
4
5import java.io.IOException;
6
7import org.junit.Test;
8
9import geniusweb.profileconnection.FileProfileConnector;
10
11public class FileProfileConnTest {
12 @Test(expected = IOException.class)
13 public void testNoSuchFile() throws IOException {
14 new FileProfileConnector("nosuchfile");
15 }
16
17 @Test(expected = IOException.class)
18 public void testWrongFileContents() throws IOException {
19 new FileProfileConnector("pom.xml");
20 }
21
22 @Test
23 public void testRead() throws IOException {
24 new FileProfileConnector("src/test/resources/testprofile.json");
25 }
26
27 @Test
28 public void testFetchedProfile() throws IOException {
29 FileProfileConnector conn = new FileProfileConnector(
30 "src/test/resources/testprofile.json");
31 assertEquals("testprofile", conn.getProfile().getName());
32 assertEquals("test", conn.getProfile().getDomain().getName());
33 }
34}
Note: See TracBrowser for help on using the repository browser.