2 * Copyright (c) 2014, 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package test.mock.util;
10 import java.util.Random;
11 import java.util.concurrent.atomic.AtomicLong;
13 public class TestUtils {
15 private static AtomicLong transId = new AtomicLong();
17 private static Random rnd = new Random();
19 public static long nextLong(long RangeBottom, long rangeTop) {
20 return RangeBottom + ((long)(rnd.nextDouble()*(rangeTop - RangeBottom)));
23 public static long getNewTransactionId() {
24 return transId.incrementAndGet();