use of org.junit.jupiter.params.provider.ValueSource in project keystore-explorer by kaikramer.
the class KeyPairUtilTest method generateEcKeys.
@ParameterizedTest
@ValueSource(strings = { // NIST curves
"B-163", "B-233", "B-283", "B-409", "B-571", "K-163", "K-233", "K-283", "K-409", "K-571", "P-192", "P-224", "P-256", "P-384", "P-521", // SEC curves
"secp112r1", "secp112r2", "secp128r1", "secp128r2", "secp160k1", "secp160r1", "secp160r2", "secp192k1", "secp192r1", "secp224k1", "secp224r1", "secp256k1", "secp256r1", "secp384r1", "secp521r1", "sect113r1", "sect113r2", "sect131r1", "sect131r2", "sect163k1", "sect163r1", "sect163r2", "sect193r1", "sect193r2", "sect233k1", "sect233r1", "sect239k1", "sect283k1", "sect283r1", "sect409k1", "sect409r1", "sect571k1", "sect571r1", // ANSI X9.62 curves
"prime192v1", "prime192v2", "prime192v3", "prime239v1", "prime239v2", "prime239v3", "prime256v1", "c2pnb163v1", "c2pnb163v2", "c2pnb163v3", "c2pnb176w1", "c2tnb191v1", "c2tnb191v2", "c2tnb191v3", "c2tnb239v1", "c2tnb239v2", "c2tnb239v3", "c2tnb359v1", "c2tnb431r1", "c2pnb208w1", "c2pnb272w1", "c2pnb304w1", "c2pnb368w1", // Brainpool curves
"brainpoolP160r1", "brainpoolP160t1", "brainpoolP192r1", "brainpoolP192t1", "brainpoolP224r1", "brainpoolP224t1", "brainpoolP256r1", "brainpoolP256t1", "brainpoolP320r1", "brainpoolP320t1", "brainpoolP384r1", "brainpoolP384t1", "brainpoolP512r1", "brainpoolP512t1" })
public void generateEcKeys(String curveName) throws Exception {
KeyPair keyPair = KeyPairUtil.generateECKeyPair(curveName, BC);
assertTrue(KeyPairUtil.validKeyPair(keyPair.getPrivate(), keyPair.getPublic()));
}
use of org.junit.jupiter.params.provider.ValueSource in project sonar-go by SonarSource.
the class UastTest method parse_null_and_empty.
@ParameterizedTest
@ValueSource(strings = { "{}", "{ kinds: [], nativeNode: null, token: null, children: null, unknownElement: {} }", "{ kinds: [], nativeNode: '', token: null, children: [] }" })
void parse_null_and_empty(String json) throws Exception {
Supplier<String> message = () -> "Assertion error for " + json;
UastNode node = Uast.from(new StringReader(json));
assertEquals(Collections.emptySet(), node.kinds, message);
assertEquals("", node.nativeNode, message);
assertNull(node.token, message);
assertEquals(Collections.emptyList(), node.children, message);
}
use of org.junit.jupiter.params.provider.ValueSource in project harvest-client by 3AP-AG.
the class ExpensesApiCreateTest method attachReceiptException.
@ParameterizedTest
@ValueSource(strings = { "mp3.mp3" })
void attachReceiptException(String filename) throws IOException {
try (InputStream in = getClass().getResourceAsStream("/minimal_files/" + filename)) {
Expense creationInfo = ImmutableExpense.builder().project(project).expenseCategory(expenseCategory).spentDate(LocalDate.now()).user(user).totalCost(22.).build();
expense = expensesApi.create(creationInfo);
assertThrows(RequestProcessingException.class, () -> expense = expensesApi.attachReceipt(expense, in, filename));
}
}
use of org.junit.jupiter.params.provider.ValueSource in project narchy by automenta.
the class NAL7Test method induction_on_events_composition_post.
@ValueSource(ints = { 0, 1, 2, 3, 4 })
@ParameterizedTest
public void induction_on_events_composition_post(int dt) {
TestNAR tester = test;
int t = 0;
String component = "(open(John,door) &| hold(John,key))";
tester.inputAt(t, component + ". :|:");
tester.inputAt(t + dt, "enter(John,room). :|:");
tester.mustBelieve((2 * (t + Math.max(2, dt)) + Math.max(2, dt) + 1), /**
* approx
*/
"(" + component + " ==>+" + dt + " enter(John,room))", 1.00f, 0.45f, t);
}
use of org.junit.jupiter.params.provider.ValueSource in project logging-log4j2 by apache.
the class JsonTemplateLayoutConcurrentEncodeTest method test_concurrent_encode.
@ParameterizedTest
@ValueSource(strings = { "dummy", "threadLocal", "queue:supplier=java.util.concurrent.ArrayBlockingQueue.new", "queue:supplier=org.jctools.queues.MpmcArrayQueue.new" })
void test_concurrent_encode(final String recyclerFactory) throws IOException {
final Path appenderFilepath = createAppenderFilepath(recyclerFactory);
final int workerCount = 10;
final int messageLength = 1_000;
final int messageCount = 1_000;
try {
withContextFromTemplate(appenderFilepath, recyclerFactory, loggerContext -> {
final Logger logger = loggerContext.getLogger(JsonTemplateLayoutConcurrentEncodeTest.class);
runWorkers(workerCount, messageLength, messageCount, logger);
});
verifyLines(appenderFilepath, messageLength, workerCount * messageCount);
} catch (final Throwable error) {
final String message = String.format("test failure for appender pointing to file: `%s`", appenderFilepath);
throw new AssertionError(message, error);
}
Files.delete(appenderFilepath);
}
Aggregations