當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。