File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/test/java/scomp/substGroup/detailed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 21
21
import xbean .scomp .substGroup .deep .*;
22
22
23
23
import java .math .BigInteger ;
24
+ import java .util .ArrayList ;
24
25
25
26
import static org .junit .jupiter .api .Assertions .*;
26
27
import static scomp .common .BaseCase .createOptions ;
@@ -147,4 +148,25 @@ void testValidSubstBuild() throws Throwable {
147
148
items .setProductArray (new ProductType []{bShirt , shirt , genericProd });
148
149
assertTrue (doc .validate (createOptions ()));
149
150
}
151
+
152
+ @ Test
153
+ void testInsertAndDeleteMany () throws Throwable {
154
+ final int size = 100 ;
155
+ ItemsDocument doc = ItemsDocument .Factory .newInstance ();
156
+ ItemType items = doc .addNewItems ();
157
+ ShirtType [] shirts = new ShirtType [size ];
158
+ for (int i = 0 ; i < size ; i ++) {
159
+ ShirtType shirt = ShirtType .Factory .newInstance ();
160
+ shirt .setName ("Funny Shirt " + i );
161
+ shirt .setNumber ("SKU" + i );
162
+ shirt .setColor ("green" );
163
+ shirt .setSize (BigInteger .TEN );
164
+ shirts [i ] = shirt ;
165
+ }
166
+ items .setProductArray (shirts );
167
+ assertEquals (size , items .getProductArray ().length );
168
+ items .setProductArray (new ProductType [0 ]);
169
+ assertEquals (0 , items .getProductArray ().length );
170
+ }
171
+
150
172
}
You can’t perform that action at this time.
0 commit comments