Mercurial > dive4elements > river
comparison gwt-client/src/test/java/test/AbstractModuleRunner.java @ 9210:de55d9a94796
Fixed: was using java 7 features in java 6 code
author | gernotbelger |
---|---|
date | Tue, 03 Jul 2018 13:00:56 +0200 |
parents | 48d87af1243e |
children | 83aee0942eae |
comparison
equal
deleted
inserted
replaced
9209:f7f226666c59 | 9210:de55d9a94796 |
---|---|
63 | 63 |
64 public enum Infotype { | 64 public enum Infotype { |
65 sinfo | 65 sinfo |
66 } | 66 } |
67 | 67 |
68 private static final String lineSeparator = System.getProperty("line.separator"); | |
69 | |
68 private final String serverUrl = "http://localhost:8181"; | 70 private final String serverUrl = "http://localhost:8181"; |
69 private final String locale = "de"; | 71 private final String locale = "de"; |
70 private final HttpClient client; | 72 private final HttpClient client; |
71 | 73 |
72 private static final String exportFileDir = "D:" + File.separator; | 74 private static final String exportFileDir = "D:" + File.separator; |
169 | 171 |
170 private final String getReachableStateByIndex(final Artifact artifact, final int index) { | 172 private final String getReachableStateByIndex(final Artifact artifact, final int index) { |
171 | 173 |
172 final String[] states = artifact.getArtifactDescription().getReachableStates(); | 174 final String[] states = artifact.getArtifactDescription().getReachableStates(); |
173 if (states != null) { | 175 if (states != null) { |
174 if (states.length > index) { | 176 |
177 if (states.length > index) | |
175 return states[index]; | 178 return states[index]; |
176 } else { | 179 |
177 return states[0]; | 180 return states[0]; |
178 } | 181 } |
179 } else { | 182 |
180 return ""; | 183 return ""; |
181 } | |
182 } | 184 } |
183 | 185 |
184 private final void feed(final Data[] data) throws ServerException, ConnectionException { | 186 private final void feed(final Data[] data) throws ServerException, ConnectionException { |
185 final Document feed = ClientProtocolUtils.newFeedDocument(getArtifact().getUuid(), getArtifact().getHash(), createKVP(data)); | 187 final Document feed = ClientProtocolUtils.newFeedDocument(getArtifact().getUuid(), getArtifact().getHash(), createKVP(data)); |
186 final Document description = (Document) this.client.feed( | 188 final Document description = (Document) this.client.feed( |
268 Assert.assertEquals(expected, actual); | 270 Assert.assertEquals(expected, actual); |
269 } | 271 } |
270 | 272 |
271 private final String deleteErstelldatum(final String input) { | 273 private final String deleteErstelldatum(final String input) { |
272 String result = ""; | 274 String result = ""; |
273 final String[] lines = input.split(System.lineSeparator()); | 275 final String[] lines = input.split(lineSeparator); |
274 for (final String line : lines) { | 276 for (final String line : lines) { |
275 if (!line.contains(AbstractModuleRunner.IGNORE_ERSTELLDATUM) && !line.contains(AbstractModuleRunner.IGNORE_FLYS_VERSION) | 277 if (!line.contains(AbstractModuleRunner.IGNORE_ERSTELLDATUM) && !line.contains(AbstractModuleRunner.IGNORE_FLYS_VERSION) |
276 && !line.contains(AbstractModuleRunner.IGNORE_BEARBEITER)) { | 278 && !line.contains(AbstractModuleRunner.IGNORE_BEARBEITER)) { |
277 result = result + line + System.lineSeparator(); | 279 result = result + line + lineSeparator; |
278 } | 280 } |
279 } | 281 } |
280 return result; | 282 return result; |
281 } | 283 } |
282 | 284 |
338 protected final String getRecommendationPairString(final SimpleRecommendation rec1, final SimpleRecommendation rec2) | 340 protected final String getRecommendationPairString(final SimpleRecommendation rec1, final SimpleRecommendation rec2) |
339 throws ConnectionException, ServerException { | 341 throws ConnectionException, ServerException { |
340 | 342 |
341 return rec1.getRecommendationPairString(rec2, getCollection(), this.serverUrl, this.locale); | 343 return rec1.getRecommendationPairString(rec2, getCollection(), this.serverUrl, this.locale); |
342 } | 344 } |
343 | |
344 } | 345 } |