Debian Codegraph @

scala-unit-tests/src/test/scala/org/eclipse/collections/impl/UnmodifiableListIterableTestTrait.scala

raw
1 /*
2 * Copyright (c) 2021 Goldman Sachs.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * and Eclipse Distribution License v. 1.0 which accompany this distribution.
6 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7 * and the Eclipse Distribution License is available at
8 * http://www.eclipse.org/org/documents/edl-v10.php.
9 */
10
11 package org.eclipse.collections.impl
12
13 trait UnmodifiableListIterableTestTrait extends UnmodifiableIterableTestTrait
14 {
15 val classUnderTest: java.util.List[String]
16
17 import org.junit.Test
18
19 @Test(expected = classOf[UnsupportedOperationException])
20 def listIterator_remove_throws
21 {
22 val iterator = classUnderTest.listIterator
23 if (iterator.hasNext) iterator.next
24 iterator.remove
25 }
26
27 @Test(expected = classOf[UnsupportedOperationException])
28 def listIterator_add_throws
29 {
30 val iterator = classUnderTest.listIterator
31 if (iterator.hasNext) iterator.next
32 iterator.add("")
33 }
34
35 @Test(expected = classOf[UnsupportedOperationException])
36 def listIterator_set_throws
37 {
38 val iterator = classUnderTest.listIterator
39 if (iterator.hasNext) iterator.next
40 iterator.set("")
41 }
42 }