本文整理汇总了Java中org.osgl.util.S.random方法的典型用法代码示例。如果您正苦于以下问题:Java S.random方法的具体用法?Java S.random怎么用?Java S.random使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osgl.util.S
的用法示例。
在下文中一共展示了S.random方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: random
import org.osgl.util.S; //导入方法依赖的package包/类
public static Address random() {
Address addr = new Address();
addr.state = $.random("NSW", "VIC", "QLD", "WA");
addr.street = S.random(N.randInt(14) + 6);
addr.suburb = $.random("Cherrybrook", "Sutherland", "Kogarah", "Chatswood", "Burwood", "Liverpool");
return addr;
}
示例2: Gh251Model
import org.osgl.util.S; //导入方法依赖的package包/类
public Gh251Model() {
this.name = S.random();
this.locale = Locale.CHINA;
if ($.random(true, false)) {
this.foos = C.list(new Foo(), new Foo()).toArray(new Foo[2]);
}
}
示例3: testExcel
import org.osgl.util.S; //导入方法依赖的package包/类
@GetAction("/excel/test")
@TemplateContext("report")
public Result testExcel(ActionContext context) {
User user = new User(S.random());
context.param("filename", user.name + ".xls");
return render("user", user);
}
示例4: Person2
import org.osgl.util.S; //导入方法依赖的package包/类
public Person2(String fn, String ln, Address2 addr, Integer age, Gender gender) {
firstName = fn;
lastName = ln;
address = addr;
this.age = age;
this.gender = gender;
this.height = 178;
v1 = S.random();
}
示例5: test
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void test() {
H.Session session = new H.Session();
String foo = S.random();
session.put("foo", foo);
prepareSession(session);
StringSecureTicketCodec codec = codec();
String ticket = codec.createTicket(session);
H.Session session2 = codec.parseTicket(ticket);
verifySession(session, session2);
}
示例6: prepareUrlList
import org.osgl.util.S; //导入方法依赖的package包/类
private static List<String> prepareUrlList() {
final int size = 100;
List<String> suffixes = C.listOf(".json,/json,.xml,/xml,.csv,/csv".split(","));
if (null == generated) {
generated = new ArrayList<String>(size);
for (int i = 0; i < size; ++i) {
String url = S.random(30 + N.randInt(40));
if (i % 2 == 0) {
url += $.random(suffixes);
}
generated.add(url);
}
}
return generated;
}
示例7: testFileExists
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void testFileExists() {
final String path = "/test" + S.random();
sftp.put(path, "ABC");
try {
yes(sftp.exists(path));
} finally {
sftp.rm(path);
}
}
示例8: testPutRemove
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void testPutRemove() {
final String path = "test" + S.random();
sftp.put(path, "ABC");
try {
yes(sftp.exists(path));
} finally {
sftp.rm(path);
no(sftp.exists(path));
}
}
示例9: testPutGetRemove
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void testPutGetRemove() {
final String path = "test" + S.random();
sftp.put(path, "ABC");
try {
yes(sftp.exists(path));
SObject sobj = sftp.get(path);
assertNotNull(sobj);
eq(sobj.asString(), "ABC");
} finally {
sftp.rm(path);
no(sftp.exists(path));
}
}
示例10: testCheckNonExistingFileAndThenPut
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void testCheckNonExistingFileAndThenPut() {
no(sftp.exists("/nonexisting" + S.random()));
final String path = "test" + S.random();
sftp.put(path, "ABC");
sftp.rm(path);
no(sftp.exists(path));
}
示例11: testMkdir
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void testMkdir() {
final String path = "dtest" + S.random();
yes(sftp.mkdir(path));
yes(sftp.exists(path));
sftp.rmdir(path);
no(sftp.exists(path));
}
示例12: testMove
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void testMove() {
final String srcPath = "spath" + S.random();
final String src = srcPath + "/stest" + S.random();
final String destPath = "dtest" + S.random();
final String dest = destPath + "/dtest" + S.random();
sftp.mkdir(srcPath);
try {
sftp.put(src, "ABC");
try {
sftp.mkdir(destPath);
try {
no(sftp.exists(dest));
sftp.move(src, dest);
no(sftp.exists(src));
yes(sftp.exists(dest));
sftp.rm(dest);
} finally {
sftp.rmdir(destPath);
}
} finally {
try {
sftp.rm(src);
} catch (RuntimeException e) {
// ignore
}
}
} finally {
sftp.rmdir(srcPath);
}
}
示例13: testPutOverwrite
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void testPutOverwrite() {
final String path = "test" + S.random();
sftp.put(path, "ABC");
try {
eq("ABC", sftp.get(path).asString());
sftp.put(path, "XYZ");
eq("XYZ", sftp.get(path).asString());
} finally {
sftp.rm(path);
}
}
示例14: testPutAppend
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
public void testPutAppend() {
final String path = "test" + S.random();
sftp.put(path, "ABC");
try {
eq("ABC", sftp.get(path).asString());
sftp.put(path, "XYZ", Put.Mode.APPEND);
eq("ABCXYZ", sftp.get(path).asString());
} finally {
sftp.rm(path);
}
}
示例15: testPutResume
import org.osgl.util.S; //导入方法依赖的package包/类
@Test
@Ignore("resume is not testable for the moment")
public void testPutResume() {
final String path = "test" + S.random();
sftp.put(path, "ABC");
try {
eq("ABC", sftp.get(path).asString());
sftp.put(path, "XYZ", Put.Mode.RESUME);
eq("ABCXYZ", sftp.get(path).asString());
} finally {
sftp.rm(path);
}
}