Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.intent; |
Ray Milkey | e668408 | 2014-10-16 16:59:47 -0700 | [diff] [blame] | 17 | |
Jonathan Hart | 8ef6d3b | 2015-03-08 21:21:27 -0700 | [diff] [blame] | 18 | import com.google.common.base.MoreObjects; |
| 19 | import com.google.common.collect.ImmutableSet; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 20 | import org.onosproject.core.DefaultGroupId; |
| 21 | import org.onosproject.core.GroupId; |
| 22 | import org.onosproject.net.DeviceId; |
| 23 | import org.onosproject.net.ElementId; |
| 24 | import org.onosproject.net.Link; |
Ray Milkey | 5a7787a | 2015-02-23 11:44:30 -0800 | [diff] [blame] | 25 | import org.onosproject.net.NetTestTools; |
Ray Milkey | 43a2822 | 2015-02-23 13:57:58 -0800 | [diff] [blame] | 26 | import org.onosproject.net.NetworkResource; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 27 | import org.onosproject.net.Path; |
| 28 | import org.onosproject.net.flow.FlowId; |
| 29 | import org.onosproject.net.flow.FlowRule; |
| 30 | import org.onosproject.net.flow.TrafficSelector; |
| 31 | import org.onosproject.net.flow.TrafficTreatment; |
| 32 | import org.onosproject.net.flow.criteria.Criterion; |
| 33 | import org.onosproject.net.flow.criteria.Criterion.Type; |
| 34 | import org.onosproject.net.flow.instructions.Instruction; |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 35 | import org.onosproject.net.flow.instructions.Instructions; |
Ray Milkey | cf590df | 2015-02-23 17:43:24 -0800 | [diff] [blame] | 36 | import org.onosproject.net.resource.Bandwidth; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 37 | import org.onosproject.net.resource.BandwidthResourceRequest; |
Ray Milkey | b1b66d3 | 2015-03-02 10:27:11 -0800 | [diff] [blame] | 38 | import org.onosproject.net.resource.Lambda; |
| 39 | import org.onosproject.net.resource.LambdaResourceAllocation; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 40 | import org.onosproject.net.resource.LambdaResourceRequest; |
| 41 | import org.onosproject.net.resource.LinkResourceAllocations; |
| 42 | import org.onosproject.net.resource.LinkResourceListener; |
| 43 | import org.onosproject.net.resource.LinkResourceRequest; |
| 44 | import org.onosproject.net.resource.LinkResourceService; |
Ray Milkey | bb32048 | 2015-02-25 15:16:46 -0800 | [diff] [blame] | 45 | import org.onosproject.net.resource.MplsLabel; |
| 46 | import org.onosproject.net.resource.MplsLabelResourceAllocation; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 47 | import org.onosproject.net.resource.ResourceAllocation; |
| 48 | import org.onosproject.net.resource.ResourceRequest; |
| 49 | import org.onosproject.net.resource.ResourceType; |
| 50 | import org.onosproject.net.topology.DefaultTopologyEdge; |
| 51 | import org.onosproject.net.topology.DefaultTopologyVertex; |
| 52 | import org.onosproject.net.topology.LinkWeight; |
| 53 | import org.onosproject.net.topology.PathService; |
| 54 | import org.onosproject.net.topology.TopologyVertex; |
Ray Milkey | 5a7787a | 2015-02-23 11:44:30 -0800 | [diff] [blame] | 55 | import org.onosproject.store.Timestamp; |
Ray Milkey | e668408 | 2014-10-16 16:59:47 -0700 | [diff] [blame] | 56 | |
Jonathan Hart | 8ef6d3b | 2015-03-08 21:21:27 -0700 | [diff] [blame] | 57 | import java.util.ArrayList; |
| 58 | import java.util.Arrays; |
| 59 | import java.util.Collection; |
| 60 | import java.util.Collections; |
| 61 | import java.util.HashSet; |
| 62 | import java.util.LinkedList; |
| 63 | import java.util.List; |
| 64 | import java.util.Objects; |
| 65 | import java.util.Set; |
| 66 | import java.util.concurrent.atomic.AtomicLong; |
| 67 | |
| 68 | import static org.onosproject.net.NetTestTools.createPath; |
| 69 | import static org.onosproject.net.NetTestTools.did; |
| 70 | import static org.onosproject.net.NetTestTools.link; |
Ray Milkey | 43a2822 | 2015-02-23 13:57:58 -0800 | [diff] [blame] | 71 | |
Ray Milkey | e668408 | 2014-10-16 16:59:47 -0700 | [diff] [blame] | 72 | /** |
| 73 | * Common mocks used by the intent framework tests. |
| 74 | */ |
| 75 | public class IntentTestsMocks { |
| 76 | /** |
| 77 | * Mock traffic selector class used for satisfying API requirements. |
| 78 | */ |
| 79 | public static class MockSelector implements TrafficSelector { |
| 80 | @Override |
| 81 | public Set<Criterion> criteria() { |
| 82 | return new HashSet<>(); |
| 83 | } |
Jonathan Hart | 936c49d | 2014-10-23 16:38:59 -0700 | [diff] [blame] | 84 | |
| 85 | @Override |
| 86 | public Criterion getCriterion(Type type) { |
| 87 | return null; |
| 88 | } |
Ray Milkey | e668408 | 2014-10-16 16:59:47 -0700 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Mock traffic treatment class used for satisfying API requirements. |
| 93 | */ |
| 94 | public static class MockTreatment implements TrafficTreatment { |
| 95 | @Override |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 96 | public List<Instruction> deferred() { |
| 97 | return null; |
| 98 | } |
| 99 | |
| 100 | @Override |
| 101 | public List<Instruction> immediate() { |
Ray Milkey | 4250735 | 2015-03-20 15:16:10 -0700 | [diff] [blame] | 102 | return new ArrayList<>(); |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | @Override |
Jonathan Hart | 8ef6d3b | 2015-03-08 21:21:27 -0700 | [diff] [blame] | 106 | public List<Instruction> allInstructions() { |
| 107 | return null; |
| 108 | } |
| 109 | |
| 110 | @Override |
alshabib | 346b5b3 | 2015-03-06 00:42:16 -0800 | [diff] [blame] | 111 | public Instructions.TableTypeTransition tableTransition() { |
| 112 | return null; |
| 113 | } |
| 114 | |
| 115 | @Override |
| 116 | public Boolean clearedDeferred() { |
| 117 | return null; |
| 118 | } |
Ray Milkey | e668408 | 2014-10-16 16:59:47 -0700 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Mock path service for creating paths within the test. |
| 123 | */ |
| 124 | public static class MockPathService implements PathService { |
| 125 | |
| 126 | final String[] pathHops; |
| 127 | final String[] reversePathHops; |
| 128 | |
| 129 | /** |
| 130 | * Constructor that provides a set of hops to mock. |
| 131 | * |
| 132 | * @param pathHops path hops to mock |
| 133 | */ |
| 134 | public MockPathService(String[] pathHops) { |
| 135 | this.pathHops = pathHops; |
| 136 | String[] reversed = pathHops.clone(); |
| 137 | Collections.reverse(Arrays.asList(reversed)); |
| 138 | reversePathHops = reversed; |
| 139 | } |
| 140 | |
| 141 | @Override |
| 142 | public Set<Path> getPaths(ElementId src, ElementId dst) { |
| 143 | Set<Path> result = new HashSet<>(); |
| 144 | |
| 145 | String[] allHops = new String[pathHops.length]; |
| 146 | |
| 147 | if (src.toString().endsWith(pathHops[0])) { |
| 148 | System.arraycopy(pathHops, 0, allHops, 0, pathHops.length); |
| 149 | } else { |
| 150 | System.arraycopy(reversePathHops, 0, allHops, 0, pathHops.length); |
| 151 | } |
| 152 | |
| 153 | result.add(createPath(allHops)); |
| 154 | return result; |
| 155 | } |
| 156 | |
| 157 | @Override |
| 158 | public Set<Path> getPaths(ElementId src, ElementId dst, LinkWeight weight) { |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 159 | final Set<Path> paths = getPaths(src, dst); |
| 160 | |
| 161 | for (Path path : paths) { |
| 162 | final DeviceId srcDevice = path.src().deviceId(); |
| 163 | final DeviceId dstDevice = path.dst().deviceId(); |
| 164 | final TopologyVertex srcVertex = new DefaultTopologyVertex(srcDevice); |
| 165 | final TopologyVertex dstVertex = new DefaultTopologyVertex(dstDevice); |
| 166 | final Link link = link(src.toString(), 1, dst.toString(), 1); |
| 167 | |
| 168 | final double weightValue = weight.weight(new DefaultTopologyEdge(srcVertex, dstVertex, link)); |
| 169 | if (weightValue < 0) { |
| 170 | return new HashSet<>(); |
| 171 | } |
| 172 | } |
| 173 | return paths; |
Ray Milkey | e668408 | 2014-10-16 16:59:47 -0700 | [diff] [blame] | 174 | } |
| 175 | } |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 176 | |
| 177 | public static class MockLinkResourceAllocations implements LinkResourceAllocations { |
| 178 | @Override |
| 179 | public Set<ResourceAllocation> getResourceAllocation(Link link) { |
Ray Milkey | b1b66d3 | 2015-03-02 10:27:11 -0800 | [diff] [blame] | 180 | return ImmutableSet.of( |
| 181 | new LambdaResourceAllocation(Lambda.valueOf(77)), |
| 182 | new MplsLabelResourceAllocation(MplsLabel.valueOf(10))); |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | @Override |
| 186 | public IntentId intendId() { |
| 187 | return null; |
| 188 | } |
| 189 | |
| 190 | @Override |
| 191 | public Collection<Link> links() { |
| 192 | return null; |
| 193 | } |
| 194 | |
| 195 | @Override |
| 196 | public Set<ResourceRequest> resources() { |
| 197 | return null; |
| 198 | } |
| 199 | |
| 200 | @Override |
| 201 | public ResourceType type() { |
| 202 | return null; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | public static class MockedAllocationFailure extends RuntimeException { } |
| 207 | |
| 208 | public static class MockResourceService implements LinkResourceService { |
| 209 | |
| 210 | double availableBandwidth = -1.0; |
| 211 | int availableLambda = -1; |
| 212 | |
| 213 | /** |
| 214 | * Allocates a resource service that will allow bandwidth allocations |
| 215 | * up to a limit. |
| 216 | * |
| 217 | * @param bandwidth available bandwidth limit |
| 218 | * @return resource manager for bandwidth requests |
| 219 | */ |
| 220 | public static MockResourceService makeBandwidthResourceService(double bandwidth) { |
| 221 | final MockResourceService result = new MockResourceService(); |
| 222 | result.availableBandwidth = bandwidth; |
| 223 | return result; |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * Allocates a resource service that will allow lambda allocations. |
| 228 | * |
| 229 | * @param lambda Lambda to return for allocation requests. Currently unused |
| 230 | * @return resource manager for lambda requests |
| 231 | */ |
| 232 | public static MockResourceService makeLambdaResourceService(int lambda) { |
| 233 | final MockResourceService result = new MockResourceService(); |
| 234 | result.availableLambda = lambda; |
| 235 | return result; |
| 236 | } |
| 237 | |
| 238 | public void setAvailableBandwidth(double availableBandwidth) { |
| 239 | this.availableBandwidth = availableBandwidth; |
| 240 | } |
| 241 | |
| 242 | public void setAvailableLambda(int availableLambda) { |
| 243 | this.availableLambda = availableLambda; |
| 244 | } |
| 245 | |
| 246 | |
| 247 | @Override |
| 248 | public LinkResourceAllocations requestResources(LinkResourceRequest req) { |
| 249 | int lambda = -1; |
| 250 | double bandwidth = -1.0; |
| 251 | |
| 252 | for (ResourceRequest resourceRequest : req.resources()) { |
| 253 | if (resourceRequest.type() == ResourceType.BANDWIDTH) { |
| 254 | final BandwidthResourceRequest brr = (BandwidthResourceRequest) resourceRequest; |
| 255 | bandwidth = brr.bandwidth().toDouble(); |
| 256 | } else if (resourceRequest.type() == ResourceType.LAMBDA) { |
| 257 | lambda = 1; |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | if (availableBandwidth < bandwidth) { |
| 262 | throw new MockedAllocationFailure(); |
| 263 | } |
| 264 | if (lambda > 0 && availableLambda == 0) { |
| 265 | throw new MockedAllocationFailure(); |
| 266 | } |
| 267 | |
| 268 | return new IntentTestsMocks.MockLinkResourceAllocations(); |
| 269 | } |
| 270 | |
| 271 | @Override |
| 272 | public void releaseResources(LinkResourceAllocations allocations) { |
| 273 | // Mock |
| 274 | } |
| 275 | |
| 276 | @Override |
| 277 | public LinkResourceAllocations updateResources(LinkResourceRequest req, |
| 278 | LinkResourceAllocations oldAllocations) { |
| 279 | return null; |
| 280 | } |
| 281 | |
| 282 | @Override |
| 283 | public Iterable<LinkResourceAllocations> getAllocations() { |
Ray Milkey | bb32048 | 2015-02-25 15:16:46 -0800 | [diff] [blame] | 284 | return ImmutableSet.of( |
| 285 | new IntentTestsMocks.MockLinkResourceAllocations()); |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | @Override |
| 289 | public Iterable<LinkResourceAllocations> getAllocations(Link link) { |
Ray Milkey | bb32048 | 2015-02-25 15:16:46 -0800 | [diff] [blame] | 290 | return ImmutableSet.of( |
| 291 | new IntentTestsMocks.MockLinkResourceAllocations()); |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | @Override |
| 295 | public LinkResourceAllocations getAllocations(IntentId intentId) { |
Ray Milkey | bb32048 | 2015-02-25 15:16:46 -0800 | [diff] [blame] | 296 | return new IntentTestsMocks.MockLinkResourceAllocations(); |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | @Override |
| 300 | public Iterable<ResourceRequest> getAvailableResources(Link link) { |
| 301 | final List<ResourceRequest> result = new LinkedList<>(); |
| 302 | if (availableBandwidth > 0.0) { |
Ray Milkey | cf590df | 2015-02-23 17:43:24 -0800 | [diff] [blame] | 303 | result.add(new BandwidthResourceRequest( |
| 304 | Bandwidth.bps(availableBandwidth))); |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 305 | } |
| 306 | if (availableLambda > 0) { |
| 307 | result.add(new LambdaResourceRequest()); |
| 308 | } |
| 309 | return result; |
| 310 | } |
| 311 | |
| 312 | @Override |
weibit | 00c94f5 | 2014-11-16 07:09:05 -0800 | [diff] [blame] | 313 | public Iterable<ResourceRequest> getAvailableResources(Link link, LinkResourceAllocations allocations) { |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 314 | return null; |
| 315 | } |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 316 | |
| 317 | @Override |
| 318 | public void addListener(LinkResourceListener listener) { |
| 319 | |
| 320 | } |
| 321 | |
| 322 | @Override |
| 323 | public void removeListener(LinkResourceListener listener) { |
| 324 | |
| 325 | } |
Ray Milkey | 8d3ce43 | 2014-11-07 16:21:10 -0800 | [diff] [blame] | 326 | } |
| 327 | |
Ray Milkey | 930fc66 | 2014-11-11 16:07:45 -0800 | [diff] [blame] | 328 | private static final IntentTestsMocks.MockSelector SELECTOR = |
| 329 | new IntentTestsMocks.MockSelector(); |
| 330 | private static final IntentTestsMocks.MockTreatment TREATMENT = |
| 331 | new IntentTestsMocks.MockTreatment(); |
| 332 | |
| 333 | public static class MockFlowRule implements FlowRule { |
| 334 | |
| 335 | int priority; |
sangho | 11c30ac | 2015-01-22 14:30:55 -0800 | [diff] [blame] | 336 | Type type; |
| 337 | |
Ray Milkey | 930fc66 | 2014-11-11 16:07:45 -0800 | [diff] [blame] | 338 | public MockFlowRule(int priority) { |
| 339 | this.priority = priority; |
sangho | 11c30ac | 2015-01-22 14:30:55 -0800 | [diff] [blame] | 340 | this.type = Type.DEFAULT; |
Ray Milkey | 930fc66 | 2014-11-11 16:07:45 -0800 | [diff] [blame] | 341 | } |
| 342 | |
| 343 | @Override |
| 344 | public FlowId id() { |
| 345 | return FlowId.valueOf(1); |
| 346 | } |
| 347 | |
| 348 | @Override |
| 349 | public short appId() { |
| 350 | return 0; |
| 351 | } |
| 352 | |
| 353 | @Override |
Sho SHIMIZU | 75a5bd9 | 2014-11-25 11:22:56 -0800 | [diff] [blame] | 354 | public GroupId groupId() { |
| 355 | return new DefaultGroupId(0); |
alshabib | 28204e5 | 2014-11-12 18:29:45 -0800 | [diff] [blame] | 356 | } |
| 357 | |
| 358 | @Override |
Ray Milkey | 930fc66 | 2014-11-11 16:07:45 -0800 | [diff] [blame] | 359 | public int priority() { |
| 360 | return priority; |
| 361 | } |
| 362 | |
| 363 | @Override |
| 364 | public DeviceId deviceId() { |
| 365 | return did("1"); |
| 366 | } |
| 367 | |
| 368 | @Override |
| 369 | public TrafficSelector selector() { |
| 370 | return SELECTOR; |
| 371 | } |
| 372 | |
| 373 | @Override |
| 374 | public TrafficTreatment treatment() { |
| 375 | return TREATMENT; |
| 376 | } |
| 377 | |
| 378 | @Override |
| 379 | public int timeout() { |
| 380 | return 0; |
| 381 | } |
| 382 | |
| 383 | @Override |
| 384 | public boolean isPermanent() { |
| 385 | return false; |
| 386 | } |
| 387 | |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame] | 388 | @Override |
| 389 | public int hashCode() { |
| 390 | return Objects.hash(priority); |
| 391 | } |
Ray Milkey | 930fc66 | 2014-11-11 16:07:45 -0800 | [diff] [blame] | 392 | |
Brian O'Connor | 427a176 | 2014-11-19 18:40:32 -0800 | [diff] [blame] | 393 | @Override |
| 394 | public boolean equals(Object obj) { |
| 395 | if (this == obj) { |
| 396 | return true; |
| 397 | } |
| 398 | if (obj == null || getClass() != obj.getClass()) { |
| 399 | return false; |
| 400 | } |
| 401 | final MockFlowRule other = (MockFlowRule) obj; |
| 402 | return Objects.equals(this.priority, other.priority); |
| 403 | } |
sangho | 11c30ac | 2015-01-22 14:30:55 -0800 | [diff] [blame] | 404 | |
| 405 | @Override |
| 406 | public Type type() { |
| 407 | return type; |
| 408 | } |
Ray Milkey | 930fc66 | 2014-11-11 16:07:45 -0800 | [diff] [blame] | 409 | } |
| 410 | |
Ray Milkey | 5a7787a | 2015-02-23 11:44:30 -0800 | [diff] [blame] | 411 | public static class MockIntent extends Intent { |
| 412 | private static AtomicLong counter = new AtomicLong(0); |
| 413 | |
| 414 | private final Long number; |
| 415 | |
| 416 | public MockIntent(Long number) { |
Ray Milkey | ebc5d22 | 2015-03-18 15:45:36 -0700 | [diff] [blame] | 417 | super(NetTestTools.APP_ID, null, Collections.emptyList(), |
| 418 | Intent.DEFAULT_INTENT_PRIORITY); |
Ray Milkey | 5a7787a | 2015-02-23 11:44:30 -0800 | [diff] [blame] | 419 | this.number = number; |
| 420 | } |
| 421 | |
Ray Milkey | 43a2822 | 2015-02-23 13:57:58 -0800 | [diff] [blame] | 422 | public MockIntent(Long number, Collection<NetworkResource> resources) { |
Ray Milkey | ebc5d22 | 2015-03-18 15:45:36 -0700 | [diff] [blame] | 423 | super(NetTestTools.APP_ID, null, resources, Intent.DEFAULT_INTENT_PRIORITY); |
Ray Milkey | 43a2822 | 2015-02-23 13:57:58 -0800 | [diff] [blame] | 424 | this.number = number; |
| 425 | } |
| 426 | |
Ray Milkey | 5a7787a | 2015-02-23 11:44:30 -0800 | [diff] [blame] | 427 | public Long number() { |
| 428 | return number; |
| 429 | } |
| 430 | |
| 431 | public static Long nextId() { |
| 432 | return counter.getAndIncrement(); |
| 433 | } |
Ray Milkey | 43a2822 | 2015-02-23 13:57:58 -0800 | [diff] [blame] | 434 | |
| 435 | @Override |
| 436 | public String toString() { |
| 437 | return MoreObjects.toStringHelper(getClass()) |
| 438 | .add("id", id()) |
| 439 | .add("appId", appId()) |
| 440 | .toString(); |
| 441 | } |
Ray Milkey | 5a7787a | 2015-02-23 11:44:30 -0800 | [diff] [blame] | 442 | } |
| 443 | |
| 444 | public static class MockTimestamp implements Timestamp { |
| 445 | final int value; |
| 446 | |
| 447 | public MockTimestamp(int value) { |
| 448 | this.value = value; |
| 449 | } |
| 450 | |
| 451 | @Override |
| 452 | public int compareTo(Timestamp o) { |
| 453 | if (!(o instanceof MockTimestamp)) { |
| 454 | return -1; |
| 455 | } |
| 456 | MockTimestamp that = (MockTimestamp) o; |
Jonathan Hart | 72175c2 | 2015-03-24 18:55:58 -0700 | [diff] [blame^] | 457 | return this.value - that.value; |
Ray Milkey | 5a7787a | 2015-02-23 11:44:30 -0800 | [diff] [blame] | 458 | } |
| 459 | } |
| 460 | |
Ray Milkey | e668408 | 2014-10-16 16:59:47 -0700 | [diff] [blame] | 461 | } |