forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInternetProtocolTest.java
More file actions
50 lines (38 loc) · 1.18 KB
/
Copy pathInternetProtocolTest.java
File metadata and controls
50 lines (38 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.github.dockerjava.api.model;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import static com.github.dockerjava.api.model.InternetProtocol.TCP;
import static org.junit.Assert.assertEquals;
public class InternetProtocolTest {
@Rule
public ExpectedException expectedEx = ExpectedException.none();
@Test
public void defaultProtocol() {
assertEquals(InternetProtocol.DEFAULT, TCP);
}
@Test
public void stringify() {
assertEquals(TCP.toString(), "tcp");
}
@Test
public void parseUpperCase() {
assertEquals(InternetProtocol.parse("TCP"), TCP);
}
@Test
public void parseLowerCase() {
assertEquals(InternetProtocol.parse("tcp"), TCP);
}
@Test
public void parseInvalidInput() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Error parsing Protocol 'xx'");
InternetProtocol.parse("xx");
}
@Test
public void parseNull() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Error parsing Protocol 'null'");
InternetProtocol.parse(null);
}
}