本文整理汇总了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) {
}
}
示例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");
}
}
示例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) {
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}
示例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");
}
}