@BeforeExperiment void setUp() { testBytes = new byte[size]; random.nextBytes(testBytes); }
@BeforeExperiment public void setUp() throws Exception { xmlSmall = loadResource("small.xml"); xmlMedium = loadResource("medium.xml"); }
@BeforeExperiment void setUp() throws Exception { Random rng = new Random(); for (int i = 0; i < 0x100; i++) { Integer[] array = new Integer[n]; for (int j = 0; j < n; j++) { array[j] = rng.nextInt(); } inputArrays[i] = array; } }
@BeforeExperiment void setUp() { testBytes = new byte[size]; new Random(RANDOM_SEED).nextBytes(testBytes); }
@BeforeExperiment void setUp() { Random rng = new Random(); for (int i = 0; i < 0x100; i++) { values[i] = new double[n]; for (int j = 0; j < n; j++) { values[i][j] = rng.nextDouble(); } } }
@BeforeExperiment void setUp() { testBytes = new byte[size]; new Random(RANDOM_SEED).nextBytes(testBytes); }
@BeforeExperiment void setUp() { Random rng = new Random(); for (int i = 0; i < 0x100; i++) { datasets[i] = new double[datasetSize]; for (int j = 0; j < datasetSize; j++) { datasets[i][j] = rng.nextDouble(); } } }
@BeforeExperiment public void setUp() throws Exception { xmlSmall = loadResource("small.xml"); xmlMedium = loadResource("medium.xml"); }
@BeforeExperiment void setUp() { for (int i = 0; i < ARRAY_SIZE; i++) { factorials[i] = RANDOM_SOURCE.nextInt(factorialBound); slowFactorials[i] = RANDOM_SOURCE.nextInt(factorialBound); binomials[i] = RANDOM_SOURCE.nextInt(factorials[i] + 1); } }
@BeforeExperiment void setUp() { collection = source.supplier.get(); for (int i = 0; i < size; i++) { collection.add(new Object()); } }
@BeforeExperiment public void setUp() { Random rng = new Random(); for (int i = 0; i < encodingInputs.length; i++) { encodingInputs[i] = new byte[n]; rng.nextBytes(encodingInputs[i]); decodingInputs[i] = encoding.encoding.encode(encodingInputs[i]); } }
@BeforeExperiment void setUp() { map.put(TEST_KEY, TEST_VALUE); cache.put(TEST_KEY, TEST_VALUE); cacheNoStats.put(TEST_KEY, TEST_VALUE); }
@BeforeExperiment void setUp() { String component = Strings.repeat("a", componentLength); String[] raw = new String[count]; Arrays.fill(raw, component); components = Arrays.asList(raw); }
@BeforeExperiment void setUp() { array = new Object[size]; arrayList = Lists.newArrayListWithCapacity(size); linkedList = Lists.newLinkedList(); for (int i = 0; i < size; i++) { Object value = new Object(); array[i] = value; arrayList.add(value); linkedList.add(value); } }
@BeforeExperiment @SuppressWarnings("unchecked") void setUp() throws Exception { String prefix = (useMonitor ? "com.google.common.util.concurrent.MonitorBased" : "java.util.concurrent."); String className = prefix + queueType + "BlockingQueue"; Constructor<?> constructor = Class.forName(className).getConstructor(int.class); queue = (BlockingQueue<String>) constructor.newInstance(capacity); strings = new String[capacity]; for (int i = 0; i < capacity; i++) { strings[i] = String.valueOf(Math.random()); } }
@BeforeExperiment void setUp() { Random random = new Random(); multisets.clear(); for (int i = 0; i < ARRAY_SIZE; i++) { HashMultiset<Integer> multiset = HashMultiset.<Integer>create(); multisets.add(multiset); queries[i] = random.nextInt(); multiset.add(queries[i]); } }
@BeforeExperiment void setUp() throws Exception { if (state != State.NOT_DONE && (numListeners != 0 || numThreads != 0)) { throw new SkipThisScenarioException(); } }
@BeforeExperiment void setUp() { checkArgument(size > 0, "empty collection not supported"); Set<Integer> set = new LinkedHashSet<>(size); Random random = new Random(); while (set.size() < size) { set.add(random.nextInt()); } List<Integer> list = new ArrayList<>(set); inputOrder.arrange(list); input = ImmutableList.copyOf(list); }
@BeforeExperiment public void setUp() { // precalculate some random strings of ascii characters. StringBuilder sb = new StringBuilder(); Random random = new Random(0xdeadbeef); // for unpredictable but reproducible behavior sb.ensureCapacity(size); for (int k = 0; k < size; k++) { // [9-127) includes all ascii non-control characters sb.append((char) (random.nextInt(127 - 9) + 9)); } data = sb.toString(); }
@BeforeExperiment void setUp() throws Exception { multiset = implSupplier.get(); ImmutableList.Builder<Integer> builder = ImmutableList.builder(); for (int i = 0; i < size; i++) { builder.add(i); } keys = builder.build(); threadPool = Executors.newFixedThreadPool(threads, new ThreadFactoryBuilder().setDaemon(true).build()); }