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


Java RandomImpl类代码示例

本文整理汇总了Java中org.apache.harmony.security.tests.support.RandomImpl的典型用法代码示例。如果您正苦于以下问题:Java RandomImpl类的具体用法?Java RandomImpl怎么用?Java RandomImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RandomImpl类属于org.apache.harmony.security.tests.support包,在下文中一共展示了RandomImpl类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testNewInstance

import org.apache.harmony.security.tests.support.RandomImpl; //导入依赖的package包/类
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "newInstance",
    args = {java.lang.Object.class}
)
public void testNewInstance() throws Exception {
    Provider p = new MyProvider();
    Provider.Service s = new Provider.Service(p, "SecureRandom",
            "algorithm",
            "org.apache.harmony.security.tests.support.RandomImpl",
            null, null);

    Object o = s.newInstance(null);
    assertTrue("incorrect instance", o instanceof RandomImpl);

    try {
        o = s.newInstance(new Object());
        fail("No expected NoSuchAlgorithmException");
    } catch (NoSuchAlgorithmException e) {
    }

}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:24,代码来源:ProviderServiceTest.java

示例2: testSecureRandombyteArray

import org.apache.harmony.security.tests.support.RandomImpl; //导入依赖的package包/类
@TestTargetNew(
    level = TestLevel.PARTIAL,
    notes = "Null parameter checking missed",
    method = "SecureRandom",
    args = {byte[].class}
)
public final void testSecureRandombyteArray() {
    byte[] b = {1,2,3};
    new SecureRandom(b);

    if (!RandomImpl.runEngineSetSeed) {
        fail("No setSeed");
    }


}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:17,代码来源:SecureRandomTest.java

示例3: testNewInstance

import org.apache.harmony.security.tests.support.RandomImpl; //导入依赖的package包/类
public void testNewInstance() throws NoSuchAlgorithmException {
    Provider p = new MyProvider();
    Provider.Service s = new Provider.Service(p, "SecureRandom",
            "algorithm",
            "org.apache.harmony.security.tests.support.RandomImpl",
            null, null);

    Object o = s.newInstance(null);
    assertTrue("incorrect instance", o instanceof RandomImpl);
    
    try {
        o = s.newInstance(new Object());
        fail("No expected NoSuchAlgorithmException");
    } catch (NoSuchAlgorithmException e) {
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:ProviderServiceTest.java

示例4: testSetSeedlong

import org.apache.harmony.security.tests.support.RandomImpl; //导入依赖的package包/类
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "",
    method = "setSeed",
    args = {long.class}
)
public final void testSetSeedlong() {
    SecureRandom sr = new SecureRandom();
    sr.setSeed(12345);
    if (!RandomImpl.runEngineSetSeed) {
        fail("setSeed failed");
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:14,代码来源:SecureRandomTest.java

示例5: testSetSeedbyteArray

import org.apache.harmony.security.tests.support.RandomImpl; //导入依赖的package包/类
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "Verification with null parameter missed",
    method = "setSeed",
    args = {byte[].class}
)
public final void testSetSeedbyteArray() {
    byte[] b = {1,2,3};
    SecureRandom sr = new SecureRandom();
    sr.setSeed(b);
    if (!RandomImpl.runEngineSetSeed) {
        fail("setSeed failed");
    }

}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:16,代码来源:SecureRandomTest.java

示例6: testSetSeedlong

import org.apache.harmony.security.tests.support.RandomImpl; //导入依赖的package包/类
public final void testSetSeedlong() {
	SecureRandom sr = new SecureRandom();
	sr.setSeed(12345);
	if (!RandomImpl.runEngineSetSeed) {
		fail("setSeed failed");
	}	
}
 
开发者ID:shannah,项目名称:cn1,代码行数:8,代码来源:SecureRandomTest.java

示例7: testSecureRandombyteArray

import org.apache.harmony.security.tests.support.RandomImpl; //导入依赖的package包/类
public final void testSecureRandombyteArray() {
	byte[] b = {1,2,3};
	new SecureRandom(b);
	if (!RandomImpl.runEngineSetSeed) {
		fail("No setSeed");
	}
}
 
开发者ID:shannah,项目名称:cn1,代码行数:8,代码来源:SecureRandomTest.java

示例8: testSetSeedbyteArray

import org.apache.harmony.security.tests.support.RandomImpl; //导入依赖的package包/类
public final void testSetSeedbyteArray() {
	byte[] b = {1,2,3};
	SecureRandom sr = new SecureRandom();
	sr.setSeed(b);
	if (!RandomImpl.runEngineSetSeed) {
		fail("setSeed failed");
	}
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:SecureRandomTest.java


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