当前位置: 首页>>代码示例>>Java>>正文


Java S.random方法代码示例

本文整理汇总了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;
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:8,代码来源:Address.java

示例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]);
    }
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:8,代码来源:Gh251Model.java

示例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);
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:8,代码来源:ExcelTest.java

示例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();
}
 
开发者ID:actframework,项目名称:actframework,代码行数:10,代码来源:Person2.java

示例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);
}
 
开发者ID:actframework,项目名称:actframework,代码行数:12,代码来源:StringSecureTicketCodecTest.java

示例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;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:16,代码来源:ContentSuffixSensor.java

示例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);
    }
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:11,代码来源:SftpTest.java

示例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));
    }
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:12,代码来源:SftpTest.java

示例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));
    }
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:15,代码来源:SftpTest.java

示例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));
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:9,代码来源:SftpTest.java

示例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));
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:9,代码来源:SftpTest.java

示例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);
    }
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:33,代码来源:SftpTest.java

示例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);
    }
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:13,代码来源:SftpTest.java

示例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);
    }
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:13,代码来源:SftpTest.java

示例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);
    }
}
 
开发者ID:osglworks,项目名称:java-sftp,代码行数:14,代码来源:SftpTest.java


注:本文中的org.osgl.util.S.random方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。