source: simplerunner/src/test/java/geniusweb/simplerunner/ClassPathConnectionFactoryTest.java@ 9

Last change on this file since 9 was 9, checked in by bart, 5 years ago

Release 1.1.0

File size: 1.4 KB
Line 
1package geniusweb.simplerunner;
2
3import static org.junit.Assert.assertNotNull;
4
5import java.io.IOException;
6import java.net.URISyntaxException;
7
8import org.junit.Before;
9import org.junit.Test;
10
11import geniusweb.actions.Action;
12import geniusweb.connection.ConnectionEnd;
13import geniusweb.party.inform.Inform;
14import geniusweb.references.PartyRef;
15import geniusweb.simplerunner.ClassPathConnectionFactory;
16
17public class ClassPathConnectionFactoryTest {
18 private ClassPathConnectionFactory factory;
19
20 @Before
21 public void before() {
22 factory = new ClassPathConnectionFactory();
23
24 }
25
26 @Test(expected = IllegalArgumentException.class)
27 public void testWrongURI() throws IOException, URISyntaxException {
28 factory.connect(new PartyRef("http://blabla"));
29 }
30
31 @Test(expected = IllegalArgumentException.class)
32 public void testNullPath() throws IOException, URISyntaxException {
33 // bad because classpath should not start with //
34 factory.connect(new PartyRef("http://some.class.path"));
35 }
36
37 @Test(expected = IllegalArgumentException.class)
38 public void testUnknownParty() throws IOException, URISyntaxException {
39 factory.connect(new PartyRef("classpath:blabla.bla"));
40 }
41
42 @Test
43 public void testRandomParty() throws IOException, URISyntaxException {
44 ConnectionEnd<Action, Inform> party = factory.connect(new PartyRef(
45 "classpath:geniusweb.exampleparties.randomparty.RandomParty"));
46 assertNotNull(party);
47 }
48
49}
Note: See TracBrowser for help on using the repository browser.