2
* Copyright 2011 Goldman Sachs.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
package com.gs.collections.impl
19
import list.mutable.FastList
22
trait SynchronizedCollectionTestTrait extends SynchronizedTestTrait with IterableTestTrait
24
val classUnderTest: java.util.Collection[String]
29
this.assertSynchronized
31
this.classUnderTest.size
36
def isEmpty_synchronized
38
this.assertSynchronized
40
this.classUnderTest.isEmpty
45
def contains_synchronized
47
this.assertSynchronized
49
this.classUnderTest.contains(null)
54
def iterator_not_synchronized
56
this.assertNotSynchronized
58
this.classUnderTest.iterator
63
def toArray_synchronized
65
this.assertSynchronized
67
this.classUnderTest.toArray
72
def toArray_with_target_synchronized
74
this.assertSynchronized
76
val array: Array[String] = null
77
this.classUnderTest.toArray(array)
84
this.assertSynchronized
86
this.classUnderTest.add("")
91
def remove_synchronized
93
this.assertSynchronized
95
this.classUnderTest.remove("")
100
def containsAll_synchronized
102
this.assertSynchronized
104
this.classUnderTest.containsAll(FastList.newList[String])
109
def addAll_synchronized
111
this.assertSynchronized
113
this.classUnderTest.addAll(FastList.newList[String])
118
def removeAll_synchronized
120
this.assertSynchronized
122
this.classUnderTest.removeAll(FastList.newList[String])
127
def retainAll_synchronized
129
this.assertSynchronized
131
this.classUnderTest.retainAll(FastList.newList[String])
136
def clear_synchronized
138
this.assertSynchronized
140
this.classUnderTest.clear()
145
def equals_synchronized
147
this.assertNotSynchronized
149
this.classUnderTest.equals(null)
154
def hashCode_synchronized
156
this.assertNotSynchronized
158
this.classUnderTest.hashCode