Home | History | Annotate | Download | only in cts

Lines Matching refs:ws

57         WorkSource ws = new WorkSource();
59 wsAdd(ws, uids[i]);
61 checkWorkSource("Constructed", ws, uids);
62 return ws;
67 WorkSource ws = new WorkSource();
69 wsAdd(ws, uids[i], names[i]);
71 checkWorkSource("Constructed", ws, uids, names);
72 return ws;
75 private boolean wsAdd(WorkSource ws, int uid) throws IllegalArgumentException,
78 return (Boolean)mAddUid.invoke(ws, mAddUidArgs);
81 private boolean wsAdd(WorkSource ws, int uid, String name) throws IllegalArgumentException,
85 return (Boolean)mAddUidName.invoke(ws, mAddUidNameArgs);
88 private WorkSource wsAddReturningNewbs(WorkSource ws, WorkSource other) throws IllegalArgumentException,
91 return (WorkSource)mAddReturningNewbs.invoke(ws, mAddReturningNewbsArgs);
94 private WorkSource[] wsSetReturningDiffs(WorkSource ws, WorkSource other) throws IllegalArgumentException,
97 return (WorkSource[])mSetReturningDiffs.invoke(ws, mSetReturningDiffsArgs);
113 private void failWorkSource(String op, WorkSource ws, int[] uids) {
119 sb.append(ws);
123 private void failWorkSource(String op, WorkSource ws, int[] uids, String[] names) {
129 sb.append(ws);
133 private void checkWorkSource(String op, WorkSource ws, int[] uids) {
134 if (ws == null || uids == null) {
135 if (ws != null) {
136 fail(op + ": WorkSource is not null " + ws +", but expected null");
143 if (ws.size() != uids.length) {
144 failWorkSource(op, ws, uids);
147 if (uids[i] != ws.get(i)) {
148 failWorkSource(op, ws, uids);
153 private void checkWorkSource(String op, WorkSource ws, int[] uids, String[] names) {
154 if (ws == null || uids == null) {
155 if (ws != null) {
156 fail(op + ": WorkSource is not null " + ws +", but expected null");
163 if (ws.size() != uids.length) {
164 failWorkSource(op, ws, uids, names);
167 if (uids[i] != ws.get(i) || !names[i].equals(ws.getName(i))) {
168 failWorkSource(op, ws, uids, names);
182 WorkSource ws = wsNew(1);
183 wsAdd(ws, 2);
184 checkWorkSource("First", ws, new int[] { 1 , 2 });
185 wsAdd(ws, 20);
186 checkWorkSource("Second", ws, new int[] { 1 , 2, 20 });
187 wsAdd(ws, 100);
188 checkWorkSource("Third", ws, new int[] { 1, 2, 20, 100 });
192 WorkSource ws = wsNew(100);
193 wsAdd(ws, 20);
194 checkWorkSource("First", ws, new int[] { 20, 100 });
195 wsAdd(ws, 2);
196 checkWorkSource("Second", ws, new int[] { 2, 20, 100 });
197 wsAdd(ws, 1);
198 checkWorkSource("Third", ws, new int[] { 1, 2, 20, 100 });
202 WorkSource ws = wsNew(10);
203 wsAdd(ws, 2);
204 checkWorkSource("First", ws, new int[] { 2, 10 });
205 wsAdd(ws, 5);
206 checkWorkSource("Second", ws, new int[] { 2, 5, 10 });
207 wsAdd(ws, 1);
208 checkWorkSource("Third", ws, new int[] { 1, 2, 5, 10 });
209 wsAdd(ws, 100);
210 checkWorkSource("Fourth", ws, new int[] { 1, 2, 5, 10, 100 });
214 WorkSource ws = wsNew(1);
215 ws.add(wsNew(2));
216 checkWorkSource("First", ws, new int[] { 1 , 2 });
217 ws.add(wsNew(20));
218 checkWorkSource("Second", ws, new int[] { 1 , 2, 20 });
219 ws.add(wsNew(100));
220 checkWorkSource("Third", ws, new int[] { 1 , 2, 20, 100 });
224 WorkSource ws = wsNew(100);
225 ws.add(wsNew(20));
226 checkWorkSource("First", ws, new int[] { 20, 100 });
227 ws.add(wsNew(2));
228 checkWorkSource("Second", ws, new int[] { 2, 20, 100 });
229 ws.add(wsNew(1));
230 checkWorkSource("Third", ws, new int[] { 1, 2, 20, 100 });
234 WorkSource ws = wsNew(10);
235 ws.add(wsNew(2));
236 checkWorkSource("First", ws, new int[] { 2, 10 });
237 ws.add(wsNew(5));
238 checkWorkSource("Second", ws, new int[] { 2, 5, 10 });
239 ws.add(wsNew(1));
240 checkWorkSource("Third", ws, new int[] { 1, 2, 5, 10 });
241 ws.add(wsNew(100));
242 checkWorkSource("Fourth", ws, new int[] { 1, 2, 5, 10, 100 });