Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Ray Milkey | 34c9590 | 2015-04-15 09:47:53 -0700 | [diff] [blame] | 2 | * Copyright 2014-2015 Open Networking Laboratory |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 | */ |
Sho SHIMIZU | 6c28f83 | 2015-02-20 16:12:19 -0800 | [diff] [blame] | 16 | package org.onosproject.net.intent.impl.compiler; |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 17 | |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 18 | import org.hamcrest.Matchers; |
Ray Milkey | 40f50b9 | 2014-11-07 13:25:53 -0800 | [diff] [blame] | 19 | import org.junit.Test; |
Sho SHIMIZU | 6d01d3d | 2015-05-08 14:08:36 -0700 | [diff] [blame] | 20 | import org.onlab.util.Bandwidth; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 21 | import org.onosproject.TestApplicationId; |
| 22 | import org.onosproject.core.ApplicationId; |
| 23 | import org.onosproject.net.ConnectPoint; |
| 24 | import org.onosproject.net.Link; |
| 25 | import org.onosproject.net.Path; |
| 26 | import org.onosproject.net.flow.TrafficSelector; |
| 27 | import org.onosproject.net.flow.TrafficTreatment; |
| 28 | import org.onosproject.net.intent.AbstractIntentTest; |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 29 | import org.onosproject.net.intent.Constraint; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 30 | import org.onosproject.net.intent.Intent; |
| 31 | import org.onosproject.net.intent.IntentTestsMocks; |
| 32 | import org.onosproject.net.intent.PathIntent; |
| 33 | import org.onosproject.net.intent.PointToPointIntent; |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 34 | import org.onosproject.net.intent.constraint.BandwidthConstraint; |
| 35 | import org.onosproject.net.intent.constraint.LambdaConstraint; |
Sho SHIMIZU | 6c28f83 | 2015-02-20 16:12:19 -0800 | [diff] [blame] | 36 | import org.onosproject.net.intent.impl.PathNotFoundException; |
Sho SHIMIZU | 63feca7 | 2015-05-07 10:44:25 -0700 | [diff] [blame] | 37 | import org.onosproject.net.resource.BandwidthResource; |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 38 | import org.onosproject.net.resource.LambdaResource; |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 39 | import org.onosproject.net.resource.LinkResourceService; |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 40 | |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 41 | import java.util.Arrays; |
Thomas Vachuska | b97cf28 | 2014-10-20 23:31:12 -0700 | [diff] [blame] | 42 | import java.util.List; |
| 43 | |
Sho SHIMIZU | de8e6b5 | 2014-11-13 11:23:17 -0800 | [diff] [blame] | 44 | import static org.hamcrest.CoreMatchers.instanceOf; |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 45 | import static org.hamcrest.MatcherAssert.assertThat; |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 46 | import static org.hamcrest.Matchers.containsString; |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 47 | import static org.hamcrest.Matchers.hasSize; |
| 48 | import static org.hamcrest.Matchers.is; |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 49 | import static org.junit.Assert.fail; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 50 | import static org.onosproject.net.DefaultEdgeLink.createEdgeLink; |
| 51 | import static org.onosproject.net.DeviceId.deviceId; |
| 52 | import static org.onosproject.net.NetTestTools.APP_ID; |
| 53 | import static org.onosproject.net.NetTestTools.connectPoint; |
| 54 | import static org.onosproject.net.PortNumber.portNumber; |
| 55 | import static org.onosproject.net.intent.LinksHaveEntryWithSourceDestinationPairMatcher.linksHasPath; |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Unit tests for the HostToHost intent compiler. |
| 59 | */ |
Ray Milkey | 37f6a38 | 2014-11-25 14:54:42 -0800 | [diff] [blame] | 60 | public class PointToPointIntentCompilerTest extends AbstractIntentTest { |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 61 | |
Thomas Vachuska | b97cf28 | 2014-10-20 23:31:12 -0700 | [diff] [blame] | 62 | private static final ApplicationId APPID = new TestApplicationId("foo"); |
| 63 | |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 64 | private TrafficSelector selector = new IntentTestsMocks.MockSelector(); |
| 65 | private TrafficTreatment treatment = new IntentTestsMocks.MockTreatment(); |
| 66 | |
| 67 | /** |
| 68 | * Creates a PointToPoint intent based on ingress and egress device Ids. |
| 69 | * |
| 70 | * @param ingressIdString string for id of ingress device |
Thomas Vachuska | b97cf28 | 2014-10-20 23:31:12 -0700 | [diff] [blame] | 71 | * @param egressIdString string for id of egress device |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 72 | * @return PointToPointIntent for the two devices |
| 73 | */ |
| 74 | private PointToPointIntent makeIntent(String ingressIdString, |
| 75 | String egressIdString) { |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 76 | return PointToPointIntent.builder() |
| 77 | .appId(APPID) |
| 78 | .selector(selector) |
| 79 | .treatment(treatment) |
| 80 | .ingressPoint(connectPoint(ingressIdString, 1)) |
| 81 | .egressPoint(connectPoint(egressIdString, 1)) |
| 82 | .build(); |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | /** |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 86 | * Creates a PointToPoint intent based on ingress and egress deviceIds and constraints. |
| 87 | * |
| 88 | * @param ingressIdString string for id of ingress device |
| 89 | * @param egressIdString string for id of egress device |
| 90 | * @param constraints constraints |
| 91 | * @return PointToPointIntent for the two device with constraints |
| 92 | */ |
| 93 | private PointToPointIntent makeIntent(String ingressIdString, |
| 94 | String egressIdString, List<Constraint> constraints) { |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 95 | return PointToPointIntent.builder() |
| 96 | .appId(APPID) |
| 97 | .selector(selector) |
| 98 | .treatment(treatment) |
| 99 | .ingressPoint(connectPoint(ingressIdString, 1)) |
| 100 | .egressPoint(connectPoint(egressIdString, 1)) |
| 101 | .constraints(constraints) |
| 102 | .build(); |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | /** |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 106 | * Creates a compiler for HostToHost intents. |
| 107 | * |
| 108 | * @param hops string array describing the path hops to use when compiling |
| 109 | * @return HostToHost intent compiler |
| 110 | */ |
| 111 | private PointToPointIntentCompiler makeCompiler(String[] hops) { |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 112 | PointToPointIntentCompiler compiler = new PointToPointIntentCompiler(); |
Ray Milkey | 40f50b9 | 2014-11-07 13:25:53 -0800 | [diff] [blame] | 113 | compiler.pathService = new IntentTestsMocks.MockPathService(hops); |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 114 | return compiler; |
| 115 | } |
| 116 | |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 117 | /** |
| 118 | * Creates a point to point intent compiler for a three switch linear |
| 119 | * topology. |
| 120 | * |
| 121 | * @param resourceService service to use for resource allocation requests |
| 122 | * @return point to point compiler |
| 123 | */ |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 124 | private PointToPointIntentCompiler makeCompiler(String[] hops, LinkResourceService resourceService) { |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 125 | final PointToPointIntentCompiler compiler = new PointToPointIntentCompiler(); |
| 126 | compiler.resourceService = resourceService; |
| 127 | compiler.pathService = new IntentTestsMocks.MockPathService(hops); |
| 128 | return compiler; |
| 129 | } |
| 130 | |
| 131 | /** |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 132 | * Tests a pair of devices in an 8 hop path, forward direction. |
| 133 | */ |
Ray Milkey | 40f50b9 | 2014-11-07 13:25:53 -0800 | [diff] [blame] | 134 | @Test |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 135 | public void testForwardPathCompilation() { |
| 136 | |
| 137 | PointToPointIntent intent = makeIntent("d1", "d8"); |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 138 | |
| 139 | String[] hops = {"d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8"}; |
| 140 | PointToPointIntentCompiler compiler = makeCompiler(hops); |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 141 | |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 142 | List<Intent> result = compiler.compile(intent, null, null); |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 143 | assertThat(result, is(Matchers.notNullValue())); |
| 144 | assertThat(result, hasSize(1)); |
| 145 | Intent forwardResultIntent = result.get(0); |
| 146 | assertThat(forwardResultIntent instanceof PathIntent, is(true)); |
| 147 | |
| 148 | if (forwardResultIntent instanceof PathIntent) { |
| 149 | PathIntent forwardPathIntent = (PathIntent) forwardResultIntent; |
| 150 | // 7 links for the hops, plus one default lnk on ingress and egress |
| 151 | assertThat(forwardPathIntent.path().links(), hasSize(hops.length + 1)); |
| 152 | assertThat(forwardPathIntent.path().links(), linksHasPath("d1", "d2")); |
| 153 | assertThat(forwardPathIntent.path().links(), linksHasPath("d2", "d3")); |
| 154 | assertThat(forwardPathIntent.path().links(), linksHasPath("d3", "d4")); |
| 155 | assertThat(forwardPathIntent.path().links(), linksHasPath("d4", "d5")); |
| 156 | assertThat(forwardPathIntent.path().links(), linksHasPath("d5", "d6")); |
| 157 | assertThat(forwardPathIntent.path().links(), linksHasPath("d6", "d7")); |
| 158 | assertThat(forwardPathIntent.path().links(), linksHasPath("d7", "d8")); |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Tests a pair of devices in an 8 hop path, forward direction. |
| 164 | */ |
Ray Milkey | 40f50b9 | 2014-11-07 13:25:53 -0800 | [diff] [blame] | 165 | @Test |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 166 | public void testReversePathCompilation() { |
| 167 | |
| 168 | PointToPointIntent intent = makeIntent("d8", "d1"); |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 169 | |
| 170 | String[] hops = {"d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8"}; |
| 171 | PointToPointIntentCompiler compiler = makeCompiler(hops); |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 172 | |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 173 | List<Intent> result = compiler.compile(intent, null, null); |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 174 | assertThat(result, is(Matchers.notNullValue())); |
| 175 | assertThat(result, hasSize(1)); |
| 176 | Intent reverseResultIntent = result.get(0); |
| 177 | assertThat(reverseResultIntent instanceof PathIntent, is(true)); |
| 178 | |
| 179 | if (reverseResultIntent instanceof PathIntent) { |
| 180 | PathIntent reversePathIntent = (PathIntent) reverseResultIntent; |
| 181 | assertThat(reversePathIntent.path().links(), hasSize(hops.length + 1)); |
| 182 | assertThat(reversePathIntent.path().links(), linksHasPath("d2", "d1")); |
| 183 | assertThat(reversePathIntent.path().links(), linksHasPath("d3", "d2")); |
| 184 | assertThat(reversePathIntent.path().links(), linksHasPath("d4", "d3")); |
| 185 | assertThat(reversePathIntent.path().links(), linksHasPath("d5", "d4")); |
| 186 | assertThat(reversePathIntent.path().links(), linksHasPath("d6", "d5")); |
| 187 | assertThat(reversePathIntent.path().links(), linksHasPath("d7", "d6")); |
| 188 | assertThat(reversePathIntent.path().links(), linksHasPath("d8", "d7")); |
| 189 | } |
| 190 | } |
Sho SHIMIZU | de8e6b5 | 2014-11-13 11:23:17 -0800 | [diff] [blame] | 191 | |
| 192 | /** |
| 193 | * Tests compilation of the intent which designates two different ports on the same switch. |
| 194 | */ |
| 195 | @Test |
| 196 | public void testSameSwitchDifferentPortsIntentCompilation() { |
| 197 | ConnectPoint src = new ConnectPoint(deviceId("1"), portNumber(1)); |
| 198 | ConnectPoint dst = new ConnectPoint(deviceId("1"), portNumber(2)); |
Ray Milkey | 3e3ec5f | 2015-03-17 17:00:38 -0700 | [diff] [blame] | 199 | PointToPointIntent intent = PointToPointIntent.builder() |
| 200 | .appId(APP_ID) |
| 201 | .selector(selector) |
| 202 | .treatment(treatment) |
| 203 | .ingressPoint(src) |
| 204 | .egressPoint(dst) |
| 205 | .build(); |
Sho SHIMIZU | de8e6b5 | 2014-11-13 11:23:17 -0800 | [diff] [blame] | 206 | |
| 207 | String[] hops = {"1"}; |
| 208 | PointToPointIntentCompiler sut = makeCompiler(hops); |
| 209 | |
Brian O'Connor | fa81eae | 2014-10-30 13:20:05 -0700 | [diff] [blame] | 210 | List<Intent> compiled = sut.compile(intent, null, null); |
Sho SHIMIZU | de8e6b5 | 2014-11-13 11:23:17 -0800 | [diff] [blame] | 211 | |
| 212 | assertThat(compiled, hasSize(1)); |
| 213 | assertThat(compiled.get(0), is(instanceOf(PathIntent.class))); |
| 214 | Path path = ((PathIntent) compiled.get(0)).path(); |
| 215 | |
Sho SHIMIZU | 3908fde | 2014-11-19 16:30:22 -0800 | [diff] [blame] | 216 | assertThat(path.links(), hasSize(2)); |
| 217 | Link firstLink = path.links().get(0); |
| 218 | assertThat(firstLink, is(createEdgeLink(src, true))); |
| 219 | Link secondLink = path.links().get(1); |
| 220 | assertThat(secondLink, is(createEdgeLink(dst, false))); |
Sho SHIMIZU | de8e6b5 | 2014-11-13 11:23:17 -0800 | [diff] [blame] | 221 | } |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 222 | |
| 223 | /** |
| 224 | * Tests that requests with sufficient available bandwidth succeed. |
| 225 | */ |
| 226 | @Test |
| 227 | public void testBandwidthConstrainedIntentSuccess() { |
| 228 | |
| 229 | final LinkResourceService resourceService = |
| 230 | IntentTestsMocks.MockResourceService.makeBandwidthResourceService(1000.0); |
Sho SHIMIZU | 6d01d3d | 2015-05-08 14:08:36 -0700 | [diff] [blame] | 231 | final List<Constraint> constraints = Arrays.asList( |
| 232 | new BandwidthConstraint(new BandwidthResource(Bandwidth.bps(100.0)))); |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 233 | |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 234 | final PointToPointIntent intent = makeIntent("s1", "s3", constraints); |
| 235 | |
| 236 | String[] hops = {"s1", "s2", "s3"}; |
| 237 | final PointToPointIntentCompiler compiler = makeCompiler(hops, resourceService); |
| 238 | |
| 239 | final List<Intent> compiledIntents = compiler.compile(intent, null, null); |
| 240 | |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 241 | assertThat(compiledIntents, Matchers.notNullValue()); |
| 242 | assertThat(compiledIntents, hasSize(1)); |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * Tests that requests with insufficient available bandwidth fail. |
| 247 | */ |
| 248 | @Test |
| 249 | public void testBandwidthConstrainedIntentFailure() { |
| 250 | |
| 251 | final LinkResourceService resourceService = |
| 252 | IntentTestsMocks.MockResourceService.makeBandwidthResourceService(10.0); |
Sho SHIMIZU | 6d01d3d | 2015-05-08 14:08:36 -0700 | [diff] [blame] | 253 | final List<Constraint> constraints = Arrays.asList( |
| 254 | new BandwidthConstraint(new BandwidthResource(Bandwidth.bps(100.0)))); |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 255 | |
| 256 | try { |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 257 | final PointToPointIntent intent = makeIntent("s1", "s3", constraints); |
| 258 | |
| 259 | String[] hops = {"s1", "s2", "s3"}; |
| 260 | final PointToPointIntentCompiler compiler = makeCompiler(hops, resourceService); |
| 261 | |
| 262 | compiler.compile(intent, null, null); |
| 263 | |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 264 | fail("Point to Point compilation with insufficient bandwidth does " |
| 265 | + "not throw exception."); |
| 266 | } catch (PathNotFoundException noPath) { |
| 267 | assertThat(noPath.getMessage(), containsString("No path")); |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | /** |
| 272 | * Tests that requests for available lambdas are successful. |
| 273 | */ |
| 274 | @Test |
| 275 | public void testLambdaConstrainedIntentSuccess() { |
| 276 | |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 277 | final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(LambdaResource.valueOf(1))); |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 278 | final LinkResourceService resourceService = |
| 279 | IntentTestsMocks.MockResourceService.makeLambdaResourceService(1); |
| 280 | |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 281 | final PointToPointIntent intent = makeIntent("s1", "s3", constraints); |
| 282 | |
| 283 | String[] hops = {"s1", "s2", "s3"}; |
| 284 | final PointToPointIntentCompiler compiler = makeCompiler(hops, resourceService); |
| 285 | |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 286 | final List<Intent> compiledIntents = |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 287 | compiler.compile(intent, null, null); |
| 288 | |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 289 | assertThat(compiledIntents, Matchers.notNullValue()); |
| 290 | assertThat(compiledIntents, hasSize(1)); |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Tests that requests for lambdas when there are no available lambdas |
| 295 | * fail. |
| 296 | */ |
| 297 | @Test |
| 298 | public void testLambdaConstrainedIntentFailure() { |
| 299 | |
Sho SHIMIZU | 94b7ff4 | 2015-05-06 17:51:49 -0700 | [diff] [blame] | 300 | final List<Constraint> constraints = Arrays.asList(new LambdaConstraint(LambdaResource.valueOf(1))); |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 301 | final LinkResourceService resourceService = |
| 302 | IntentTestsMocks.MockResourceService.makeBandwidthResourceService(10.0); |
| 303 | try { |
Sho SHIMIZU | b705217 | 2015-02-20 11:09:21 -0800 | [diff] [blame] | 304 | final PointToPointIntent intent = makeIntent("s1", "s3", constraints); |
| 305 | |
| 306 | String[] hops = {"s1", "s2", "s3"}; |
| 307 | final PointToPointIntentCompiler compiler = makeCompiler(hops, resourceService); |
| 308 | |
| 309 | compiler.compile(intent, null, null); |
| 310 | |
Sho SHIMIZU | 0e73880 | 2015-02-20 10:23:28 -0800 | [diff] [blame] | 311 | fail("Point to Point compilation with no available lambda does " |
| 312 | + "not throw exception."); |
| 313 | } catch (PathNotFoundException noPath) { |
| 314 | assertThat(noPath.getMessage(), containsString("No path")); |
| 315 | } |
| 316 | } |
| 317 | |
Ray Milkey | c0fa4db | 2014-10-17 08:49:54 -0700 | [diff] [blame] | 318 | } |