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

Last change on this file since 27 was 27, checked in by bart, 4 years ago
  • party capabilities now include profile information. Existing parties may need small fix * plot layout shows accepts * VotingEvaluator use group power instead of group size * runsession you can now also select MOPAC-only parties
File size: 1.3 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.inform.Inform;
14import geniusweb.references.PartyRef;
15
16public class ClassPathConnectionFactoryTest {
17 private ClassPathConnectionFactory factory;
18
19 @Before
20 public void before() {
21 factory = new ClassPathConnectionFactory();
22
23 }
24
25 @Test(expected = IllegalArgumentException.class)
26 public void testWrongURI() throws IOException, URISyntaxException {
27 factory.connect(new PartyRef("http://blabla"));
28 }
29
30 @Test(expected = IllegalArgumentException.class)
31 public void testNullPath() throws IOException, URISyntaxException {
32 // bad because classpath should not start with //
33 factory.connect(new PartyRef("http://some.class.path"));
34 }
35
36 @Test(expected = IllegalArgumentException.class)
37 public void testUnknownParty() throws IOException, URISyntaxException {
38 factory.connect(new PartyRef("classpath:blabla.bla"));
39 }
40
41 @Test
42 public void testRandomParty() throws IOException, URISyntaxException {
43 ConnectionEnd<Action, Inform> party = factory.connect(new PartyRef(
44 "classpath:geniusweb.exampleparties.randomparty.RandomParty"));
45 assertNotNull(party);
46 }
47
48}
Note: See TracBrowser for help on using the repository browser.