How to use Range method of org.easymock.internal.Range class

Best Easymock code snippet using org.easymock.internal.Range.Range

Source:TestOfferServiceUtilitiesImplPanktiGen.java Github

copy

Full Screen

...71 " </expectedInvocation>" +72 " <results>" +73 " <callCount>0</callCount>" +74 " <ranges>" +75 " <org.easymock.internal.Range>" +76 " <minimum>0</minimum>" +77 " <maximum>2147483647</maximum>" +78 " </org.easymock.internal.Range>" +79 " </ranges>" +80 " <results>" +81 " <org.easymock.internal.Result>" +82 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +83 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +84 " </org.easymock.internal.Result>" +85 " </results>" +86 " </results>" +87 " </org.easymock.internal.ExpectedInvocationAndResults>" +88 " <org.easymock.internal.ExpectedInvocationAndResults>" +89 " <expectedInvocation>" +90 " <invocation serialization=\"custom\">" +91 " <org.easymock.internal.Invocation>" +92 " <default>" +93 " <arguments/>" +94 " <currentCaptures class=\"list\"/>" +95 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +96 " </default>" +97 " <org.easymock.internal.MethodSerializationWrapper>" +98 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +99 " <methodName>createFulfillmentGroupAdjustment</methodName>" +100 " <parameterTypeNames/>" +101 " </org.easymock.internal.MethodSerializationWrapper>" +102 " </org.easymock.internal.Invocation>" +103 " </invocation>" +104 " <matchers/>" +105 " </expectedInvocation>" +106 " <results>" +107 " <callCount>0</callCount>" +108 " <ranges>" +109 " <org.easymock.internal.Range reference=\"../../../../org.easymock.internal.ExpectedInvocationAndResults/results/ranges/org.easymock.internal.Range\"/>" +110 " </ranges>" +111 " <results>" +112 " <org.easymock.internal.Result>" +113 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$6\"/>" +114 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +115 " </org.easymock.internal.Result>" +116 " </results>" +117 " </results>" +118 " </org.easymock.internal.ExpectedInvocationAndResults>" +119 " </results>" +120 " <checkOrder>false</checkOrder>" +121 " </org.easymock.internal.UnorderedBehavior>" +122 " </behaviorLists>" +123 " <stubResults/>" +124 " <nice>false</nice>" +125 " <checkOrder>false</checkOrder>" +126 " <isThreadSafe>true</isThreadSafe>" +127 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +128 " <position>0</position>" +129 " </behavior>" +130 " <lock>" +131 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +132 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +133 " <default>" +134 " <state>0</state>" +135 " </default>" +136 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +137 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +138 " <default/>" +139 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +140 " </sync>" +141 " </lock>" +142 " </state>" +143 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +144 " <type>DEFAULT</type>" +145 " </control>" +146 " </delegate>" +147 " </default>" +148 " <org.easymock.internal.MethodSerializationWrapper>" +149 " <className>java.lang.Object</className>" +150 " <methodName>toString</methodName>" +151 " <parameterTypeNames/>" +152 " </org.easymock.internal.MethodSerializationWrapper>" +153 " <org.easymock.internal.MethodSerializationWrapper>" +154 " <className>java.lang.Object</className>" +155 " <methodName>equals</methodName>" +156 " <parameterTypeNames>" +157 " <string>java.lang.Object</string>" +158 " </parameterTypeNames>" +159 " </org.easymock.internal.MethodSerializationWrapper>" +160 " <org.easymock.internal.MethodSerializationWrapper>" +161 " <className>java.lang.Object</className>" +162 " <methodName>hashCode</methodName>" +163 " <parameterTypeNames/>" +164 " </org.easymock.internal.MethodSerializationWrapper>" +165 " </org.easymock.internal.ObjectMethodsFilter>" +166 " </handler>" +167 " </offerDao>" +168 " <entityService class=\"dynamic-proxy\">" +169 " <interface>org.broadleafcommerce.common.service.GenericEntityService</interface>" +170 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +171 " <org.easymock.internal.ObjectMethodsFilter>" +172 " <default>" +173 " <delegate>" +174 " <control>" +175 " <state class=\"org.easymock.internal.RecordState\">" +176 " <lastInvocationUsed>true</lastInvocationUsed>" +177 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +178 " <behaviorLists/>" +179 " <stubResults/>" +180 " <nice>false</nice>" +181 " <checkOrder>false</checkOrder>" +182 " <isThreadSafe>true</isThreadSafe>" +183 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +184 " <position>0</position>" +185 " </behavior>" +186 " </state>" +187 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +188 " <type>DEFAULT</type>" +189 " </control>" +190 " </delegate>" +191 " </default>" +192 " <org.easymock.internal.MethodSerializationWrapper>" +193 " <className>java.lang.Object</className>" +194 " <methodName>toString</methodName>" +195 " <parameterTypeNames/>" +196 " </org.easymock.internal.MethodSerializationWrapper>" +197 " <org.easymock.internal.MethodSerializationWrapper>" +198 " <className>java.lang.Object</className>" +199 " <methodName>equals</methodName>" +200 " <parameterTypeNames>" +201 " <string>java.lang.Object</string>" +202 " </parameterTypeNames>" +203 " </org.easymock.internal.MethodSerializationWrapper>" +204 " <org.easymock.internal.MethodSerializationWrapper>" +205 " <className>java.lang.Object</className>" +206 " <methodName>hashCode</methodName>" +207 " <parameterTypeNames/>" +208 " </org.easymock.internal.MethodSerializationWrapper>" +209 " </org.easymock.internal.ObjectMethodsFilter>" +210 " </handler>" +211 " </entityService>" +212 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +213 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";214 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);215 String paramsObjectStr = 216 "<object-array>" +217 " <null/>" +218 "</object-array>";219 Object[] paramObjects = deserializeObject(paramsObjectStr);220 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];221 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));222 }223 @Test224 public void testFindRelatedQualifierRoot2() throws Exception {225 String receivingObjectStr = 226 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +227 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +228 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +229 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +230 " </promotableItemFactory>" +231 " <offerDao class=\"dynamic-proxy\">" +232 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +233 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +234 " <org.easymock.internal.ObjectMethodsFilter>" +235 " <default>" +236 " <delegate>" +237 " <control>" +238 " <state class=\"org.easymock.internal.ReplayState\">" +239 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +240 " <behaviorLists>" +241 " <org.easymock.internal.UnorderedBehavior>" +242 " <results>" +243 " <org.easymock.internal.ExpectedInvocationAndResults>" +244 " <expectedInvocation>" +245 " <invocation serialization=\"custom\">" +246 " <org.easymock.internal.Invocation>" +247 " <default>" +248 " <arguments/>" +249 " <currentCaptures class=\"list\"/>" +250 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +251 " </default>" +252 " <org.easymock.internal.MethodSerializationWrapper>" +253 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +254 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +255 " <parameterTypeNames/>" +256 " </org.easymock.internal.MethodSerializationWrapper>" +257 " </org.easymock.internal.Invocation>" +258 " </invocation>" +259 " <matchers/>" +260 " </expectedInvocation>" +261 " <results>" +262 " <callCount>3</callCount>" +263 " <ranges>" +264 " <org.easymock.internal.Range>" +265 " <minimum>0</minimum>" +266 " <maximum>2147483647</maximum>" +267 " </org.easymock.internal.Range>" +268 " </ranges>" +269 " <results>" +270 " <org.easymock.internal.Result>" +271 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +272 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +273 " </org.easymock.internal.Result>" +274 " </results>" +275 " </results>" +276 " </org.easymock.internal.ExpectedInvocationAndResults>" +277 " </results>" +278 " <checkOrder>false</checkOrder>" +279 " </org.easymock.internal.UnorderedBehavior>" +280 " </behaviorLists>" +281 " <stubResults/>" +282 " <nice>false</nice>" +283 " <checkOrder>false</checkOrder>" +284 " <isThreadSafe>true</isThreadSafe>" +285 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +286 " <position>0</position>" +287 " </behavior>" +288 " <lock>" +289 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +290 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +291 " <default>" +292 " <state>0</state>" +293 " </default>" +294 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +295 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +296 " <default/>" +297 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +298 " </sync>" +299 " </lock>" +300 " </state>" +301 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +302 " <type>DEFAULT</type>" +303 " </control>" +304 " </delegate>" +305 " </default>" +306 " <org.easymock.internal.MethodSerializationWrapper>" +307 " <className>java.lang.Object</className>" +308 " <methodName>toString</methodName>" +309 " <parameterTypeNames/>" +310 " </org.easymock.internal.MethodSerializationWrapper>" +311 " <org.easymock.internal.MethodSerializationWrapper>" +312 " <className>java.lang.Object</className>" +313 " <methodName>equals</methodName>" +314 " <parameterTypeNames>" +315 " <string>java.lang.Object</string>" +316 " </parameterTypeNames>" +317 " </org.easymock.internal.MethodSerializationWrapper>" +318 " <org.easymock.internal.MethodSerializationWrapper>" +319 " <className>java.lang.Object</className>" +320 " <methodName>hashCode</methodName>" +321 " <parameterTypeNames/>" +322 " </org.easymock.internal.MethodSerializationWrapper>" +323 " </org.easymock.internal.ObjectMethodsFilter>" +324 " </handler>" +325 " </offerDao>" +326 " <entityService class=\"dynamic-proxy\">" +327 " <interface>org.broadleafcommerce.common.service.GenericEntityService</interface>" +328 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +329 " <org.easymock.internal.ObjectMethodsFilter>" +330 " <default>" +331 " <delegate>" +332 " <control>" +333 " <state class=\"org.easymock.internal.RecordState\">" +334 " <lastInvocationUsed>true</lastInvocationUsed>" +335 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +336 " <behaviorLists/>" +337 " <stubResults/>" +338 " <nice>false</nice>" +339 " <checkOrder>false</checkOrder>" +340 " <isThreadSafe>true</isThreadSafe>" +341 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +342 " <position>0</position>" +343 " </behavior>" +344 " </state>" +345 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +346 " <type>DEFAULT</type>" +347 " </control>" +348 " </delegate>" +349 " </default>" +350 " <org.easymock.internal.MethodSerializationWrapper>" +351 " <className>java.lang.Object</className>" +352 " <methodName>toString</methodName>" +353 " <parameterTypeNames/>" +354 " </org.easymock.internal.MethodSerializationWrapper>" +355 " <org.easymock.internal.MethodSerializationWrapper>" +356 " <className>java.lang.Object</className>" +357 " <methodName>equals</methodName>" +358 " <parameterTypeNames>" +359 " <string>java.lang.Object</string>" +360 " </parameterTypeNames>" +361 " </org.easymock.internal.MethodSerializationWrapper>" +362 " <org.easymock.internal.MethodSerializationWrapper>" +363 " <className>java.lang.Object</className>" +364 " <methodName>hashCode</methodName>" +365 " <parameterTypeNames/>" +366 " </org.easymock.internal.MethodSerializationWrapper>" +367 " </org.easymock.internal.ObjectMethodsFilter>" +368 " </handler>" +369 " </entityService>" +370 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +371 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";372 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);373 String paramsObjectStr = 374 "<object-array>" +375 " <null/>" +376 "</object-array>";377 Object[] paramObjects = deserializeObject(paramsObjectStr);378 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];379 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));380 }381 @Test382 public void testFindRelatedQualifierRoot3() throws Exception {383 ClassLoader classLoader = getClass().getClassLoader();384 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot3-receiving.xml").getFile());385 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);386 String paramsObjectStr = 387 "<object-array>" +388 " <null/>" +389 "</object-array>";390 Object[] paramObjects = deserializeObject(paramsObjectStr);391 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];392 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));393 }394 @Test395 public void testFindRelatedQualifierRoot4() throws Exception {396 ClassLoader classLoader = getClass().getClassLoader();397 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot4-receiving.xml").getFile());398 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);399 String paramsObjectStr = 400 "<object-array>" +401 " <null/>" +402 "</object-array>";403 Object[] paramObjects = deserializeObject(paramsObjectStr);404 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];405 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));406 }407 @Test408 public void testFindRelatedQualifierRoot5() throws Exception {409 ClassLoader classLoader = getClass().getClassLoader();410 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot5-receiving.xml").getFile());411 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);412 String paramsObjectStr = 413 "<object-array>" +414 " <null/>" +415 "</object-array>";416 Object[] paramObjects = deserializeObject(paramsObjectStr);417 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];418 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));419 }420 @Test421 public void testFindRelatedQualifierRoot6() throws Exception {422 String receivingObjectStr = 423 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +424 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +425 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +426 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +427 " </promotableItemFactory>" +428 " <offerDao class=\"dynamic-proxy\">" +429 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +430 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +431 " <org.easymock.internal.ObjectMethodsFilter>" +432 " <default>" +433 " <delegate>" +434 " <control>" +435 " <state class=\"org.easymock.internal.ReplayState\">" +436 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +437 " <behaviorLists>" +438 " <org.easymock.internal.UnorderedBehavior>" +439 " <results>" +440 " <org.easymock.internal.ExpectedInvocationAndResults>" +441 " <expectedInvocation>" +442 " <invocation serialization=\"custom\">" +443 " <org.easymock.internal.Invocation>" +444 " <default>" +445 " <arguments/>" +446 " <currentCaptures class=\"list\"/>" +447 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +448 " </default>" +449 " <org.easymock.internal.MethodSerializationWrapper>" +450 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +451 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +452 " <parameterTypeNames/>" +453 " </org.easymock.internal.MethodSerializationWrapper>" +454 " </org.easymock.internal.Invocation>" +455 " </invocation>" +456 " <matchers/>" +457 " </expectedInvocation>" +458 " <results>" +459 " <callCount>5</callCount>" +460 " <ranges>" +461 " <org.easymock.internal.Range>" +462 " <minimum>0</minimum>" +463 " <maximum>2147483647</maximum>" +464 " </org.easymock.internal.Range>" +465 " </ranges>" +466 " <results>" +467 " <org.easymock.internal.Result>" +468 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +469 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +470 " </org.easymock.internal.Result>" +471 " </results>" +472 " </results>" +473 " </org.easymock.internal.ExpectedInvocationAndResults>" +474 " </results>" +475 " <checkOrder>false</checkOrder>" +476 " </org.easymock.internal.UnorderedBehavior>" +477 " </behaviorLists>" +478 " <stubResults/>" +479 " <nice>false</nice>" +480 " <checkOrder>false</checkOrder>" +481 " <isThreadSafe>true</isThreadSafe>" +482 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +483 " <position>0</position>" +484 " </behavior>" +485 " <lock>" +486 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +487 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +488 " <default>" +489 " <state>0</state>" +490 " </default>" +491 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +492 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +493 " <default/>" +494 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +495 " </sync>" +496 " </lock>" +497 " </state>" +498 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +499 " <type>DEFAULT</type>" +500 " </control>" +501 " </delegate>" +502 " </default>" +503 " <org.easymock.internal.MethodSerializationWrapper>" +504 " <className>java.lang.Object</className>" +505 " <methodName>toString</methodName>" +506 " <parameterTypeNames/>" +507 " </org.easymock.internal.MethodSerializationWrapper>" +508 " <org.easymock.internal.MethodSerializationWrapper>" +509 " <className>java.lang.Object</className>" +510 " <methodName>equals</methodName>" +511 " <parameterTypeNames>" +512 " <string>java.lang.Object</string>" +513 " </parameterTypeNames>" +514 " </org.easymock.internal.MethodSerializationWrapper>" +515 " <org.easymock.internal.MethodSerializationWrapper>" +516 " <className>java.lang.Object</className>" +517 " <methodName>hashCode</methodName>" +518 " <parameterTypeNames/>" +519 " </org.easymock.internal.MethodSerializationWrapper>" +520 " </org.easymock.internal.ObjectMethodsFilter>" +521 " </handler>" +522 " </offerDao>" +523 " <entityService class=\"dynamic-proxy\">" +524 " <interface>org.broadleafcommerce.common.service.GenericEntityService</interface>" +525 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +526 " <org.easymock.internal.ObjectMethodsFilter>" +527 " <default>" +528 " <delegate>" +529 " <control>" +530 " <state class=\"org.easymock.internal.RecordState\">" +531 " <lastInvocationUsed>true</lastInvocationUsed>" +532 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +533 " <behaviorLists/>" +534 " <stubResults/>" +535 " <nice>false</nice>" +536 " <checkOrder>false</checkOrder>" +537 " <isThreadSafe>true</isThreadSafe>" +538 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +539 " <position>0</position>" +540 " </behavior>" +541 " </state>" +542 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +543 " <type>DEFAULT</type>" +544 " </control>" +545 " </delegate>" +546 " </default>" +547 " <org.easymock.internal.MethodSerializationWrapper>" +548 " <className>java.lang.Object</className>" +549 " <methodName>toString</methodName>" +550 " <parameterTypeNames/>" +551 " </org.easymock.internal.MethodSerializationWrapper>" +552 " <org.easymock.internal.MethodSerializationWrapper>" +553 " <className>java.lang.Object</className>" +554 " <methodName>equals</methodName>" +555 " <parameterTypeNames>" +556 " <string>java.lang.Object</string>" +557 " </parameterTypeNames>" +558 " </org.easymock.internal.MethodSerializationWrapper>" +559 " <org.easymock.internal.MethodSerializationWrapper>" +560 " <className>java.lang.Object</className>" +561 " <methodName>hashCode</methodName>" +562 " <parameterTypeNames/>" +563 " </org.easymock.internal.MethodSerializationWrapper>" +564 " </org.easymock.internal.ObjectMethodsFilter>" +565 " </handler>" +566 " </entityService>" +567 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +568 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";569 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);570 String paramsObjectStr = 571 "<object-array>" +572 " <null/>" +573 "</object-array>";574 Object[] paramObjects = deserializeObject(paramsObjectStr);575 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];576 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));577 }578 @Test579 public void testFindRelatedQualifierRoot7() throws Exception {580 String receivingObjectStr = 581 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +582 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +583 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +584 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +585 " </promotableItemFactory>" +586 " <offerDao class=\"dynamic-proxy\">" +587 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +588 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +589 " <org.easymock.internal.ObjectMethodsFilter>" +590 " <default>" +591 " <delegate>" +592 " <control>" +593 " <state class=\"org.easymock.internal.ReplayState\">" +594 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +595 " <behaviorLists>" +596 " <org.easymock.internal.UnorderedBehavior>" +597 " <results>" +598 " <org.easymock.internal.ExpectedInvocationAndResults>" +599 " <expectedInvocation>" +600 " <invocation serialization=\"custom\">" +601 " <org.easymock.internal.Invocation>" +602 " <default>" +603 " <arguments/>" +604 " <currentCaptures class=\"list\"/>" +605 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +606 " </default>" +607 " <org.easymock.internal.MethodSerializationWrapper>" +608 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +609 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +610 " <parameterTypeNames/>" +611 " </org.easymock.internal.MethodSerializationWrapper>" +612 " </org.easymock.internal.Invocation>" +613 " </invocation>" +614 " <matchers/>" +615 " </expectedInvocation>" +616 " <results>" +617 " <callCount>0</callCount>" +618 " <ranges>" +619 " <org.easymock.internal.Range>" +620 " <minimum>0</minimum>" +621 " <maximum>2147483647</maximum>" +622 " </org.easymock.internal.Range>" +623 " </ranges>" +624 " <results>" +625 " <org.easymock.internal.Result>" +626 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +627 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +628 " </org.easymock.internal.Result>" +629 " </results>" +630 " </results>" +631 " </org.easymock.internal.ExpectedInvocationAndResults>" +632 " </results>" +633 " <checkOrder>false</checkOrder>" +634 " </org.easymock.internal.UnorderedBehavior>" +635 " </behaviorLists>" +636 " <stubResults/>" +637 " <nice>false</nice>" +638 " <checkOrder>false</checkOrder>" +639 " <isThreadSafe>true</isThreadSafe>" +640 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +641 " <position>0</position>" +642 " </behavior>" +643 " <lock>" +644 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +645 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +646 " <default>" +647 " <state>0</state>" +648 " </default>" +649 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +650 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +651 " <default/>" +652 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +653 " </sync>" +654 " </lock>" +655 " </state>" +656 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +657 " <type>DEFAULT</type>" +658 " </control>" +659 " </delegate>" +660 " </default>" +661 " <org.easymock.internal.MethodSerializationWrapper>" +662 " <className>java.lang.Object</className>" +663 " <methodName>toString</methodName>" +664 " <parameterTypeNames/>" +665 " </org.easymock.internal.MethodSerializationWrapper>" +666 " <org.easymock.internal.MethodSerializationWrapper>" +667 " <className>java.lang.Object</className>" +668 " <methodName>equals</methodName>" +669 " <parameterTypeNames>" +670 " <string>java.lang.Object</string>" +671 " </parameterTypeNames>" +672 " </org.easymock.internal.MethodSerializationWrapper>" +673 " <org.easymock.internal.MethodSerializationWrapper>" +674 " <className>java.lang.Object</className>" +675 " <methodName>hashCode</methodName>" +676 " <parameterTypeNames/>" +677 " </org.easymock.internal.MethodSerializationWrapper>" +678 " </org.easymock.internal.ObjectMethodsFilter>" +679 " </handler>" +680 " </offerDao>" +681 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +682 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";683 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);684 String paramsObjectStr = 685 "<object-array>" +686 " <null/>" +687 "</object-array>";688 Object[] paramObjects = deserializeObject(paramsObjectStr);689 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];690 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));691 }692 @Test693 public void testFindRelatedQualifierRoot8() throws Exception {694 ClassLoader classLoader = getClass().getClassLoader();695 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot8-receiving.xml").getFile());696 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);697 String paramsObjectStr = 698 "<object-array>" +699 " <null/>" +700 "</object-array>";701 Object[] paramObjects = deserializeObject(paramsObjectStr);702 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];703 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));704 }705 @Test706 public void testFindRelatedQualifierRoot9() throws Exception {707 ClassLoader classLoader = getClass().getClassLoader();708 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot9-receiving.xml").getFile());709 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);710 String paramsObjectStr = 711 "<object-array>" +712 " <null/>" +713 "</object-array>";714 Object[] paramObjects = deserializeObject(paramsObjectStr);715 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];716 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));717 }718 @Test719 public void testFindRelatedQualifierRoot10() throws Exception {720 ClassLoader classLoader = getClass().getClassLoader();721 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot10-receiving.xml").getFile());722 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);723 String paramsObjectStr = 724 "<object-array>" +725 " <null/>" +726 "</object-array>";727 Object[] paramObjects = deserializeObject(paramsObjectStr);728 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];729 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));730 }731 @Test732 public void testFindRelatedQualifierRoot11() throws Exception {733 ClassLoader classLoader = getClass().getClassLoader();734 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot11-receiving.xml").getFile());735 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);736 String paramsObjectStr = 737 "<object-array>" +738 " <null/>" +739 "</object-array>";740 Object[] paramObjects = deserializeObject(paramsObjectStr);741 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];742 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));743 }744 @Test745 public void testFindRelatedQualifierRoot12() throws Exception {746 ClassLoader classLoader = getClass().getClassLoader();747 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot12-receiving.xml").getFile());748 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);749 String paramsObjectStr = 750 "<object-array>" +751 " <null/>" +752 "</object-array>";753 Object[] paramObjects = deserializeObject(paramsObjectStr);754 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];755 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));756 }757 @Test758 public void testFindRelatedQualifierRoot13() throws Exception {759 String receivingObjectStr = 760 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +761 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +762 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +763 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +764 " </promotableItemFactory>" +765 " <offerDao class=\"dynamic-proxy\">" +766 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +767 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +768 " <org.easymock.internal.ObjectMethodsFilter>" +769 " <default>" +770 " <delegate>" +771 " <control>" +772 " <state class=\"org.easymock.internal.ReplayState\">" +773 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +774 " <behaviorLists>" +775 " <org.easymock.internal.UnorderedBehavior>" +776 " <results>" +777 " <org.easymock.internal.ExpectedInvocationAndResults>" +778 " <expectedInvocation>" +779 " <invocation serialization=\"custom\">" +780 " <org.easymock.internal.Invocation>" +781 " <default>" +782 " <arguments/>" +783 " <currentCaptures class=\"list\"/>" +784 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +785 " </default>" +786 " <org.easymock.internal.MethodSerializationWrapper>" +787 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +788 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +789 " <parameterTypeNames/>" +790 " </org.easymock.internal.MethodSerializationWrapper>" +791 " </org.easymock.internal.Invocation>" +792 " </invocation>" +793 " <matchers/>" +794 " </expectedInvocation>" +795 " <results>" +796 " <callCount>2</callCount>" +797 " <ranges>" +798 " <org.easymock.internal.Range>" +799 " <minimum>0</minimum>" +800 " <maximum>2147483647</maximum>" +801 " </org.easymock.internal.Range>" +802 " </ranges>" +803 " <results>" +804 " <org.easymock.internal.Result>" +805 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +806 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +807 " </org.easymock.internal.Result>" +808 " </results>" +809 " </results>" +810 " </org.easymock.internal.ExpectedInvocationAndResults>" +811 " <org.easymock.internal.ExpectedInvocationAndResults>" +812 " <expectedInvocation>" +813 " <invocation serialization=\"custom\">" +814 " <org.easymock.internal.Invocation>" +815 " <default>" +816 " <arguments/>" +817 " <currentCaptures class=\"list\"/>" +818 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +819 " </default>" +820 " <org.easymock.internal.MethodSerializationWrapper>" +821 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +822 " <methodName>createFulfillmentGroupAdjustment</methodName>" +823 " <parameterTypeNames/>" +824 " </org.easymock.internal.MethodSerializationWrapper>" +825 " </org.easymock.internal.Invocation>" +826 " </invocation>" +827 " <matchers/>" +828 " </expectedInvocation>" +829 " <results>" +830 " <callCount>1</callCount>" +831 " <ranges>" +832 " <org.easymock.internal.Range reference=\"../../../../org.easymock.internal.ExpectedInvocationAndResults/results/ranges/org.easymock.internal.Range\"/>" +833 " </ranges>" +834 " <results>" +835 " <org.easymock.internal.Result>" +836 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$6\"/>" +837 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +838 " </org.easymock.internal.Result>" +839 " </results>" +840 " </results>" +841 " </org.easymock.internal.ExpectedInvocationAndResults>" +842 " </results>" +843 " <checkOrder>false</checkOrder>" +844 " </org.easymock.internal.UnorderedBehavior>" +845 " </behaviorLists>" +846 " <stubResults/>" +847 " <nice>false</nice>" +848 " <checkOrder>false</checkOrder>" +849 " <isThreadSafe>true</isThreadSafe>" +850 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +851 " <position>0</position>" +852 " </behavior>" +853 " <lock>" +854 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +855 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +856 " <default>" +857 " <state>0</state>" +858 " </default>" +859 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +860 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +861 " <default/>" +862 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +863 " </sync>" +864 " </lock>" +865 " </state>" +866 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +867 " <type>DEFAULT</type>" +868 " </control>" +869 " </delegate>" +870 " </default>" +871 " <org.easymock.internal.MethodSerializationWrapper>" +872 " <className>java.lang.Object</className>" +873 " <methodName>toString</methodName>" +874 " <parameterTypeNames/>" +875 " </org.easymock.internal.MethodSerializationWrapper>" +876 " <org.easymock.internal.MethodSerializationWrapper>" +877 " <className>java.lang.Object</className>" +878 " <methodName>equals</methodName>" +879 " <parameterTypeNames>" +880 " <string>java.lang.Object</string>" +881 " </parameterTypeNames>" +882 " </org.easymock.internal.MethodSerializationWrapper>" +883 " <org.easymock.internal.MethodSerializationWrapper>" +884 " <className>java.lang.Object</className>" +885 " <methodName>hashCode</methodName>" +886 " <parameterTypeNames/>" +887 " </org.easymock.internal.MethodSerializationWrapper>" +888 " </org.easymock.internal.ObjectMethodsFilter>" +889 " </handler>" +890 " </offerDao>" +891 " <entityService class=\"dynamic-proxy\">" +892 " <interface>org.broadleafcommerce.common.service.GenericEntityService</interface>" +893 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +894 " <org.easymock.internal.ObjectMethodsFilter>" +895 " <default>" +896 " <delegate>" +897 " <control>" +898 " <state class=\"org.easymock.internal.RecordState\">" +899 " <lastInvocationUsed>true</lastInvocationUsed>" +900 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +901 " <behaviorLists/>" +902 " <stubResults/>" +903 " <nice>false</nice>" +904 " <checkOrder>false</checkOrder>" +905 " <isThreadSafe>true</isThreadSafe>" +906 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +907 " <position>0</position>" +908 " </behavior>" +909 " </state>" +910 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +911 " <type>DEFAULT</type>" +912 " </control>" +913 " </delegate>" +914 " </default>" +915 " <org.easymock.internal.MethodSerializationWrapper>" +916 " <className>java.lang.Object</className>" +917 " <methodName>toString</methodName>" +918 " <parameterTypeNames/>" +919 " </org.easymock.internal.MethodSerializationWrapper>" +920 " <org.easymock.internal.MethodSerializationWrapper>" +921 " <className>java.lang.Object</className>" +922 " <methodName>equals</methodName>" +923 " <parameterTypeNames>" +924 " <string>java.lang.Object</string>" +925 " </parameterTypeNames>" +926 " </org.easymock.internal.MethodSerializationWrapper>" +927 " <org.easymock.internal.MethodSerializationWrapper>" +928 " <className>java.lang.Object</className>" +929 " <methodName>hashCode</methodName>" +930 " <parameterTypeNames/>" +931 " </org.easymock.internal.MethodSerializationWrapper>" +932 " </org.easymock.internal.ObjectMethodsFilter>" +933 " </handler>" +934 " </entityService>" +935 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +936 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";937 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);938 String paramsObjectStr = 939 "<object-array>" +940 " <null/>" +941 "</object-array>";942 Object[] paramObjects = deserializeObject(paramsObjectStr);943 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];944 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));945 }946 @Test947 public void testFindRelatedQualifierRoot14() throws Exception {948 String receivingObjectStr = 949 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +950 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +951 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +952 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +953 " </promotableItemFactory>" +954 " <offerDao class=\"dynamic-proxy\">" +955 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +956 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +957 " <org.easymock.internal.ObjectMethodsFilter>" +958 " <default>" +959 " <delegate>" +960 " <control>" +961 " <state class=\"org.easymock.internal.ReplayState\">" +962 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +963 " <behaviorLists>" +964 " <org.easymock.internal.UnorderedBehavior>" +965 " <results>" +966 " <org.easymock.internal.ExpectedInvocationAndResults>" +967 " <expectedInvocation>" +968 " <invocation serialization=\"custom\">" +969 " <org.easymock.internal.Invocation>" +970 " <default>" +971 " <arguments/>" +972 " <currentCaptures class=\"list\"/>" +973 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +974 " </default>" +975 " <org.easymock.internal.MethodSerializationWrapper>" +976 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +977 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +978 " <parameterTypeNames/>" +979 " </org.easymock.internal.MethodSerializationWrapper>" +980 " </org.easymock.internal.Invocation>" +981 " </invocation>" +982 " <matchers/>" +983 " </expectedInvocation>" +984 " <results>" +985 " <callCount>0</callCount>" +986 " <ranges>" +987 " <org.easymock.internal.Range>" +988 " <minimum>0</minimum>" +989 " <maximum>2147483647</maximum>" +990 " </org.easymock.internal.Range>" +991 " </ranges>" +992 " <results>" +993 " <org.easymock.internal.Result>" +994 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +995 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +996 " </org.easymock.internal.Result>" +997 " </results>" +998 " </results>" +999 " </org.easymock.internal.ExpectedInvocationAndResults>" +1000 " </results>" +1001 " <checkOrder>false</checkOrder>" +1002 " </org.easymock.internal.UnorderedBehavior>" +1003 " </behaviorLists>" +1004 " <stubResults/>" +1005 " <nice>false</nice>" +1006 " <checkOrder>false</checkOrder>" +1007 " <isThreadSafe>true</isThreadSafe>" +1008 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +1009 " <position>0</position>" +1010 " </behavior>" +1011 " <lock>" +1012 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +1013 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +1014 " <default>" +1015 " <state>0</state>" +1016 " </default>" +1017 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +1018 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +1019 " <default/>" +1020 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +1021 " </sync>" +1022 " </lock>" +1023 " </state>" +1024 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +1025 " <type>DEFAULT</type>" +1026 " </control>" +1027 " </delegate>" +1028 " </default>" +1029 " <org.easymock.internal.MethodSerializationWrapper>" +1030 " <className>java.lang.Object</className>" +1031 " <methodName>toString</methodName>" +1032 " <parameterTypeNames/>" +1033 " </org.easymock.internal.MethodSerializationWrapper>" +1034 " <org.easymock.internal.MethodSerializationWrapper>" +1035 " <className>java.lang.Object</className>" +1036 " <methodName>equals</methodName>" +1037 " <parameterTypeNames>" +1038 " <string>java.lang.Object</string>" +1039 " </parameterTypeNames>" +1040 " </org.easymock.internal.MethodSerializationWrapper>" +1041 " <org.easymock.internal.MethodSerializationWrapper>" +1042 " <className>java.lang.Object</className>" +1043 " <methodName>hashCode</methodName>" +1044 " <parameterTypeNames/>" +1045 " </org.easymock.internal.MethodSerializationWrapper>" +1046 " </org.easymock.internal.ObjectMethodsFilter>" +1047 " </handler>" +1048 " </offerDao>" +1049 " <entityService class=\"dynamic-proxy\">" +1050 " <interface>org.broadleafcommerce.common.service.GenericEntityService</interface>" +1051 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +1052 " <org.easymock.internal.ObjectMethodsFilter>" +1053 " <default>" +1054 " <delegate>" +1055 " <control>" +1056 " <state class=\"org.easymock.internal.RecordState\">" +1057 " <lastInvocationUsed>true</lastInvocationUsed>" +1058 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +1059 " <behaviorLists/>" +1060 " <stubResults/>" +1061 " <nice>false</nice>" +1062 " <checkOrder>false</checkOrder>" +1063 " <isThreadSafe>true</isThreadSafe>" +1064 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +1065 " <position>0</position>" +1066 " </behavior>" +1067 " </state>" +1068 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +1069 " <type>DEFAULT</type>" +1070 " </control>" +1071 " </delegate>" +1072 " </default>" +1073 " <org.easymock.internal.MethodSerializationWrapper>" +1074 " <className>java.lang.Object</className>" +1075 " <methodName>toString</methodName>" +1076 " <parameterTypeNames/>" +1077 " </org.easymock.internal.MethodSerializationWrapper>" +1078 " <org.easymock.internal.MethodSerializationWrapper>" +1079 " <className>java.lang.Object</className>" +1080 " <methodName>equals</methodName>" +1081 " <parameterTypeNames>" +1082 " <string>java.lang.Object</string>" +1083 " </parameterTypeNames>" +1084 " </org.easymock.internal.MethodSerializationWrapper>" +1085 " <org.easymock.internal.MethodSerializationWrapper>" +1086 " <className>java.lang.Object</className>" +1087 " <methodName>hashCode</methodName>" +1088 " <parameterTypeNames/>" +1089 " </org.easymock.internal.MethodSerializationWrapper>" +1090 " </org.easymock.internal.ObjectMethodsFilter>" +1091 " </handler>" +1092 " </entityService>" +1093 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +1094 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";1095 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);1096 String paramsObjectStr = 1097 "<object-array>" +1098 " <null/>" +1099 "</object-array>";1100 Object[] paramObjects = deserializeObject(paramsObjectStr);1101 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];1102 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));1103 }1104 @Test1105 public void testFindRelatedQualifierRoot15() throws Exception {1106 ClassLoader classLoader = getClass().getClassLoader();1107 File fileReceiving = new File(classLoader.getResource("org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl.findRelatedQualifierRoot15-receiving.xml").getFile());1108 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(fileReceiving);1109 String paramsObjectStr = 1110 "<object-array>" +1111 " <null/>" +1112 "</object-array>";1113 Object[] paramObjects = deserializeObject(paramsObjectStr);1114 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];1115 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));1116 }1117 @Test1118 public void testFindRelatedQualifierRoot16() throws Exception {1119 String receivingObjectStr = 1120 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +1121 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +1122 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +1123 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +1124 " </promotableItemFactory>" +1125 " <offerDao class=\"dynamic-proxy\">" +1126 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +1127 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +1128 " <org.easymock.internal.ObjectMethodsFilter>" +1129 " <default>" +1130 " <delegate>" +1131 " <control>" +1132 " <state class=\"org.easymock.internal.ReplayState\">" +1133 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +1134 " <behaviorLists>" +1135 " <org.easymock.internal.UnorderedBehavior>" +1136 " <results>" +1137 " <org.easymock.internal.ExpectedInvocationAndResults>" +1138 " <expectedInvocation>" +1139 " <invocation serialization=\"custom\">" +1140 " <org.easymock.internal.Invocation>" +1141 " <default>" +1142 " <arguments/>" +1143 " <currentCaptures class=\"list\"/>" +1144 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +1145 " </default>" +1146 " <org.easymock.internal.MethodSerializationWrapper>" +1147 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +1148 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +1149 " <parameterTypeNames/>" +1150 " </org.easymock.internal.MethodSerializationWrapper>" +1151 " </org.easymock.internal.Invocation>" +1152 " </invocation>" +1153 " <matchers/>" +1154 " </expectedInvocation>" +1155 " <results>" +1156 " <callCount>1</callCount>" +1157 " <ranges>" +1158 " <org.easymock.internal.Range>" +1159 " <minimum>0</minimum>" +1160 " <maximum>2147483647</maximum>" +1161 " </org.easymock.internal.Range>" +1162 " </ranges>" +1163 " <results>" +1164 " <org.easymock.internal.Result>" +1165 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +1166 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +1167 " </org.easymock.internal.Result>" +1168 " </results>" +1169 " </results>" +1170 " </org.easymock.internal.ExpectedInvocationAndResults>" +1171 " </results>" +1172 " <checkOrder>false</checkOrder>" +1173 " </org.easymock.internal.UnorderedBehavior>" +1174 " </behaviorLists>" +1175 " <stubResults/>" +1176 " <nice>false</nice>" +1177 " <checkOrder>false</checkOrder>" +1178 " <isThreadSafe>true</isThreadSafe>" +1179 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +1180 " <position>0</position>" +1181 " </behavior>" +1182 " <lock>" +1183 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +1184 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +1185 " <default>" +1186 " <state>0</state>" +1187 " </default>" +1188 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +1189 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +1190 " <default/>" +1191 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +1192 " </sync>" +1193 " </lock>" +1194 " </state>" +1195 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +1196 " <type>DEFAULT</type>" +1197 " </control>" +1198 " </delegate>" +1199 " </default>" +1200 " <org.easymock.internal.MethodSerializationWrapper>" +1201 " <className>java.lang.Object</className>" +1202 " <methodName>toString</methodName>" +1203 " <parameterTypeNames/>" +1204 " </org.easymock.internal.MethodSerializationWrapper>" +1205 " <org.easymock.internal.MethodSerializationWrapper>" +1206 " <className>java.lang.Object</className>" +1207 " <methodName>equals</methodName>" +1208 " <parameterTypeNames>" +1209 " <string>java.lang.Object</string>" +1210 " </parameterTypeNames>" +1211 " </org.easymock.internal.MethodSerializationWrapper>" +1212 " <org.easymock.internal.MethodSerializationWrapper>" +1213 " <className>java.lang.Object</className>" +1214 " <methodName>hashCode</methodName>" +1215 " <parameterTypeNames/>" +1216 " </org.easymock.internal.MethodSerializationWrapper>" +1217 " </org.easymock.internal.ObjectMethodsFilter>" +1218 " </handler>" +1219 " </offerDao>" +1220 " <entityService class=\"dynamic-proxy\">" +1221 " <interface>org.broadleafcommerce.common.service.GenericEntityService</interface>" +1222 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +1223 " <org.easymock.internal.ObjectMethodsFilter>" +1224 " <default>" +1225 " <delegate>" +1226 " <control>" +1227 " <state class=\"org.easymock.internal.RecordState\">" +1228 " <lastInvocationUsed>true</lastInvocationUsed>" +1229 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +1230 " <behaviorLists/>" +1231 " <stubResults/>" +1232 " <nice>false</nice>" +1233 " <checkOrder>false</checkOrder>" +1234 " <isThreadSafe>true</isThreadSafe>" +1235 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +1236 " <position>0</position>" +1237 " </behavior>" +1238 " </state>" +1239 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +1240 " <type>DEFAULT</type>" +1241 " </control>" +1242 " </delegate>" +1243 " </default>" +1244 " <org.easymock.internal.MethodSerializationWrapper>" +1245 " <className>java.lang.Object</className>" +1246 " <methodName>toString</methodName>" +1247 " <parameterTypeNames/>" +1248 " </org.easymock.internal.MethodSerializationWrapper>" +1249 " <org.easymock.internal.MethodSerializationWrapper>" +1250 " <className>java.lang.Object</className>" +1251 " <methodName>equals</methodName>" +1252 " <parameterTypeNames>" +1253 " <string>java.lang.Object</string>" +1254 " </parameterTypeNames>" +1255 " </org.easymock.internal.MethodSerializationWrapper>" +1256 " <org.easymock.internal.MethodSerializationWrapper>" +1257 " <className>java.lang.Object</className>" +1258 " <methodName>hashCode</methodName>" +1259 " <parameterTypeNames/>" +1260 " </org.easymock.internal.MethodSerializationWrapper>" +1261 " </org.easymock.internal.ObjectMethodsFilter>" +1262 " </handler>" +1263 " </entityService>" +1264 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +1265 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";1266 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);1267 String paramsObjectStr = 1268 "<object-array>" +1269 " <null/>" +1270 "</object-array>";1271 Object[] paramObjects = deserializeObject(paramsObjectStr);1272 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];1273 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));1274 }1275 @Test1276 public void testFindRelatedQualifierRoot17() throws Exception {1277 String receivingObjectStr = 1278 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +1279 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +1280 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +1281 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +1282 " </promotableItemFactory>" +1283 " <offerDao class=\"dynamic-proxy\">" +1284 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +1285 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +1286 " <org.easymock.internal.ObjectMethodsFilter>" +1287 " <default>" +1288 " <delegate>" +1289 " <control>" +1290 " <state class=\"org.easymock.internal.ReplayState\">" +1291 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +1292 " <behaviorLists>" +1293 " <org.easymock.internal.UnorderedBehavior>" +1294 " <results>" +1295 " <org.easymock.internal.ExpectedInvocationAndResults>" +1296 " <expectedInvocation>" +1297 " <invocation serialization=\"custom\">" +1298 " <org.easymock.internal.Invocation>" +1299 " <default>" +1300 " <arguments/>" +1301 " <currentCaptures class=\"list\"/>" +1302 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +1303 " </default>" +1304 " <org.easymock.internal.MethodSerializationWrapper>" +1305 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +1306 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +1307 " <parameterTypeNames/>" +1308 " </org.easymock.internal.MethodSerializationWrapper>" +1309 " </org.easymock.internal.Invocation>" +1310 " </invocation>" +1311 " <matchers/>" +1312 " </expectedInvocation>" +1313 " <results>" +1314 " <callCount>7</callCount>" +1315 " <ranges>" +1316 " <org.easymock.internal.Range>" +1317 " <minimum>0</minimum>" +1318 " <maximum>2147483647</maximum>" +1319 " </org.easymock.internal.Range>" +1320 " </ranges>" +1321 " <results>" +1322 " <org.easymock.internal.Result>" +1323 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +1324 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +1325 " </org.easymock.internal.Result>" +1326 " </results>" +1327 " </results>" +1328 " </org.easymock.internal.ExpectedInvocationAndResults>" +1329 " </results>" +1330 " <checkOrder>false</checkOrder>" +1331 " </org.easymock.internal.UnorderedBehavior>" +1332 " </behaviorLists>" +1333 " <stubResults/>" +1334 " <nice>false</nice>" +1335 " <checkOrder>false</checkOrder>" +1336 " <isThreadSafe>true</isThreadSafe>" +1337 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +1338 " <position>0</position>" +1339 " </behavior>" +1340 " <lock>" +1341 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +1342 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +1343 " <default>" +1344 " <state>0</state>" +1345 " </default>" +1346 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +1347 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +1348 " <default/>" +1349 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +1350 " </sync>" +1351 " </lock>" +1352 " </state>" +1353 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +1354 " <type>DEFAULT</type>" +1355 " </control>" +1356 " </delegate>" +1357 " </default>" +1358 " <org.easymock.internal.MethodSerializationWrapper>" +1359 " <className>java.lang.Object</className>" +1360 " <methodName>toString</methodName>" +1361 " <parameterTypeNames/>" +1362 " </org.easymock.internal.MethodSerializationWrapper>" +1363 " <org.easymock.internal.MethodSerializationWrapper>" +1364 " <className>java.lang.Object</className>" +1365 " <methodName>equals</methodName>" +1366 " <parameterTypeNames>" +1367 " <string>java.lang.Object</string>" +1368 " </parameterTypeNames>" +1369 " </org.easymock.internal.MethodSerializationWrapper>" +1370 " <org.easymock.internal.MethodSerializationWrapper>" +1371 " <className>java.lang.Object</className>" +1372 " <methodName>hashCode</methodName>" +1373 " <parameterTypeNames/>" +1374 " </org.easymock.internal.MethodSerializationWrapper>" +1375 " </org.easymock.internal.ObjectMethodsFilter>" +1376 " </handler>" +1377 " </offerDao>" +1378 " <entityService class=\"dynamic-proxy\">" +1379 " <interface>org.broadleafcommerce.common.service.GenericEntityService</interface>" +1380 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +1381 " <org.easymock.internal.ObjectMethodsFilter>" +1382 " <default>" +1383 " <delegate>" +1384 " <control>" +1385 " <state class=\"org.easymock.internal.RecordState\">" +1386 " <lastInvocationUsed>true</lastInvocationUsed>" +1387 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +1388 " <behaviorLists/>" +1389 " <stubResults/>" +1390 " <nice>false</nice>" +1391 " <checkOrder>false</checkOrder>" +1392 " <isThreadSafe>true</isThreadSafe>" +1393 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +1394 " <position>0</position>" +1395 " </behavior>" +1396 " </state>" +1397 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +1398 " <type>DEFAULT</type>" +1399 " </control>" +1400 " </delegate>" +1401 " </default>" +1402 " <org.easymock.internal.MethodSerializationWrapper>" +1403 " <className>java.lang.Object</className>" +1404 " <methodName>toString</methodName>" +1405 " <parameterTypeNames/>" +1406 " </org.easymock.internal.MethodSerializationWrapper>" +1407 " <org.easymock.internal.MethodSerializationWrapper>" +1408 " <className>java.lang.Object</className>" +1409 " <methodName>equals</methodName>" +1410 " <parameterTypeNames>" +1411 " <string>java.lang.Object</string>" +1412 " </parameterTypeNames>" +1413 " </org.easymock.internal.MethodSerializationWrapper>" +1414 " <org.easymock.internal.MethodSerializationWrapper>" +1415 " <className>java.lang.Object</className>" +1416 " <methodName>hashCode</methodName>" +1417 " <parameterTypeNames/>" +1418 " </org.easymock.internal.MethodSerializationWrapper>" +1419 " </org.easymock.internal.ObjectMethodsFilter>" +1420 " </handler>" +1421 " </entityService>" +1422 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +1423 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";1424 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);1425 String paramsObjectStr = 1426 "<object-array>" +1427 " <null/>" +1428 "</object-array>";1429 Object[] paramObjects = deserializeObject(paramsObjectStr);1430 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];1431 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));1432 }1433 @Test1434 public void testFindRelatedQualifierRoot18() throws Exception {1435 String receivingObjectStr = 1436 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +1437 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +1438 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +1439 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +1440 " </promotableItemFactory>" +1441 " <offerDao class=\"dynamic-proxy\">" +1442 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +1443 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +1444 " <org.easymock.internal.ObjectMethodsFilter>" +1445 " <default>" +1446 " <delegate>" +1447 " <control>" +1448 " <state class=\"org.easymock.internal.ReplayState\">" +1449 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +1450 " <behaviorLists>" +1451 " <org.easymock.internal.UnorderedBehavior>" +1452 " <results>" +1453 " <org.easymock.internal.ExpectedInvocationAndResults>" +1454 " <expectedInvocation>" +1455 " <invocation serialization=\"custom\">" +1456 " <org.easymock.internal.Invocation>" +1457 " <default>" +1458 " <arguments/>" +1459 " <currentCaptures class=\"list\"/>" +1460 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +1461 " </default>" +1462 " <org.easymock.internal.MethodSerializationWrapper>" +1463 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +1464 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +1465 " <parameterTypeNames/>" +1466 " </org.easymock.internal.MethodSerializationWrapper>" +1467 " </org.easymock.internal.Invocation>" +1468 " </invocation>" +1469 " <matchers/>" +1470 " </expectedInvocation>" +1471 " <results>" +1472 " <callCount>2</callCount>" +1473 " <ranges>" +1474 " <org.easymock.internal.Range>" +1475 " <minimum>0</minimum>" +1476 " <maximum>2147483647</maximum>" +1477 " </org.easymock.internal.Range>" +1478 " </ranges>" +1479 " <results>" +1480 " <org.easymock.internal.Result>" +1481 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +1482 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +1483 " </org.easymock.internal.Result>" +1484 " </results>" +1485 " </results>" +1486 " </org.easymock.internal.ExpectedInvocationAndResults>" +1487 " </results>" +1488 " <checkOrder>false</checkOrder>" +1489 " </org.easymock.internal.UnorderedBehavior>" +1490 " </behaviorLists>" +1491 " <stubResults/>" +1492 " <nice>false</nice>" +1493 " <checkOrder>false</checkOrder>" +1494 " <isThreadSafe>true</isThreadSafe>" +1495 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +1496 " <position>0</position>" +1497 " </behavior>" +1498 " <lock>" +1499 " <sync class=\"java.util.concurrent.locks.ReentrantLock$NonfairSync\" serialization=\"custom\">" +1500 " <java.util.concurrent.locks.AbstractQueuedSynchronizer>" +1501 " <default>" +1502 " <state>0</state>" +1503 " </default>" +1504 " </java.util.concurrent.locks.AbstractQueuedSynchronizer>" +1505 " <java.util.concurrent.locks.ReentrantLock_-Sync>" +1506 " <default/>" +1507 " </java.util.concurrent.locks.ReentrantLock_-Sync>" +1508 " </sync>" +1509 " </lock>" +1510 " </state>" +1511 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +1512 " <type>DEFAULT</type>" +1513 " </control>" +1514 " </delegate>" +1515 " </default>" +1516 " <org.easymock.internal.MethodSerializationWrapper>" +1517 " <className>java.lang.Object</className>" +1518 " <methodName>toString</methodName>" +1519 " <parameterTypeNames/>" +1520 " </org.easymock.internal.MethodSerializationWrapper>" +1521 " <org.easymock.internal.MethodSerializationWrapper>" +1522 " <className>java.lang.Object</className>" +1523 " <methodName>equals</methodName>" +1524 " <parameterTypeNames>" +1525 " <string>java.lang.Object</string>" +1526 " </parameterTypeNames>" +1527 " </org.easymock.internal.MethodSerializationWrapper>" +1528 " <org.easymock.internal.MethodSerializationWrapper>" +1529 " <className>java.lang.Object</className>" +1530 " <methodName>hashCode</methodName>" +1531 " <parameterTypeNames/>" +1532 " </org.easymock.internal.MethodSerializationWrapper>" +1533 " </org.easymock.internal.ObjectMethodsFilter>" +1534 " </handler>" +1535 " </offerDao>" +1536 " <entityService class=\"dynamic-proxy\">" +1537 " <interface>org.broadleafcommerce.common.service.GenericEntityService</interface>" +1538 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +1539 " <org.easymock.internal.ObjectMethodsFilter>" +1540 " <default>" +1541 " <delegate>" +1542 " <control>" +1543 " <state class=\"org.easymock.internal.RecordState\">" +1544 " <lastInvocationUsed>true</lastInvocationUsed>" +1545 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +1546 " <behaviorLists/>" +1547 " <stubResults/>" +1548 " <nice>false</nice>" +1549 " <checkOrder>false</checkOrder>" +1550 " <isThreadSafe>true</isThreadSafe>" +1551 " <shouldBeUsedInOneThread>false</shouldBeUsedInOneThread>" +1552 " <position>0</position>" +1553 " </behavior>" +1554 " </state>" +1555 " <behavior class=\"org.easymock.internal.MocksBehavior\" reference=\"../state/behavior\"/>" +1556 " <type>DEFAULT</type>" +1557 " </control>" +1558 " </delegate>" +1559 " </default>" +1560 " <org.easymock.internal.MethodSerializationWrapper>" +1561 " <className>java.lang.Object</className>" +1562 " <methodName>toString</methodName>" +1563 " <parameterTypeNames/>" +1564 " </org.easymock.internal.MethodSerializationWrapper>" +1565 " <org.easymock.internal.MethodSerializationWrapper>" +1566 " <className>java.lang.Object</className>" +1567 " <methodName>equals</methodName>" +1568 " <parameterTypeNames>" +1569 " <string>java.lang.Object</string>" +1570 " </parameterTypeNames>" +1571 " </org.easymock.internal.MethodSerializationWrapper>" +1572 " <org.easymock.internal.MethodSerializationWrapper>" +1573 " <className>java.lang.Object</className>" +1574 " <methodName>hashCode</methodName>" +1575 " <parameterTypeNames/>" +1576 " </org.easymock.internal.MethodSerializationWrapper>" +1577 " </org.easymock.internal.ObjectMethodsFilter>" +1578 " </handler>" +1579 " </entityService>" +1580 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\" reference=\"../promotableItemFactory/promotableOfferUtility\"/>" +1581 "</org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>";1582 org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl receivingObject = deserializeObject(receivingObjectStr);1583 String paramsObjectStr = 1584 "<object-array>" +1585 " <null/>" +1586 "</object-array>";1587 Object[] paramObjects = deserializeObject(paramsObjectStr);1588 org.broadleafcommerce.core.order.domain.OrderItem paramObject1 = (org.broadleafcommerce.core.order.domain.OrderItem) paramObjects[0];1589 Assert.assertEquals(null, receivingObject.findRelatedQualifierRoot(paramObject1));1590 }1591 @Test1592 public void testFindRelatedQualifierRoot19() throws Exception {1593 String receivingObjectStr = 1594 "<org.broadleafcommerce.core.offer.service.OfferServiceUtilitiesImpl>" +1595 " <promotableItemFactory class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableItemFactoryImpl\">" +1596 " <useQtyOnlyTierCalculation>false</useQtyOnlyTierCalculation>" +1597 " <promotableOfferUtility class=\"org.broadleafcommerce.core.offer.service.discount.domain.PromotableOfferUtilityImpl\"/>" +1598 " </promotableItemFactory>" +1599 " <offerDao class=\"dynamic-proxy\">" +1600 " <interface>org.broadleafcommerce.core.offer.dao.OfferDao</interface>" +1601 " <handler class=\"org.easymock.internal.ObjectMethodsFilter\" serialization=\"custom\">" +1602 " <org.easymock.internal.ObjectMethodsFilter>" +1603 " <default>" +1604 " <delegate>" +1605 " <control>" +1606 " <state class=\"org.easymock.internal.ReplayState\">" +1607 " <behavior class=\"org.easymock.internal.MocksBehavior\">" +1608 " <behaviorLists>" +1609 " <org.easymock.internal.UnorderedBehavior>" +1610 " <results>" +1611 " <org.easymock.internal.ExpectedInvocationAndResults>" +1612 " <expectedInvocation>" +1613 " <invocation serialization=\"custom\">" +1614 " <org.easymock.internal.Invocation>" +1615 " <default>" +1616 " <arguments/>" +1617 " <currentCaptures class=\"list\"/>" +1618 " <mock class=\"dynamic-proxy\" reference=\"../../../../../../../../../../../../../../../..\"/>" +1619 " </default>" +1620 " <org.easymock.internal.MethodSerializationWrapper>" +1621 " <className>org.broadleafcommerce.core.offer.dao.OfferDao</className>" +1622 " <methodName>createOrderItemPriceDetailAdjustment</methodName>" +1623 " <parameterTypeNames/>" +1624 " </org.easymock.internal.MethodSerializationWrapper>" +1625 " </org.easymock.internal.Invocation>" +1626 " </invocation>" +1627 " <matchers/>" +1628 " </expectedInvocation>" +1629 " <results>" +1630 " <callCount>4</callCount>" +1631 " <ranges>" +1632 " <org.easymock.internal.Range>" +1633 " <minimum>0</minimum>" +1634 " <maximum>2147483647</maximum>" +1635 " </org.easymock.internal.Range>" +1636 " </ranges>" +1637 " <results>" +1638 " <org.easymock.internal.Result>" +1639 " <value class=\"org.broadleafcommerce.core.offer.service.OfferDataItemProvider$3\"/>" +1640 " <shouldFillInStackTrace>false</shouldFillInStackTrace>" +1641 " </org.easymock.internal.Result>" +1642 " </results>" +1643 " </results>" +1644 " </org.easymock.internal.ExpectedInvocationAndResults>" +1645 " </results>" +1646 " <checkOrder>false</checkOrder>" +1647 " </org.easymock.internal.UnorderedBehavior>" +1648 " </behaviorLists>" +1649 " <stubResults/>" +...

Full Screen

Full Screen

Source:DeployerTest.java Github

copy

Full Screen

...27import java.util.Map;28import java.util.Set;29import java.util.jar.Manifest;30import org.apache.felix.resolver.ResolverImpl;31import org.apache.felix.utils.version.VersionRange;32import org.apache.karaf.features.DeploymentEvent;33import org.apache.karaf.features.Feature;34import org.apache.karaf.features.FeatureEvent;35import org.apache.karaf.features.FeaturesService;36import org.apache.karaf.features.internal.resolver.Slf4jResolverLog;37import org.apache.karaf.features.internal.support.TestBundle;38import org.apache.karaf.features.internal.support.TestDownloadManager;39import org.easymock.Capture;40import org.easymock.EasyMock;41import org.easymock.IAnswer;42import org.easymock.IArgumentMatcher;43import org.easymock.IMocksControl;44import org.junit.Test;45import org.osgi.framework.Bundle;46import org.osgi.framework.BundleException;47import org.osgi.resource.Resource;48import org.osgi.resource.Wire;49import org.osgi.service.resolver.Resolver;50import org.slf4j.Logger;51import org.slf4j.LoggerFactory;52import static org.apache.karaf.features.FeaturesService.*;53import static org.apache.karaf.features.internal.util.MapUtils.addToMapSet;54import static org.easymock.EasyMock.anyInt;55import static org.easymock.EasyMock.anyObject;56import static org.easymock.EasyMock.expectLastCall;57import static org.junit.Assert.fail;58public class DeployerTest {59 private static final Logger LOGGER = LoggerFactory.getLogger(DeployerTest.class);60 private Resolver resolver = new ResolverImpl(new Slf4jResolverLog(LOGGER));61 @Test62 public void testInstallSimpleFeature() throws Exception {63 IMocksControl c = EasyMock.createControl();64 String dataDir = "data1";65 TestDownloadManager manager = new TestDownloadManager(getClass(), dataDir);66 RepositoryImpl repo = new RepositoryImpl(getClass().getResource(dataDir + "/features.xml").toURI());67 repo.load(true);68 Feature f100 = repo.getFeatures()[0];69 Feature f101 = repo.getFeatures()[1];70 Deployer.DeployCallback callback = c.createMock(Deployer.DeployCallback.class);71 BundleInstallSupport installSupport = c.createMock(BundleInstallSupportImpl.class);72 Deployer deployer = new Deployer(manager, resolver, installSupport, callback);73 callback.print(EasyMock.anyString(), EasyMock.anyBoolean());74 EasyMock.expectLastCall().anyTimes();75 callback.callListeners(DeploymentEvent.DEPLOYMENT_STARTED);76 EasyMock.expectLastCall();77 installSupport.replaceDigraph(EasyMock.<Map<String, Map<String, Map<String, Set<String>>>>>anyObject(),78 EasyMock.<Map<String, Set<Long>>>anyObject());79 EasyMock.expectLastCall();80 callback.saveState(EasyMock.<State>anyObject());81 EasyMock.expectLastCall();82 installSupport.installConfigs(f100);83 EasyMock.expectLastCall();84 installSupport.installLibraries(f100);85 EasyMock.expectLastCall();86 callback.callListeners(DeploymentEvent.BUNDLES_INSTALLED);87 EasyMock.expectLastCall();88 installSupport.resolveBundles(EasyMock.<Set<Bundle>>anyObject(),89 EasyMock.<Map<Resource, List<Wire>>>anyObject(),90 EasyMock.<Map<Resource, Bundle>>anyObject());91 EasyMock.expectLastCall();92 callback.callListeners(DeploymentEvent.BUNDLES_RESOLVED);93 EasyMock.expectLastCall();94 callback.callListeners(EasyMock.<FeatureEvent>anyObject());95 EasyMock.expectLastCall();96 callback.callListeners(DeploymentEvent.DEPLOYMENT_FINISHED);97 EasyMock.expectLastCall();98 Bundle bundleA = createTestBundle(1, Bundle.ACTIVE, dataDir, "a100");99 EasyMock.expect(installSupport.installBundle(EasyMock.eq(ROOT_REGION), EasyMock.eq("a100"), EasyMock.<InputStream>anyObject()))100 .andReturn(bundleA);101 c.replay();102 Deployer.DeploymentState dstate = new Deployer.DeploymentState();103 dstate.state = new State();104 dstate.bundles = new HashMap<>();105 dstate.bundlesPerRegion = new HashMap<>();106 dstate.features = new HashMap<>();107 dstate.features.put(f100.getId(), f100);108 dstate.features.put(f101.getId(), f101);109 dstate.filtersPerRegion = new HashMap<>();110 dstate.filtersPerRegion.put(ROOT_REGION, new HashMap<String, Map<String, Set<String>>>());111 Deployer.DeploymentRequest request = new Deployer.DeploymentRequest();112 request.bundleUpdateRange = DEFAULT_BUNDLE_UPDATE_RANGE;113 request.featureResolutionRange = DEFAULT_FEATURE_RESOLUTION_RANGE;114 request.globalRepository = null;115 request.options = EnumSet.noneOf(Option.class);116 request.overrides = Collections.emptySet();117 request.stateChanges = Collections.emptyMap();118 request.updateSnaphots = UPDATE_SNAPSHOTS_NONE;119 request.requirements = new HashMap<>();120 addToMapSet(request.requirements, ROOT_REGION, f100.getName() + "/" + new VersionRange(f100.getVersion(), true));121 deployer.deploy(dstate, request);122 c.verify();123 }124 @Test125 public void testUpdateSimpleFeature() throws Exception {126 IMocksControl c = EasyMock.createControl();127 final String dataDir = "data1";128 TestDownloadManager manager = new TestDownloadManager(getClass(), dataDir);129 RepositoryImpl repo = new RepositoryImpl(getClass().getResource(dataDir + "/features.xml").toURI());130 repo.load(true);131 Feature f100 = repo.getFeatures()[0];132 Feature f101 = repo.getFeatures()[1];133 Deployer.DeployCallback callback = c.createMock(Deployer.DeployCallback.class);134 BundleInstallSupport installSupport = c.createMock(BundleInstallSupportImpl.class);135 Deployer deployer = new Deployer(manager, resolver, installSupport, callback);136 final TestBundle bundleA = createTestBundle(1L, Bundle.ACTIVE, dataDir, "a100");137 callback.print(EasyMock.anyString(), EasyMock.anyBoolean());138 EasyMock.expectLastCall().anyTimes();139 callback.callListeners(DeploymentEvent.DEPLOYMENT_STARTED);140 EasyMock.expectLastCall();141 installSupport.stopBundle(EasyMock.eq(bundleA), anyInt());142 EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {143 @Override144 public Object answer() throws Throwable {145 bundleA.state = Bundle.RESOLVED;146 return null;147 }148 });149 installSupport.updateBundle(EasyMock.eq(bundleA), EasyMock.<String>anyObject(), EasyMock.<InputStream>anyObject());150 EasyMock.expectLastCall().andStubAnswer(new IAnswer<Object>() {151 @Override152 public Object answer() throws Throwable {153 URL loc = getClass().getResource(dataDir + "/" + "a101" + ".mf");154 Manifest man = new Manifest(loc.openStream());155 Hashtable<String, String> headers = new Hashtable<>();156 for (Map.Entry<Object, Object> attr : man.getMainAttributes().entrySet()) {157 headers.put(attr.getKey().toString(), attr.getValue().toString());158 }159 bundleA.update(headers);160 return null;161 }162 });163 installSupport.startBundle(EasyMock.eq(bundleA));164 EasyMock.expectLastCall();165 installSupport.replaceDigraph(EasyMock.<Map<String, Map<String, Map<String, Set<String>>>>>anyObject(),166 EasyMock.<Map<String, Set<Long>>>anyObject());167 EasyMock.expectLastCall();168 callback.saveState(EasyMock.<State>anyObject());169 EasyMock.expectLastCall();170 installSupport.installConfigs(f101);171 EasyMock.expectLastCall();172 installSupport.installLibraries(f101);173 EasyMock.expectLastCall();174 callback.callListeners(DeploymentEvent.BUNDLES_INSTALLED);175 EasyMock.expectLastCall();176 installSupport.resolveBundles(EasyMock.eq(Collections.<Bundle>singleton(bundleA)),177 EasyMock.<Map<Resource, List<Wire>>>anyObject(),178 EasyMock.<Map<Resource, Bundle>>anyObject());179 EasyMock.expectLastCall();180 callback.callListeners(DeploymentEvent.BUNDLES_RESOLVED);181 EasyMock.expectLastCall();182 installSupport.refreshPackages(EasyMock.eq(Collections.<Bundle>singleton(bundleA)));183 EasyMock.expectLastCall();184 callback.callListeners(FeatureEventMatcher.eq(new FeatureEvent(FeatureEvent.EventType.FeatureUninstalled, f100, FeaturesService.ROOT_REGION, false)));185 EasyMock.expectLastCall();186 callback.callListeners(FeatureEventMatcher.eq(new FeatureEvent(FeatureEvent.EventType.FeatureInstalled, f101, FeaturesService.ROOT_REGION, false)));187 EasyMock.expectLastCall();188 callback.callListeners(DeploymentEvent.DEPLOYMENT_FINISHED);189 EasyMock.expectLastCall();190 c.replay();191 Deployer.DeploymentState dstate = new Deployer.DeploymentState();192 dstate.state = new State();193 addToMapSet(dstate.state.installedFeatures, ROOT_REGION, f100.getId());194 addToMapSet(dstate.state.managedBundles, ROOT_REGION, 1L);195 dstate.bundles = new HashMap<>();196 dstate.bundles.put(1L, bundleA);197 dstate.bundlesPerRegion = new HashMap<>();198 addToMapSet(dstate.bundlesPerRegion, ROOT_REGION, 1L);199 dstate.features = new HashMap<>();200 dstate.features.put(f100.getId(), f100);201 dstate.features.put(f101.getId(), f101);202 dstate.filtersPerRegion = new HashMap<>();203 dstate.filtersPerRegion.put(ROOT_REGION, new HashMap<String, Map<String, Set<String>>>());204 Deployer.DeploymentRequest request = new Deployer.DeploymentRequest();205 request.bundleUpdateRange = DEFAULT_BUNDLE_UPDATE_RANGE;206 request.featureResolutionRange = DEFAULT_FEATURE_RESOLUTION_RANGE;207 request.globalRepository = null;208 request.options = EnumSet.noneOf(Option.class);209 request.overrides = Collections.emptySet();210 request.stateChanges = Collections.emptyMap();211 request.updateSnaphots = UPDATE_SNAPSHOTS_NONE;212 request.requirements = new HashMap<>();213 addToMapSet(request.requirements, ROOT_REGION, f101.getName() + "/" + new VersionRange(f101.getVersion(), true));214 deployer.deploy(dstate, request);215 c.verify();216 }217 @Test218 public void testUpdateServiceBundle() throws Exception {219 IMocksControl c = EasyMock.createControl();220 String dataDir = "data1";221 TestDownloadManager manager = new TestDownloadManager(getClass(), dataDir);222 RepositoryImpl repo = new RepositoryImpl(getClass().getResource(dataDir + "/features.xml").toURI());223 repo.load(true);224 Feature f1 = repo.getFeatures()[0];225 Bundle serviceBundle = createTestBundle(1, Bundle.ACTIVE, dataDir, "a100");226 Deployer.DeployCallback callback = c.createMock(Deployer.DeployCallback.class);227 BundleInstallSupport installSupport = c.createMock(BundleInstallSupportImpl.class);228 Deployer deployer = new Deployer(manager, resolver, installSupport, callback);229 callback.print(EasyMock.anyString(), EasyMock.anyBoolean());230 EasyMock.expectLastCall().anyTimes();231 callback.callListeners(DeploymentEvent.DEPLOYMENT_STARTED);232 EasyMock.expectLastCall();233 installSupport.replaceDigraph(EasyMock.<Map<String, Map<String, Map<String, Set<String>>>>>anyObject(),234 EasyMock.<Map<String, Set<Long>>>anyObject());235 EasyMock.expectLastCall();236 callback.saveState(EasyMock.<State>anyObject());237 EasyMock.expectLastCall();238 callback.callListeners(DeploymentEvent.BUNDLES_INSTALLED);239 EasyMock.expectLastCall();240 installSupport.installConfigs(f1);241 EasyMock.expectLastCall();242 installSupport.installLibraries(f1);243 EasyMock.expectLastCall();244 installSupport.resolveBundles(EasyMock.<Set<Bundle>>anyObject(),245 EasyMock.<Map<Resource, List<Wire>>>anyObject(),246 EasyMock.<Map<Resource, Bundle>>anyObject());247 EasyMock.expectLastCall();248 callback.callListeners(DeploymentEvent.BUNDLES_RESOLVED);249 EasyMock.expectLastCall();250 callback.callListeners(EasyMock.<FeatureEvent>anyObject());251 EasyMock.expectLastCall();252 callback.callListeners(DeploymentEvent.DEPLOYMENT_FINISHED);253 EasyMock.expectLastCall();254 c.replay();255 Deployer.DeploymentState dstate = new Deployer.DeploymentState();256 dstate.state = new State();257 dstate.bundles = new HashMap<>();258 dstate.bundles.put(serviceBundle.getBundleId(), serviceBundle);259 dstate.bundlesPerRegion = new HashMap<>();260 addToMapSet(dstate.bundlesPerRegion, ROOT_REGION, serviceBundle.getBundleId());261 dstate.features = Collections.singletonMap(f1.getId(), f1);262 dstate.filtersPerRegion = new HashMap<>();263 dstate.filtersPerRegion.put(ROOT_REGION, new HashMap<String, Map<String, Set<String>>>());264 Deployer.DeploymentRequest request = new Deployer.DeploymentRequest();265 request.bundleUpdateRange = DEFAULT_BUNDLE_UPDATE_RANGE;266 request.featureResolutionRange = DEFAULT_FEATURE_RESOLUTION_RANGE;267 request.globalRepository = null;268 request.options = EnumSet.noneOf(Option.class);269 request.overrides = Collections.emptySet();270 request.stateChanges = Collections.emptyMap();271 request.updateSnaphots = UPDATE_SNAPSHOTS_NONE;272 request.requirements = new HashMap<>();273 addToMapSet(request.requirements, ROOT_REGION, f1.getName());274 deployer.deploy(dstate, request);275 c.verify();276 }277 @Test278 public void testPrerequisite() throws Exception {279 IMocksControl c = EasyMock.createControl();280 String dataDir = "data2";281 TestDownloadManager manager = new TestDownloadManager(getClass(), dataDir);282 RepositoryImpl repo = new RepositoryImpl(getClass().getResource(dataDir + "/features.xml").toURI());283 repo.load(true);284 Feature f1 = repo.getFeatures()[0];285 Feature f2 = repo.getFeatures()[1];286 Bundle serviceBundle1 = createTestBundle(1, Bundle.ACTIVE, dataDir, "a100");287 Bundle serviceBundle2 = createTestBundle(2, Bundle.ACTIVE, dataDir, "b100");288 Deployer.DeployCallback callback = c.createMock(Deployer.DeployCallback.class);289 BundleInstallSupport installSupport = c.createMock(BundleInstallSupportImpl.class);290 Deployer deployer = new Deployer(manager, resolver, installSupport, callback);291 callback.print(EasyMock.anyString(), EasyMock.anyBoolean());292 EasyMock.expectLastCall().anyTimes();293 callback.callListeners(DeploymentEvent.DEPLOYMENT_STARTED);294 EasyMock.expectLastCall();295 installSupport.installBundle(EasyMock.eq(ROOT_REGION), EasyMock.eq("a100"), EasyMock.<InputStream>anyObject());296 EasyMock.expectLastCall().andReturn(serviceBundle1);297 installSupport.replaceDigraph(EasyMock.<Map<String, Map<String, Map<String, Set<String>>>>>anyObject(),298 EasyMock.<Map<String, Set<Long>>>anyObject());299 EasyMock.expectLastCall();300 callback.saveState(EasyMock.<State>anyObject());301 EasyMock.expectLastCall();302 installSupport.installConfigs(EasyMock.anyObject());303 EasyMock.expectLastCall();304 installSupport.installLibraries(EasyMock.anyObject());305 EasyMock.expectLastCall();306 callback.callListeners(DeploymentEvent.BUNDLES_INSTALLED);307 EasyMock.expectLastCall();308 installSupport.resolveBundles(EasyMock.<Set<Bundle>>anyObject(),309 EasyMock.<Map<Resource, List<Wire>>>anyObject(),310 EasyMock.<Map<Resource, Bundle>>anyObject());311 EasyMock.expectLastCall();312 callback.callListeners(DeploymentEvent.BUNDLES_RESOLVED);313 EasyMock.expectLastCall();314 callback.callListeners(EasyMock.<FeatureEvent>anyObject());315 EasyMock.expectLastCall();316 callback.callListeners(DeploymentEvent.DEPLOYMENT_FINISHED);317 EasyMock.expectLastCall();318 c.replay();319 Deployer.DeploymentState dstate = new Deployer.DeploymentState();320 dstate.state = new State();321 dstate.bundles = new HashMap<>();322 dstate.bundlesPerRegion = new HashMap<>();323 dstate.features = new HashMap<>();324 dstate.features.put(f1.getId(), f1);325 dstate.features.put(f2.getId(), f2);326 dstate.filtersPerRegion = new HashMap<>();327 dstate.filtersPerRegion.put(ROOT_REGION, new HashMap<String, Map<String, Set<String>>>());328 Deployer.DeploymentRequest request = new Deployer.DeploymentRequest();329 request.bundleUpdateRange = DEFAULT_BUNDLE_UPDATE_RANGE;330 request.featureResolutionRange = DEFAULT_FEATURE_RESOLUTION_RANGE;331 request.globalRepository = null;332 request.options = EnumSet.noneOf(Option.class);333 request.overrides = Collections.emptySet();334 request.stateChanges = Collections.emptyMap();335 request.updateSnaphots = UPDATE_SNAPSHOTS_NONE;336 request.requirements = new HashMap<>();337 addToMapSet(request.requirements, ROOT_REGION, f2.getName());338 try {339 deployer.deploy(dstate, request);340 fail("Should have thrown an exception");341 } catch (Deployer.PartialDeploymentException e) {342 // ok343 }344 c.verify();345 c.reset();346 callback.print(EasyMock.anyString(), EasyMock.anyBoolean());347 EasyMock.expectLastCall().anyTimes();348 callback.callListeners(DeploymentEvent.DEPLOYMENT_STARTED);349 EasyMock.expectLastCall();350 installSupport.installBundle(EasyMock.eq(ROOT_REGION), EasyMock.eq("b100"), EasyMock.<InputStream>anyObject());351 EasyMock.expectLastCall().andReturn(serviceBundle2);352 installSupport.replaceDigraph(EasyMock.<Map<String, Map<String, Map<String, Set<String>>>>>anyObject(),353 EasyMock.<Map<String, Set<Long>>>anyObject());354 EasyMock.expectLastCall();355 callback.saveState(EasyMock.<State>anyObject());356 EasyMock.expectLastCall();357 installSupport.installConfigs(f2);358 EasyMock.expectLastCall();359 installSupport.installLibraries(f2);360 EasyMock.expectLastCall();361 callback.callListeners(DeploymentEvent.BUNDLES_INSTALLED);362 EasyMock.expectLastCall();363 installSupport.resolveBundles(EasyMock.<Set<Bundle>>anyObject(),364 EasyMock.<Map<Resource, List<Wire>>>anyObject(),365 EasyMock.<Map<Resource, Bundle>>anyObject());366 EasyMock.expectLastCall();367 callback.callListeners(DeploymentEvent.BUNDLES_RESOLVED);368 EasyMock.expectLastCall();369 callback.callListeners(EasyMock.<FeatureEvent>anyObject());370 EasyMock.expectLastCall();371 callback.callListeners(DeploymentEvent.DEPLOYMENT_FINISHED);372 EasyMock.expectLastCall();373 EasyMock.replay(callback);374 dstate = new Deployer.DeploymentState();375 dstate.state = new State();376 addToMapSet(dstate.state.installedFeatures, ROOT_REGION, f1.getId());377 dstate.state.stateFeatures.put(ROOT_REGION, Collections.singletonMap(f1.getId(), "Started"));378 addToMapSet(dstate.state.managedBundles, ROOT_REGION, serviceBundle1.getBundleId());379 dstate.bundles = new HashMap<>();380 dstate.bundles.put(serviceBundle1.getBundleId(), serviceBundle1);381 dstate.bundlesPerRegion = new HashMap<>();382 addToMapSet(dstate.bundlesPerRegion, ROOT_REGION, serviceBundle1.getBundleId());383 dstate.features = new HashMap<>();384 dstate.features.put(f1.getId(), f1);385 dstate.features.put(f2.getId(), f2);386 dstate.filtersPerRegion = new HashMap<>();387 dstate.filtersPerRegion.put(ROOT_REGION, new HashMap<String, Map<String, Set<String>>>());388 request = new Deployer.DeploymentRequest();389 request.bundleUpdateRange = DEFAULT_BUNDLE_UPDATE_RANGE;390 request.featureResolutionRange = DEFAULT_FEATURE_RESOLUTION_RANGE;391 request.globalRepository = null;392 request.options = EnumSet.noneOf(Option.class);393 request.overrides = Collections.emptySet();394 request.stateChanges = Collections.emptyMap();395 request.updateSnaphots = UPDATE_SNAPSHOTS_NONE;396 request.requirements = new HashMap<>();397 addToMapSet(request.requirements, ROOT_REGION, f2.getName());398 deployer.deploy(dstate, request);399 EasyMock.verify(callback);400 }401 @Test402 public void testPrereqOnPrereq1() throws Exception {403 doTestPrereqOnPrereq(1);404 }405 @Test406 public void testPrereqOnPrereq2() throws Exception {407 doTestPrereqOnPrereq(2);408 }409 @Test410 public void testPrereqOnPrereq3() throws Exception {411 doTestPrereqOnPrereq(3);412 }413 @Test414 public void testPrereqOnPrereq4() throws Exception {415 doTestPrereqOnPrereq(4);416 }417 @SuppressWarnings("unchecked")418 private void doTestPrereqOnPrereq(int scenario) throws Exception {419 IMocksControl c = EasyMock.createControl();420 String dataDir = "data3";421 TestDownloadManager manager = new TestDownloadManager(getClass(), dataDir);422 RepositoryImpl repo = new RepositoryImpl(getClass().getResource(dataDir + "/features.xml").toURI());423 repo.load(true);424 Map<String, Bundle> bundles = new HashMap<>();425 bundles.put("a100", createTestBundle(1, Bundle.ACTIVE, dataDir, "a100"));426 bundles.put("b100", createTestBundle(2, Bundle.ACTIVE, dataDir, "b100"));427 bundles.put("c100", createTestBundle(3, Bundle.ACTIVE, dataDir, "c100"));428 Deployer.DeploymentState dstate = new Deployer.DeploymentState();429 dstate.state = new State();430 dstate.bundles = new HashMap<>();431 dstate.bundlesPerRegion = new HashMap<>();432 dstate.features = new HashMap<>();433 for (Feature f : repo.getFeatures()) {434 dstate.features.put(f.getId(), f);435 }436 dstate.filtersPerRegion = new HashMap<>();437 dstate.filtersPerRegion.put(ROOT_REGION, new HashMap<>());438 Deployer.DeploymentRequest request = new Deployer.DeploymentRequest();439 request.bundleUpdateRange = DEFAULT_BUNDLE_UPDATE_RANGE;440 request.featureResolutionRange = DEFAULT_FEATURE_RESOLUTION_RANGE;441 request.globalRepository = null;442 request.options = EnumSet.noneOf(Option.class);443 request.overrides = Collections.emptySet();444 request.stateChanges = Collections.emptyMap();445 request.updateSnaphots = UPDATE_SNAPSHOTS_NONE;446 MyDeployCallback callback = new MyDeployCallback(dstate);447 BundleInstallSupport installSupport = c.createMock(BundleInstallSupportImpl.class);448 Capture<String> capture = Capture.newInstance();449 installSupport.installBundle(EasyMock.anyString(), EasyMock.capture(capture), anyObject(InputStream.class));450 EasyMock.expectLastCall().andAnswer(() -> bundles.get(capture.getValue())).atLeastOnce();451 installSupport.installConfigs(EasyMock.anyObject());452 EasyMock.expectLastCall().atLeastOnce();453 installSupport.installLibraries(EasyMock.anyObject());454 EasyMock.expectLastCall().atLeastOnce();...

Full Screen

Full Screen

Source:TestStandardTestChooser.java Github

copy

Full Screen

...3import com.google.common.collect.ImmutableMap;4import com.google.common.collect.Lists;5import com.indeed.proctor.common.model.Allocation;6import com.indeed.proctor.common.model.ConsumableTestDefinition;7import com.indeed.proctor.common.model.Range;8import com.indeed.proctor.common.model.TestBucket;9import com.indeed.proctor.common.model.TestDefinition;10import com.indeed.proctor.common.model.TestDependency;11import com.indeed.proctor.common.model.TestType;12import org.apache.el.ExpressionFactoryImpl;13import org.easymock.classextension.EasyMock;14import org.junit.Before;15import org.junit.Test;16import javax.el.ExpressionFactory;17import javax.el.FunctionMapper;18import java.util.Collections;19import java.util.List;20import java.util.Map;21import static org.assertj.core.api.Assertions.assertThat;22import static org.junit.Assert.assertEquals;23import static org.junit.Assert.assertNotNull;24import static org.junit.Assert.assertNull;25/**26 * @author rboyer27 */28public class TestStandardTestChooser {29 private ExpressionFactory expressionFactory;30 private FunctionMapper functionMapper;31 private String testName;32 private ConsumableTestDefinition testDefinition;33 private int[] counts;34 private int[] hashes;35 private static final ImmutableList<Range> RANGES_50_50 = ImmutableList.of(36 new Range(-1, 0.0),37 new Range(0, 0.5),38 new Range(1, 0.5)39 );40 private static final ImmutableList<Range> RANGES_100_0 = ImmutableList.of(41 new Range(-1, 0.0),42 new Range(0, 0.0),43 new Range(1, 1.0)44 );45 private static final List<TestBucket> INACTIVE_CONTROL_TEST_BUCKETS = ImmutableList.of(46 new TestBucket("inactive", -1, "zoot", null),47 new TestBucket("control", 0, "zoot", null),48 new TestBucket("test", 1, "zoot", null)49 );50 @Before51 public void setupMocks() throws Exception {52 expressionFactory = new ExpressionFactoryImpl();53 functionMapper = RuleEvaluator.FUNCTION_MAPPER;54 testName = "testName";55 testDefinition = new ConsumableTestDefinition();56 testDefinition.setConstants(Collections.<String, Object>emptyMap());57 testDefinition.setTestType(TestType.AUTHENTICATED_USER);58 // most tests just set the salt to be the same as the test name59 testDefinition.setSalt(testName);60 testDefinition.setBuckets(INACTIVE_CONTROL_TEST_BUCKETS);61 updateAllocations(RANGES_50_50);62 final int effBuckets = INACTIVE_CONTROL_TEST_BUCKETS.size() - 1;63 counts = new int[effBuckets];64 hashes = new int[effBuckets];65 }66 @Test67 public void testSimple_100_0() {68 updateAllocations(RANGES_100_0);69 final StandardTestChooser rtc = newChooser();70 final Map<String, Object> values = Collections.emptyMap();71 for (int i = 0; i < 100; i++) {72 final TestChooser.Result chosen = rtc.chooseInternal(String.valueOf(i), values, Collections.emptyMap());73 assertNotNull(chosen);74 assertNotNull(chosen.getTestBucket());75 assertNotNull(chosen.getAllocation());76 assertEquals(1, chosen.getTestBucket().getValue());77 assertEquals("#A1", chosen.getAllocation().getId());78 }79 }80 @Test81 public void testSimple_50_50() {82 testDefinition.setSalt(testName);83 final StandardTestChooser chooser = newChooser();84 exerciseChooser(chooser);85 // uncomment this if you need to recompute these values86// for (int i = 0; i < counts.length; i++) System.err.println(i + ": " + counts[i] + " / " + hashes[i]);87 // if this ever fails, it means that something is broken about how tests are split88 // and you should investigate why!89 assertEquals("bucket0 counts", 4999412, counts[0]);90 assertEquals("bucket1 counts", 5000587, counts[1]);91 assertEquals("bucket0 hash", 1863060514, hashes[0]);92 assertEquals("bucket1 hash", 765061458, hashes[1]);93 }94 // constants shared between the next two tests95 private static final int COUNTS_BUCKET0_SALT_AMP_TESTNAME = 4999049;96 private static final int COUNTS_BUCKET1_SALT_AMP_TESTNAME = 5000950;97 private static final int HASH_BUCKET0_SALT_AMP_TESTNAME = 1209398320;98 private static final int HASH_BUCKET1_SALT_AMP_TESTNAME = 494965600;99 @Test100 public void test_50_50_withMagicTestSalt() {101 // Now change the spec version and reevaluate102 testDefinition.setSalt("&" + testName);103 final StandardTestChooser chooser = newChooser();104 exerciseChooser(chooser);105 // uncomment this if you need to recompute these values106// for (int i = 0; i < counts.length; i++) System.err.println(i + ": " + counts[i] + " / " + hashes[i]);107 // if this ever fails, it means that something is broken about how tests are split108 // and you should investigate why!109 assertEquals("bucket0 counts", COUNTS_BUCKET0_SALT_AMP_TESTNAME, counts[0]);110 assertEquals("bucket1 counts", COUNTS_BUCKET1_SALT_AMP_TESTNAME, counts[1]);111 assertEquals("bucket0 hash", HASH_BUCKET0_SALT_AMP_TESTNAME, hashes[0]);112 assertEquals("bucket1 hash", HASH_BUCKET1_SALT_AMP_TESTNAME, hashes[1]);113 }114 @Test115 public void test50_50_withMagicTestSalt_and_unrelatedTestName() {116 final String originalTestName = testName;117 testName = "someOtherTestName";118 testDefinition.setSalt("&" + originalTestName);119 final StandardTestChooser chooser = newChooser();120 exerciseChooser(chooser);121 // uncomment this if you need to recompute these values122// for (int i = 0; i < counts.length; i++) System.err.println(i + ": " + counts[i] + " / " + hashes[i]);123 // if this ever fails, it means that something is broken about how tests are split124 // and you should investigate why!125 // These values should be the same as in the preceding test126 assertEquals("bucket0 counts", COUNTS_BUCKET0_SALT_AMP_TESTNAME, counts[0]);127 assertEquals("bucket1 counts", COUNTS_BUCKET1_SALT_AMP_TESTNAME, counts[1]);128 assertEquals("bucket0 hash", HASH_BUCKET0_SALT_AMP_TESTNAME, hashes[0]);129 assertEquals("bucket1 hash", HASH_BUCKET1_SALT_AMP_TESTNAME, hashes[1]);130 }131 @Test132 public void testExceptionsDealtWith() {133 final String testName = "test";134 final ConsumableTestDefinition testDefinition = new ConsumableTestDefinition();135 testDefinition.setConstants(Collections.<String, Object>emptyMap());136 testDefinition.setRule("${lang == 'en'}");137 testDefinition.setTestType(TestType.ANONYMOUS_USER);138 // most tests just set the salt to be the same as the test name139 testDefinition.setSalt(testName);140 testDefinition.setBuckets(Collections.<TestBucket>emptyList());141 final RuleEvaluator ruleEvaluator = EasyMock.createMock(RuleEvaluator.class);142 EasyMock.expect(ruleEvaluator.evaluateBooleanRule(143 EasyMock.<String>anyObject(),144 EasyMock.<Map<String,Object>>anyObject()145 ))146 // throw an unexpected type of runtime exception147 .andThrow(new RuntimeException() {})148 // Must be evaluated, or this was not a valid test149 .once();150 EasyMock.replay(ruleEvaluator);151 final TestRangeSelector selector = new TestRangeSelector(152 ruleEvaluator,153 testName,154 testDefinition155 );156 // Ensure no exceptions thrown.157 final TestChooser.Result chooseResult = new StandardTestChooser(selector)158 .chooseInternal("identifier", Collections.<String, Object>emptyMap(), Collections.emptyMap());159 assertNotNull(chooseResult);160 assertNull( "Expected no bucket to be found ", chooseResult.getTestBucket());161 assertNull( "Expected no allocation to be found ", chooseResult.getAllocation());162 EasyMock.verify(ruleEvaluator);163 }164 @Test165 public void testDefaultAllocationWithNonEmptyRule_fallback() {166 final String testName = "test";167 final ConsumableTestDefinition testDefinition = new ConsumableTestDefinition();168 testDefinition.setConstants(Collections.<String, Object>emptyMap());169 testDefinition.setTestType(TestType.ANONYMOUS_USER);170 testDefinition.setSalt(testName);171 testDefinition.setBuckets(INACTIVE_CONTROL_TEST_BUCKETS);172 final List<Allocation> allocations = Lists.newArrayList();173 allocations.add(new Allocation("${country == 'US'}", RANGES_100_0, "#B1"));174 allocations.add(new Allocation("${country == 'GB'}", RANGES_100_0, "#C1"));175 testDefinition.setAllocations(allocations);176 final RuleEvaluator ruleEvaluator = newRuleEvaluator(false);177 final TestRangeSelector selector = new TestRangeSelector(178 ruleEvaluator,179 testName,180 testDefinition181 );182 final TestChooser.Result chooseResult = new StandardTestChooser(selector)183 .chooseInternal("identifier", Collections.<String, Object>emptyMap(), Collections.emptyMap());184 assertNotNull(chooseResult);185 assertNull("Expected no bucket to be found", chooseResult.getTestBucket());186 assertNull("Expected no allocation to be found", chooseResult.getAllocation());187 EasyMock.verify(ruleEvaluator);188 }189 @Test190 public void testDefaultAllocationWithNonEmptyRule_match() {191 final String testName = "test";192 final ConsumableTestDefinition testDefinition = new ConsumableTestDefinition();193 testDefinition.setConstants(Collections.<String, Object>emptyMap());194 testDefinition.setRule("${lang == 'en'}");195 testDefinition.setTestType(TestType.ANONYMOUS_USER);196 testDefinition.setSalt(testName);197 testDefinition.setBuckets(INACTIVE_CONTROL_TEST_BUCKETS);198 final List<Allocation> allocations = Lists.newArrayList();199 allocations.add(new Allocation("${country == 'GB'}", RANGES_100_0, "#B1"));200 testDefinition.setAllocations(allocations);201 final RuleEvaluator ruleEvaluator = newRuleEvaluator(true);202 final TestRangeSelector selector = new TestRangeSelector(203 ruleEvaluator,204 testName,205 testDefinition206 );207 final TestChooser.Result chooseResult = new StandardTestChooser(selector)208 .chooseInternal("identifier", Collections.<String, Object>emptyMap(), Collections.emptyMap());209 assertEquals("Test bucket with value 1 expected", 1, chooseResult.getTestBucket().getValue());210 assertEquals("Test allocation with id #B1 expected", "#B1", chooseResult.getAllocation().getId());211 EasyMock.verify(ruleEvaluator);212 }213 @Test214 public void testDependency_match() {215 final String testName = "test";216 final ConsumableTestDefinition testDefinition = ConsumableTestDefinition.fromTestDefinition(217 TestDefinition.builder()218 .setTestType(TestType.ANONYMOUS_USER)219 .setSalt(testName)220 .setBuckets(INACTIVE_CONTROL_TEST_BUCKETS)221 .addAllocations(new Allocation("", RANGES_100_0, "#B1"))222 .setDependsOn(new TestDependency("par_test", 10))223 .build()224 );225 final RuleEvaluator ruleEvaluator = newRuleEvaluator(true);226 final TestRangeSelector selector = new TestRangeSelector(227 ruleEvaluator,228 testName,229 testDefinition230 );231 final TestChooser.Result chooseResult = new StandardTestChooser(selector)232 .chooseInternal(233 "identifier",234 Collections.emptyMap(),235 ImmutableMap.of("par_test", new TestBucket("", 10, ""))236 );237 assertThat(chooseResult.getTestBucket().getValue()).isEqualTo(1);238 assertThat(chooseResult.getAllocation().getId()).isEqualTo("#B1");239 }240 @Test241 public void testDependency_fallback() {242 final String testName = "test";243 final ConsumableTestDefinition testDefinition = ConsumableTestDefinition.fromTestDefinition(244 TestDefinition.builder()245 .setTestType(TestType.ANONYMOUS_USER)246 .setSalt(testName)247 .setBuckets(INACTIVE_CONTROL_TEST_BUCKETS)248 .addAllocations(new Allocation("", RANGES_100_0, "#B1"))249 .setDependsOn(new TestDependency("par_test", 10))250 .build()251 );252 final RuleEvaluator ruleEvaluator = newRuleEvaluator(true);253 final TestRangeSelector selector = new TestRangeSelector(254 ruleEvaluator,255 testName,256 testDefinition257 );258 final TestChooser.Result chooseResult = new StandardTestChooser(selector)259 .chooseInternal(260 "identifier",261 Collections.emptyMap(),262 ImmutableMap.of("par_test", new TestBucket("", 1, ""))263 );264 assertThat(chooseResult.getTestBucket()).isNull();265 assertThat(chooseResult.getAllocation()).isNull();266 }267 private StandardTestChooser newChooser() {268 return new StandardTestChooser(269 expressionFactory,270 functionMapper,271 testName,272 testDefinition273 );274 }275 private RuleEvaluator newRuleEvaluator(final boolean result) {276 final RuleEvaluator ruleEvaluator = EasyMock.createMock(RuleEvaluator.class);277 EasyMock.expect(ruleEvaluator.evaluateBooleanRule(278 EasyMock.<String>anyObject(),279 EasyMock.<Map<String,Object>>anyObject()280 ))281 .andReturn(result)282 .anyTimes();283 EasyMock.replay(ruleEvaluator);284 return ruleEvaluator;285 }286 private void exerciseChooser(final StandardTestChooser rtc) {287 final int num = 10000000;288 final Map<String, Object> values = Collections.emptyMap();289 for (int accountId = 1; accountId < num; accountId++) { // deliberately skipping 0290 final TestChooser.Result chosen = rtc.chooseInternal(String.valueOf(accountId), values, Collections.emptyMap());291 assertNotNull(chosen);292 assertNotNull(chosen.getTestBucket());293 assertNotNull(chosen.getAllocation());294 counts[chosen.getTestBucket().getValue()]++;295 hashes[chosen.getTestBucket().getValue()] = 31 * hashes[chosen.getTestBucket().getValue()] + accountId;296 }297 }298 private void updateAllocations(final ImmutableList<Range> ranges) {299 final List<Allocation> allocations = Lists.newArrayList();300 allocations.add(new Allocation("${}", ranges, "#A1"));301 testDefinition.setAllocations(allocations);302 }303}...

Full Screen

Full Screen

Range

Using AI Code Generation

copy

Full Screen

1import java.util.ArrayList;2import java.util.List;3import org.easymock.EasyMock;4import org.easymock.internal.Range;5import org.junit.Test;6public class RangeTest {7 public void testRange() {8 List<String> mock = EasyMock.createMock(List.class);9 mock.add("a");10 EasyMock.expectLastCall().times(Range.range(1, 5));11 EasyMock.replay(mock);12 mock.add("a");13 mock.add("a");14 mock.add("a");15 mock.add("a");16 EasyMock.verify(mock);17 }18}19import java.util.ArrayList;20import java.util.List;21import org.easymock.EasyMock;22import org.easymock.internal.Range;23import org.junit.Test;24public class RangeTest {25 public void testRange() {26 List<String> mock = EasyMock.createMock(List.class);27 mock.add("a");28 EasyMock.expectLastCall().times(Range.range(1, 5));29 EasyMock.replay(mock);30 mock.add("a");31 mock.add("a");32 mock.add("a");33 mock.add("a");34 mock.add("a");35 EasyMock.verify(mock);36 }37}38import java.util.ArrayList;39import java.util.List;40import org.easymock.EasyMock;41import org.easymock.internal.Range;42import org.junit.Test;43public class RangeTest {44 public void testRange() {45 List<String> mock = EasyMock.createMock(List.class);46 mock.add("a");47 EasyMock.expectLastCall().times(Range.range(1, 5));48 EasyMock.replay(mock);49 mock.add("a");50 mock.add("a");51 mock.add("a");52 mock.add("a");53 mock.add("a");54 mock.add("a");55 EasyMock.verify(mock);56 }57}58import java.util.ArrayList;59import java.util.List;60import org.easymock.EasyMock;61import org.easymock.internal.Range;62import org.junit.Test

Full Screen

Full Screen

Range

Using AI Code Generation

copy

Full Screen

1package org.easymock.internal;2import org.easymock.IArgumentMatcher;3public class Range implements IArgumentMatcher {4 private final int lowerBound;5 private final int upperBound;6 public Range(final int lowerBound, final int upperBound) {7 this.lowerBound = lowerBound;8 this.upperBound = upperBound;9 }10 public boolean matches(final Object argument) {11 if (argument == null) {12 return false;13 }14 if (!(argument instanceof Integer)) {15 return false;16 }17 final int value = (Integer) argument;18 return value >= lowerBound && value <= upperBound;19 }20 public void appendTo(final StringBuffer buffer) {21 buffer.append("in range [").append(lowerBound).append(", ").append(22 upperBound).append("]");23 }24 public static int range(final int lowerBound, final int upperBound) {25 EasyMock.reportMatcher(new Range(lowerBound, upperBound));26 return 0;27 }28}29package org.easymock.internal;30import org.easymock.EasyMock;31import org.easymock.IArgumentMatcher;32import org.junit.Test;33import static org.easymock.EasyMock.expect;34import static org.easymock.EasyMock.expectLastCall;35import static org.easymock.EasyMock.replay;36import static org.easymock.EasyMock.verify;37public class RangeTest {38 public void testRange() {39 final RangeInterface mock = EasyMock.createMock(RangeInterface.class);40 expect(mock.rangeMethod(Range.range(1, 10))).andReturn(1);41 expectLastCall().times(5);42 replay(mock);43 mock.rangeMethod(1);44 mock.rangeMethod(2);45 mock.rangeMethod(3);46 mock.rangeMethod(4);47 mock.rangeMethod(5);48 verify(mock);49 }50}51package org.easymock.internal;52public interface RangeInterface {53 int rangeMethod(int value);54}

Full Screen

Full Screen

Range

Using AI Code Generation

copy

Full Screen

1import org.easymock.internal.Range;2public class 1 {3 public static void main(String[] args) {4 Range range = Range.range(0, 10);5 System.out.println(range);6 }7}

Full Screen

Full Screen

Range

Using AI Code Generation

copy

Full Screen

1package org.easymock.internal;2import org.easymock.internal.Range;3public class RangeTest {4 public static void main(String[] args) {5 Range range = Range.range(0, 5);6 System.out.println(range);7 }8}9package org.easymock.internal;10import org.easymock.internal.Range;11public class RangeTest {12 public static void main(String[] args) {13 Range range = Range.range(0, 5);14 System.out.println(range);15 }16}17package org.easymock.internal;18import org.easymock.internal.Range;19public class RangeTest {20 public static void main(String[] args) {21 Range range = Range.range(0, 5);22 System.out.println(range);23 }24}25package org.easymock.internal;26import org.easymock.internal.Range;27public class RangeTest {28 public static void main(String[] args) {29 Range range = Range.range(0, 5);30 System.out.println(range);31 }32}33package org.easymock.internal;34import org.easymock.internal.Range;35public class RangeTest {36 public static void main(String[] args) {37 Range range = Range.range(0, 5);38 System.out.println(range);39 }40}41package org.easymock.internal;42import org.easymock.internal.Range;43public class RangeTest {44 public static void main(String[] args) {45 Range range = Range.range(0, 5);46 System.out.println(range);47 }48}49package org.easymock.internal;50import org.easymock.internal.Range;51public class RangeTest {52 public static void main(String[] args) {53 Range range = Range.range(0,

Full Screen

Full Screen

Range

Using AI Code Generation

copy

Full Screen

1public class 1 {2 public static void main(String[] args) {3 Range range = Range.range(1, 10);4 System.out.println(range);5 }6}

Full Screen

Full Screen

Range

Using AI Code Generation

copy

Full Screen

1import org.easymock.internal.Range;2public class 1 {3 public static void main(String[] args) {4 Range range = Range.range(1, 3, true);5 System.out.println(range);6 }7}8org.easymock.internal.Range.range(int,int,boolean)9public static Range range(int start, int end, boolean inclusive)10public static Range range(int start, int end)11public static Range range(int end)

Full Screen

Full Screen

Range

Using AI Code Generation

copy

Full Screen

1package org.easymock;2import java.util.*;3import org.easymock.internal.Range;4{5 public static void main(String[] args)6 {7 Range range = Range.range(1, 10, 1);8 System.out.println(range);9 }10}11package org.easymock;12import java.util.*;13import org.easymock.internal.Range;14{15 public static void main(String[] args)16 {17 Range range = Range.range(10, 1, -1);18 System.out.println(range);19 }20}

Full Screen

Full Screen

Range

Using AI Code Generation

copy

Full Screen

1public class TestRange {2 public static void main(String[] args) {3 Range range = Range.between(1, 10);4 System.out.println(range.contains(5));5 }6}7Related posts: How to use org.easymock.EasyMock#andAnswer() method? How to use org.easymock.EasyMock#andStubAnswer() method? How to use org.easymock.EasyMock#andStubReturn() method? How to use org.easymock.EasyMock#andStubThrow() method? How to use org.easymock.EasyMock#andThrow() method? How to use org.easymock.EasyMock#andStubVoid() method? How to use org.easymock.EasyMock#andVoid() method? How to use org.easymock.EasyMock#andStubDelegateTo() method? How to use org.easymock.EasyMock#andDelegateTo() method? How to use org.easymock.EasyMock#andStub() method? How to use org.easymock.EasyMock#and() method? How to use org.easymock.EasyMock#andStubReturn() method? How to use org.easymock.EasyMock#andReturn() method? How to use org.easymock.EasyMock#andStubVoid() method? How to use org.easymock.EasyMock#andVoid() method? How to use org.easymock.EasyMock#andStubDelegateTo() method? How to use org.easymock.EasyMock#andDelegateTo() method? How to use org.easymock.EasyMock#andStub() method? How to use org.easymock.EasyMock#and() method? How to use org.easymock.EasyMock#andStubReturn() method? How to use org.easymock.EasyMock#andReturn() method? How to use org.easymock.EasyMock#andStub() method? How to use org.easymock.EasyMock#and() method? How to use org.easymock.EasyMock#andStubReturn() method? How to use org.easymock.EasyMock#andReturn() method? How to use org.easymock.EasyMock#andStub() method? How

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Easymock automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful