X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fservices%2Fsal%2FSalGroupsBatchServiceImplTest.java;fp=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fservices%2Fsal%2FSalGroupsBatchServiceImplTest.java;h=ba70b4951524316e685fdfb7af14b705f45ab3ab;hb=05f8db12159673d0e0a95642fe86e62c14b7dc7b;hp=ec0576f9d48019b5c7edf79336bddf4b96e16628;hpb=b7fa8e6d771da950ea0abe135d8323911f12289e;p=openflowplugin.git diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupsBatchServiceImplTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupsBatchServiceImplTest.java index ec0576f9d4..ba70b49515 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupsBatchServiceImplTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupsBatchServiceImplTest.java @@ -9,6 +9,7 @@ package org.opendaylight.openflowplugin.impl.services.sal; import com.google.common.collect.Lists; +import java.util.Iterator; import java.util.List; import java.util.concurrent.Future; import org.junit.After; @@ -49,6 +50,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.ad import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.add.groups.batch.input.BatchAddGroupsBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.input.update.grouping.OriginalBatchedGroupBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.input.update.grouping.UpdatedBatchedGroupBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.output.list.grouping.BatchFailedGroupsOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.remove.groups.batch.input.BatchRemoveGroups; import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.remove.groups.batch.input.BatchRemoveGroupsBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.update.groups.batch.input.BatchUpdateGroups; @@ -147,14 +149,14 @@ public class SalGroupsBatchServiceImplTest { .build(); final Future> resultFuture = salGroupsBatchService.updateGroupsBatch(input); + Iterator iterator = resultFuture.get().getResult().nonnullBatchFailedGroupsOutput() + .values().iterator(); Assert.assertTrue(resultFuture.isDone()); Assert.assertFalse(resultFuture.get().isSuccessful()); - Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedGroupsOutput().size()); - Assert.assertEquals(43L, - resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue()); - Assert.assertEquals(45L, - resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue()); + Assert.assertEquals(2, resultFuture.get().getResult().nonnullBatchFailedGroupsOutput().size()); + Assert.assertEquals(43L, iterator.next().getGroupId().getValue().longValue()); + Assert.assertEquals(45L, iterator.next().getGroupId().getValue().longValue()); Assert.assertEquals(2, resultFuture.get().getErrors().size()); @@ -215,14 +217,14 @@ public class SalGroupsBatchServiceImplTest { .build(); final Future> resultFuture = salGroupsBatchService.addGroupsBatch(input); + Iterator iterator = resultFuture.get().getResult().nonnullBatchFailedGroupsOutput() + .values().iterator(); Assert.assertTrue(resultFuture.isDone()); Assert.assertFalse(resultFuture.get().isSuccessful()); - Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedGroupsOutput().size()); - Assert.assertEquals(42L, - resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue()); - Assert.assertEquals(43L, - resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue()); + Assert.assertEquals(2, resultFuture.get().getResult().nonnullBatchFailedGroupsOutput().size()); + Assert.assertEquals(42L, iterator.next().getGroupId().getValue().longValue()); + Assert.assertEquals(43L, iterator.next().getGroupId().getValue().longValue()); Assert.assertEquals(2, resultFuture.get().getErrors().size()); @@ -281,14 +283,14 @@ public class SalGroupsBatchServiceImplTest { .build(); final Future> resultFuture = salGroupsBatchService.removeGroupsBatch(input); + Iterator iterator = resultFuture.get().getResult().nonnullBatchFailedGroupsOutput() + .values().iterator(); Assert.assertTrue(resultFuture.isDone()); Assert.assertFalse(resultFuture.get().isSuccessful()); - Assert.assertEquals(2, resultFuture.get().getResult().getBatchFailedGroupsOutput().size()); - Assert.assertEquals(42L, - resultFuture.get().getResult().getBatchFailedGroupsOutput().get(0).getGroupId().getValue().longValue()); - Assert.assertEquals(43L, - resultFuture.get().getResult().getBatchFailedGroupsOutput().get(1).getGroupId().getValue().longValue()); + Assert.assertEquals(2, resultFuture.get().getResult().nonnullBatchFailedGroupsOutput().size()); + Assert.assertEquals(42L, iterator.next().getGroupId().getValue().longValue()); + Assert.assertEquals(43L, iterator.next().getGroupId().getValue().longValue()); Assert.assertEquals(2, resultFuture.get().getErrors().size()); final InOrder inOrder = Mockito.inOrder(salGroupService, transactionService);