| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package net.sf.arestc.core; |
| 22 |
|
|
| 23 |
|
import java.util.HashMap; |
| 24 |
|
import java.util.Map; |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
import junit.framework.TestCase; |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
@author |
| 34 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (63) |
Complexity: 10 |
Complexity Density: 0.19 |
|
| 35 |
|
public class StandardConnectorRequestTest extends TestCase { |
| 36 |
|
|
| 37 |
|
|
| 38 |
|
private StandardConnectorRequest request; |
| 39 |
|
|
| 40 |
|
|
| 41 |
|
private Map<String, Object> myParams; |
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
@see |
| 47 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
| 48 |
8
|
@Override... |
| 49 |
|
protected void setUp() throws Exception { |
| 50 |
8
|
super.setUp(); |
| 51 |
8
|
myParams = new HashMap<String, Object>(); |
| 52 |
8
|
myParams.put("store_type", "avm"); |
| 53 |
8
|
myParams.put("store_id", "1"); |
| 54 |
8
|
myParams.put("id", "1"); |
| 55 |
8
|
request = new StandardConnectorRequest("One", myParams); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
@see |
| 62 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 63 |
8
|
@Override... |
| 64 |
|
protected void tearDown() throws Exception { |
| 65 |
8
|
myParams = null; |
| 66 |
8
|
request = null; |
| 67 |
8
|
super.tearDown(); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
@link |
| 74 |
|
|
| 75 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 1 |
Complexity Density: 0.06 |
1
PASS
|
|
| 76 |
1
|
public void testEqualsObject() {... |
| 77 |
|
|
| 78 |
1
|
assertEquals(request, request); |
| 79 |
|
|
| 80 |
1
|
assertFalse(request.equals(null)); |
| 81 |
|
|
| 82 |
1
|
assertFalse(request.equals(myParams)); |
| 83 |
|
|
| 84 |
|
|
| 85 |
1
|
final ConnectorRequest otheRequest = new StandardConnectorRequest( |
| 86 |
|
"unknown", myParams); |
| 87 |
1
|
assertFalse(request.equals(otheRequest)); |
| 88 |
|
|
| 89 |
|
|
| 90 |
1
|
final Map<String, Object> altParams = new HashMap<String, Object>(); |
| 91 |
1
|
altParams.put("store_type", "dm"); |
| 92 |
1
|
altParams.put("store_id", "2"); |
| 93 |
1
|
altParams.put("id", "2"); |
| 94 |
1
|
ConnectorRequest altRequest = new StandardConnectorRequest("two", |
| 95 |
|
altParams); |
| 96 |
1
|
assertFalse(request.equals(altRequest)); |
| 97 |
|
|
| 98 |
|
|
| 99 |
1
|
altRequest = new StandardConnectorRequest("One", myParams); |
| 100 |
1
|
assertTrue(request.equals(altRequest)); |
| 101 |
|
|
| 102 |
|
|
| 103 |
1
|
altRequest = new StandardConnectorRequest("One", altParams); |
| 104 |
1
|
assertFalse(request.equals(altRequest)); |
| 105 |
|
|
| 106 |
|
|
| 107 |
1
|
altRequest = new StandardConnectorRequest("two", myParams); |
| 108 |
1
|
assertFalse(request.equals(altRequest)); |
| 109 |
|
|
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| 114 |
|
|
| 115 |
|
@link |
| 116 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
| 117 |
1
|
public void testGetEndLink() {... |
| 118 |
1
|
final ConnectorCommand command = new BaseCommand(); |
| 119 |
1
|
request.setEndLink(command); |
| 120 |
1
|
assertEquals(command, request.getEndLink()); |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
| 126 |
1
|
public void testGetEndTransformer() {... |
| 127 |
1
|
final ConnectorCommand command = new BaseCommand(); |
| 128 |
1
|
request.setEndTransformer(command); |
| 129 |
1
|
assertEquals(command, request.getEndTransformer()); |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
@link |
| 136 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 137 |
1
|
public void testGetParameters() {... |
| 138 |
1
|
assertEquals(myParams, request.getParameters()); |
| 139 |
|
} |
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
@link |
| 145 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 146 |
1
|
public void testGetService() {... |
| 147 |
1
|
assertEquals("One", request.getServiceName()); |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
|
| 151 |
|
|
| 152 |
|
|
| 153 |
|
@link |
| 154 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
| 155 |
1
|
public void testGetStartLink() {... |
| 156 |
1
|
final ConnectorCommand command = new BaseCommand(); |
| 157 |
1
|
request.setStartLink(command); |
| 158 |
1
|
assertEquals(command, request.getStartLink()); |
| 159 |
|
} |
| 160 |
|
|
| 161 |
|
|
| 162 |
|
|
| 163 |
|
|
| 164 |
|
@link |
| 165 |
|
|
| 166 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
1
PASS
|
|
| 167 |
1
|
public void testGetStartTransformer() {... |
| 168 |
1
|
final ConnectorCommand command = new BaseCommand(); |
| 169 |
1
|
request.setStartTransformer(command); |
| 170 |
1
|
assertEquals(command, request.getStartTransformer()); |
| 171 |
|
} |
| 172 |
|
|
| 173 |
|
|
| 174 |
|
|
| 175 |
|
|
| 176 |
|
@link |
| 177 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1
PASS
|
|
| 178 |
1
|
public void testHashCode() {... |
| 179 |
|
|
| 180 |
1
|
assertTrue(request.hashCode() == request.hashCode()); |
| 181 |
|
|
| 182 |
|
|
| 183 |
1
|
final Map<String, Object> altParams = new HashMap<String, Object>(); |
| 184 |
1
|
altParams.put("store_type", "dm"); |
| 185 |
1
|
altParams.put("store_id", "2"); |
| 186 |
1
|
altParams.put("id", "2"); |
| 187 |
1
|
ConnectorRequest altRequest = new StandardConnectorRequest("two", |
| 188 |
|
altParams); |
| 189 |
1
|
assertFalse(request.hashCode() == altRequest.hashCode()); |
| 190 |
|
|
| 191 |
|
|
| 192 |
1
|
altRequest = new StandardConnectorRequest("One", myParams); |
| 193 |
1
|
assertTrue(request.hashCode() == altRequest.hashCode()); |
| 194 |
|
|
| 195 |
|
|
| 196 |
1
|
altRequest = new StandardConnectorRequest("One", altParams); |
| 197 |
1
|
assertFalse(request.hashCode() == altRequest.hashCode()); |
| 198 |
|
|
| 199 |
|
|
| 200 |
1
|
altRequest = new StandardConnectorRequest("two", myParams); |
| 201 |
1
|
assertFalse(request.hashCode() == altRequest.hashCode()); |
| 202 |
|
} |
| 203 |
|
|
| 204 |
|
} |