//如何在JUnit中为这个类编写单元测试......
package com.emr.common.helper;
import java.util.Random;
public class RandomTextGenerator {
public static String getAutogenerateText()
{
/*Auto genarate password */
String password = "";
/* Create Auto Password */
int count = 36;
// int range = Integer.MAX_VALUE;
int sum = 0;
Random rand = new Random();
for (int j = 0; j < 45; j++) {
for (int i = 0; i < count; i++) {
sum = rand.nextInt(count);
}
char[] pass = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9' };
password = password + pass[sum];
}
return password;
}
}