本文整理匯總了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");
}
}