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 2121import xbean .scomp .substGroup .deep .*;
2222
2323import java .math .BigInteger ;
24+ import java .util .ArrayList ;
2425
2526import static org .junit .jupiter .api .Assertions .*;
2627import static scomp .common .BaseCase .createOptions ;
@@ -147,4 +148,25 @@ void testValidSubstBuild() throws Throwable {
147148 items .setProductArray (new ProductType []{bShirt , shirt , genericProd });
148149 assertTrue (doc .validate (createOptions ()));
149150 }
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+
150172}
You can’t perform that action at this time.
0 commit comments