focal_method
stringlengths
13
60.9k
test_case
stringlengths
25
109k
@Override public T build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(requireNonNull(path))) { final JsonNode node = mapper.readTree(createParser(input)); if (node == null) { th...
@Test void handlesArrayOverrideEscaped() throws Exception { System.setProperty("dw.type", "coder,wizard,overr\\,idden"); final Example example = factory.build(configurationSourceProvider, validFile); assertThat(example.getType()) .hasSize(3) .element(2) .i...
public static Autoscaling empty() { return empty(""); }
@Test public void test_autoscaling_in_dev_with_required_unspecified_resources_preprovisioned() { var requiredCapacity = Capacity.from(new ClusterResources(1, 1, NodeResources.unspecified()), new ClusterResources(3, 1, NodeResources.unspecified()), ...
@Override public void loginFailure(HttpRequest request, AuthenticationException e) { checkRequest(request); requireNonNull(e, "AuthenticationException can't be null"); if (!LOGGER.isDebugEnabled()) { return; } Source source = e.getSource(); LOGGER.debug("login failure [cause|{}][method|{...
@Test public void login_failure_creates_DEBUG_log_with_empty_cause_if_AuthenticationException_has_no_message() { AuthenticationException exception = newBuilder().setSource(Source.sso()).setLogin("FoO").build(); underTest.loginFailure(mockRequest(), exception); verifyLog("login failure [cause|][method|SSO...
abstract HttpTracing httpTracing(ApplicationContext ctx);
@Test void WebMvc31_httpTracing_byType() { ApplicationContext context = mock(ApplicationContext.class); new WebMvc31().httpTracing(context); verify(context).getBean(HttpTracing.class); verifyNoMoreInteractions(context); }
@Deprecated public static String getJwt(JwtClaims claims) throws JoseException { String jwt; RSAPrivateKey privateKey = (RSAPrivateKey) getPrivateKey( jwtConfig.getKey().getFilename(),jwtConfig.getKey().getPassword(), jwtConfig.getKey().getKeyName()); // A JWT is a JWS and/...
@Test public void GroupToRoleAccessControlWrong() throws Exception { JwtClaims claims = ClaimsUtil.getTestClaimsGroup("stevehu", "EMPLOYEE", "f7d42348-c647-4efb-a52d-4c5787421e72", Arrays.asList("portal.r", "portal.w"), "User_API_Wrong"); claims.setExpirationTimeMinutesInTheFuture(5256000); ...
@Override public ExecuteContext before(ExecuteContext context) throws Exception { final FlowControlConfig pluginConfig = PluginConfigManager.getPluginConfig(FlowControlConfig.class); FlowControlServiceMeta.getInstance().setDubboService(true); if (!pluginConfig.isUseCseRule() || !pluginConfig...
@Test public void testClose() throws Exception { final AbstractInterceptor interceptor = getInterceptor(); interceptor.before(buildContext()); assertNull(FlowControlServiceMeta.getInstance().getVersion()); }
static SortKey[] rangeBounds( int numPartitions, Comparator<StructLike> comparator, SortKey[] samples) { // sort the keys first Arrays.sort(samples, comparator); int numCandidates = numPartitions - 1; SortKey[] candidates = new SortKey[numCandidates]; int step = (int) Math.ceil((double) sample...
@Test public void testRangeBoundsDivisible() { assertThat( SketchUtil.rangeBounds( 3, SORT_ORDER_COMPARTOR, new SortKey[] { CHAR_KEYS.get("a"), CHAR_KEYS.get("b"), CHAR_KEYS.get("c"), ...
@Override public ResultSet executeQuery(String sql) throws SQLException { validateState(); try { if (!DriverUtils.queryContainsLimitStatement(sql)) { sql += " " + LIMIT_STATEMENT + " " + _maxRows; } String enabledSql = DriverUtils.enableQueryOptions(sql, _connection.getQueryOpt...
@Test public void testSetUseMultistageEngine() throws Exception { Properties props = new Properties(); props.put(QueryOptionKey.USE_MULTISTAGE_ENGINE, "true"); PinotConnection pinotConnection = new PinotConnection(props, "dummy", _dummyPinotClientTransport, "dummy", _dummyPinotControllerTran...
@Subscribe public void onMenuOptionClicked(MenuOptionClicked e) { if (!isCompostAction(e)) { return; } ObjectComposition patchDef = client.getObjectDefinition(e.getId()); WorldPoint actionLocation = WorldPoint.fromScene(client, e.getParam0(), e.getParam1(), client.getPlane()); FarmingPatch targetPatch...
@Test public void onMenuOptionClicked_queuesPendingCompostForInspectActions() { MenuOptionClicked inspectPatchAction = mock(MenuOptionClicked.class); when(inspectPatchAction.getMenuAction()).thenReturn(MenuAction.GAME_OBJECT_SECOND_OPTION); when(inspectPatchAction.getMenuOption()).thenReturn("Inspect"); when(...
@Override public LookupResult lookupResource(Method method, String path, String action) { List<PathItem> pathItems = new ArrayList<>(); final int l = path.length(); int s = 0, pos = 0; while (pos < l) { char ch = path.charAt(pos); if (ch == '/') { if (pos == 0) {...
@Test public void testLookupHandler() { registerHandler("root", "CompaniesHandler", "/companies", "/companies/{company}", "/companies/{company}/{id}"); registerHandler("root", "StocksHandler", "/stocks/{stock}", "/stocks/{stock}/{currency}"); registerHandler("root", "DirectorsHandler", "/directors"...
@Override public int rpcPortOffset() { return Integer.parseInt(System.getProperty(GrpcConstants.NACOS_SERVER_GRPC_PORT_OFFSET_KEY, String.valueOf(Constants.SDK_GRPC_PORT_DEFAULT_OFFSET))); }
@Test void testRpcPortOffsetFromSystemProperty() { System.setProperty(GrpcConstants.NACOS_SERVER_GRPC_PORT_OFFSET_KEY, "10000"); grpcSdkClient = new GrpcSdkClient("test", 8, 8, Collections.emptyMap()); assertEquals(10000, grpcSdkClient.rpcPortOffset()); }
@Override public Stream<HoodieInstant> getCandidateInstants(HoodieTableMetaClient metaClient, HoodieInstant currentInstant, Option<HoodieInstant> lastSuccessfulInstant) { HoodieActiveTimeline activeTimeline = metaClient.reloadActiveTimeline(); if (Clustering...
@Test public void testConcurrentWritesWithInterleavingScheduledCluster() throws Exception { createCommit(metaClient.createNewInstantTime(), metaClient); HoodieActiveTimeline timeline = metaClient.getActiveTimeline(); // consider commits before this are all successful Option<HoodieInstant> lastSuccessf...
public static ImmutableList<HttpRequest> fuzzGetParametersWithDefaultParameter( HttpRequest request, String payload, String defaultParameter) { return fuzzGetParameters(request, payload, Optional.of(defaultParameter), ImmutableSet.of()); }
@Test public void fuzzGetParametersWithDefaultParameter_whenGetParameters_doesNotAddDefaultParameter() { HttpRequest requestWithDefaultParameter = HttpRequest.get("https://google.com?default=<payload>").withEmptyHeaders().build(); assertThat( FuzzingUtils.fuzzGetParametersWithDefaultParam...
@Override public void run() { // top-level command, do nothing }
@Test public void test_listJobs_dirtyName() { // Given String jobName = "job\n\tname\u0000"; Job job = newJob(jobName); // When run("list-jobs"); // Then String actual = captureOut(); assertContains(actual, jobName); assertContains(actual, jo...
@Override public boolean add(String str) { boolean flag = false; for (BloomFilter filter : filters) { flag |= filter.add(str); } return flag; }
@Test @Disabled public void testLongMap(){ LongMap longMap = new LongMap(); for (int i = 0 ; i < 64; i++) { longMap.add(i); } longMap.remove(30); for (int i = 0; i < 64; i++) { System.out.println(i + "是否存在-->" + longMap.contains(i)); } }
CacheConfig<K, V> asCacheConfig() { return this.copy(new CacheConfig<>(), false); }
@Test public void serializationSucceeds_whenValueTypeNotResolvable() { PreJoinCacheConfig preJoinCacheConfig = new PreJoinCacheConfig(newDefaultCacheConfig("test")); preJoinCacheConfig.setKeyClassName("java.lang.String"); preJoinCacheConfig.setValueClassName("some.inexistent.Class"); ...
public boolean send(TransferableBlock block) throws Exception { if (block.isErrorBlock()) { // Send error block to all mailboxes to propagate the error for (SendingMailbox sendingMailbox : _sendingMailboxes) { sendBlock(sendingMailbox, block); } return false; } if (blo...
@Test public void shouldSignalEarlyTerminationProperly() throws Exception { // Given: List<SendingMailbox> destinations = ImmutableList.of(_mailbox1, _mailbox2); BlockExchange exchange = new TestBlockExchange(destinations); TransferableBlock block = new TransferableBlock(ImmutableList.of(new Obj...
public static String printUnitFromBytesDot(long bytes) { return printUnitFromBytes(bytes, '.'); }
@Test public void testPrintUnitFromBytesDot() { char decimalSeparator = '.'; assertEquals("999 B", printUnitFromBytes(999)); assertEquals("1" + decimalSeparator + "0 kB", printUnitFromBytesDot(1000)); assertEquals("1" + decimalSeparator + "0 kB", printUnitFromBytesDot(1001)); ...
public static void checkForInstantiation(Class<?> clazz) { final String errorMessage = checkForInstantiationError(clazz); if (errorMessage != null) { throw new RuntimeException( "The class '" + clazz.getName() + "' is not instantiable: " + errorMessage); } }
@Test void testCheckForInstantiationOfPrivateClass() { assertThatThrownBy(() -> InstantiationUtil.checkForInstantiation(TestClass.class)) .isInstanceOf(RuntimeException.class); }
@SuppressWarnings("unchecked") public QueryMetadataHolder handleStatement( final ServiceContext serviceContext, final Map<String, Object> configOverrides, final Map<String, Object> requestProperties, final PreparedStatement<?> statement, final Optional<Boolean> isInternalRequest, f...
@Test public void shouldRateLimit() { when(ksqlEngine.executeTablePullQuery(any(), any(), any(), any(), any(), any(), any(), anyBoolean(), any())) .thenReturn(pullQueryResult); when(mockDataSource.getDataSourceType()).thenReturn(DataSourceType.KTABLE); // When: queryExecutor.handleSta...
public List<Path> list(final Path file) throws BackgroundException { try { final Path container = containerService.getContainer(file); final Map<String, List<StorageObject>> segments = session.getClient().listObjectSegments(regionService.lookup(container), ...
@Test public void testList() throws Exception { final Path container = new Path("/test.cyberduck.ch", EnumSet.of(Path.Type.volume, Path.Type.directory)); container.attributes().setRegion("IAD"); assertTrue(new SwiftSegmentService(session).list(new Path(container, UUID.randomUUID().toString()...
public List<ChangeStreamRecord> toChangeStreamRecords( PartitionMetadata partition, ChangeStreamResultSet resultSet, ChangeStreamResultSetMetadata resultSetMetadata) { if (this.isPostgres()) { // In PostgresQL, change stream records are returned as JsonB. return Collections.singletonLi...
@Test public void testMappingInsertStructRowToDataChangeRecord() { final DataChangeRecord dataChangeRecord = new DataChangeRecord( "partitionToken", Timestamp.ofTimeSecondsAndNanos(10L, 20), "transactionId", false, "1", "tableName", ...
public Span handleSendWithParent(HttpClientRequest request, @Nullable TraceContext parent) { if (request == null) throw new NullPointerException("request == null"); return handleSend(request, tracer.nextSpanWithParent(httpSampler, request, parent)); }
@Test void handleSendWithParent_overrideNull() { try (CurrentTraceContext.Scope scope = httpTracing.tracing.currentTraceContext().newScope(null)) { brave.Span span = handler.handleSendWithParent(request, context); // If the overwrite was successful, we have a child span. assertThat(span.context()...
static void filterProperties(Message message, Set<String> namesToClear) { List<Object> retainedProperties = messagePropertiesBuffer(); try { filterProperties(message, namesToClear, retainedProperties); } finally { retainedProperties.clear(); // ensure no object references are held due to any exc...
@Test void filterProperties_message_handlesOnSetException() throws JMSException { Message message = mock(Message.class); when(message.getPropertyNames()).thenReturn( Collections.enumeration(Collections.singletonList("JMS_SQS_DeduplicationId"))); when(message.getObjectProperty("JMS_SQS_DeduplicationId"...
public String toString() { return string; }
@Test public void testBasics() { assertEquals("application/octet-stream", new MediaType("application", "octet-stream").toString()); assertEquals("text/plain", new MediaType("text", "plain").toString()); Map<String, String> parameters = new HashMap<>(); assertEquals(...
@JsonCreator public static TimeZoneKey getTimeZoneKey(short timeZoneKey) { checkArgument(timeZoneKey < TIME_ZONE_KEYS.length && TIME_ZONE_KEYS[timeZoneKey] != null, "Invalid time zone key %d", timeZoneKey); return TIME_ZONE_KEYS[timeZoneKey]; }
@Test public void testHourOffsetZone() { assertSame(TimeZoneKey.getTimeZoneKey("GMT0"), UTC_KEY); assertSame(TimeZoneKey.getTimeZoneKey("GMT+0"), UTC_KEY); assertSame(TimeZoneKey.getTimeZoneKey("GMT-0"), UTC_KEY); assertSame(TimeZoneKey.getTimeZoneKey("GMT+0"), UTC_KEY); ...
@Override public Optional<SimpleLock> lock(LockConfiguration lockConfiguration) { boolean lockObtained = doLock(lockConfiguration); if (lockObtained) { return Optional.of(new StorageLock(lockConfiguration, storageAccessor)); } else { return Optional.empty(); }...
@Test void shouldRethrowExceptionFromInsert() { when(storageAccessor.insertRecord(LOCK_CONFIGURATION)).thenThrow(LOCK_EXCEPTION); assertThatThrownBy(() -> lockProvider.lock(LOCK_CONFIGURATION)).isSameAs(LOCK_EXCEPTION); }
@Override public Object invoke(MethodInvocation methodInvocation) throws Throwable { // 入栈 DataPermission dataPermission = this.findAnnotation(methodInvocation); if (dataPermission != null) { DataPermissionContextHolder.add(dataPermission); } try { // ...
@Test // 在 Method 上有 @DataPermission 注解 public void testInvoke_method() throws Throwable { // 参数 mockMethodInvocation(TestMethod.class); // 调用 Object result = interceptor.invoke(methodInvocation); // 断言 assertEquals("method", result); assertEquals(1, intercep...
@Override protected Optional<ErrorResponse> filter(DiscFilterRequest request) { return request.getClientCertificateChain().isEmpty() ? Optional.of(new ErrorResponse(Response.Status.FORBIDDEN, "Forbidden to access this path")) : Optional.empty(); }
@Test void testFilter() { assertSuccess(createRequest(List.of(createCertificate()))); assertForbidden(createRequest(List.of())); }
public final Logger getLogger(final Class<?> clazz) { return getLogger(clazz.getName()); }
@Test public void testLoggerMultipleChildren() { assertEquals(1, instanceCount()); Logger xy0 = lc.getLogger("x.y0"); LoggerTestHelper.assertNameEquals(xy0, "x.y0"); Logger xy1 = lc.getLogger("x.y1"); LoggerTestHelper.assertNameEquals(xy1, "x.y1"); LoggerTestHelper....
@GET @Produces(MediaType.APPLICATION_JSON) public List<AppEntry> getList() { AppCatalogSolrClient sc = new AppCatalogSolrClient(); return sc.listAppEntries(); }
@Test void testGetList() throws Exception { AppListController ac = Mockito.mock(AppListController.class); List<AppEntry> actual = new ArrayList<AppEntry>(); when(ac.getList()).thenReturn(actual); final List<AppEntry> result = ac.getList(); assertEquals(result, actual); }
@Nullable public static Method findPropertySetter( @Nonnull Class<?> clazz, @Nonnull String propertyName, @Nonnull Class<?> propertyType ) { String setterName = "set" + toUpperCase(propertyName.charAt(0)) + propertyName.substring(1); Method method; tr...
@Test public void when_findPropertySetter_public_then_returnsIt() { assertNotNull(findPropertySetter(JavaProperties.class, "publicField", int.class)); }
public <T> T create(Class<T> clazz) { return create(clazz, new Class<?>[]{}, new Object[]{}); }
@Test void testCanBeConfiguredWithACustomAspect() { final SessionDao sessionDao = new SessionDao(sessionFactory); final UnitOfWorkAwareProxyFactory unitOfWorkAwareProxyFactory = new UnitOfWorkAwareProxyFactory("default", sessionFactory) { @Override public ...
@Override public Optional<GaugeMetricFamilyMetricsCollector> export(final String pluginType) { GaugeMetricFamilyMetricsCollector result = MetricsCollectorRegistry.get(config, pluginType); result.cleanMetrics(); for (Entry<String, ShardingSphereDataSourceContext> entry : ShardingSphereDataSou...
@Test void assertExport() { Optional<GaugeMetricFamilyMetricsCollector> collector = new JDBCStateExporter().export("FIXTURE"); assertTrue(collector.isPresent()); assertThat(collector.get().toString(), containsString(instanceId)); assertThat(collector.get().toString(), containsString(...
@Override public FetchContext planFetchForProcessing(IndexSegment indexSegment, QueryContext queryContext) { return new FetchContext(UUID.randomUUID(), indexSegment.getSegmentName(), getColumns(indexSegment, queryContext)); }
@Test public void testPlanFetchForProcessing() { DefaultFetchPlanner planner = new DefaultFetchPlanner(); IndexSegment indexSegment = mock(IndexSegment.class); when(indexSegment.getSegmentName()).thenReturn("s0"); when(indexSegment.getColumnNames()).thenReturn(ImmutableSet.of("c0", "c1", "c2")); S...
public static String getIpByHost(String hostName) { try { return InetAddress.getByName(hostName).getHostAddress(); } catch (UnknownHostException e) { return hostName; } }
@Test void testGetIpByHost() { assertThat(NetUtils.getIpByHost("localhost"), equalTo("127.0.0.1")); assertThat(NetUtils.getIpByHost("dubbo.local"), equalTo("dubbo.local")); }
@VisibleForTesting String upload(Configuration config, String artifactUriStr) throws IOException, URISyntaxException { final URI artifactUri = PackagedProgramUtils.resolveURI(artifactUriStr); if (!"local".equals(artifactUri.getScheme())) { return artifactUriStr; } ...
@Test void testUpload() throws Exception { File jar = getFlinkKubernetesJar(); String localUri = "local://" + jar.getAbsolutePath(); String expectedUri = "dummyfs:" + tmpDir.resolve(jar.getName()); String resultUri = artifactUploader.upload(config, localUri); assertThat(res...
public static String insertedIdAsString(@Nonnull InsertOneResult result) { return insertedId(result).toHexString(); }
@Test void testInsertedIdAsString() { final var id = "6627add0ee216425dd6df37c"; final var a = new DTO(id, "a"); assertThat(insertedIdAsString(collection.insertOne(a))).isEqualTo(id); assertThat(insertedIdAsString(collection.insertOne(new DTO(null, "b")))).isNotBlank(); }
@Override public Flux<ReactiveRedisConnection.BooleanResponse<RenameCommand>> renameNX(Publisher<RenameCommand> commands) { return execute(commands, command -> { Assert.notNull(command.getKey(), "Key must not be null!"); Assert.notNull(command.getNewName(), "New name must not be null...
@Test public void testRenameNX() { connection.stringCommands().set(originalKey, value).block(); if (hasTtl) { connection.keyCommands().expire(originalKey, Duration.ofSeconds(1000)).block(); } Integer originalSlot = getSlotForKey(originalKey); newKey = getNewKeyFo...
@Override public GetClusterMetricsResponse getClusterMetrics( GetClusterMetricsRequest request) throws YarnException { GetClusterMetricsResponse response = recordFactory .newRecordInstance(GetClusterMetricsResponse.class); YarnClusterMetrics ymetrics = recordFactory .newRecordInstance(Ya...
@Test public void testGetClusterMetrics() throws Exception { MockRM rm = new MockRM() { protected ClientRMService createClientRMService() { return new ClientRMService(this.rmContext, scheduler, this.rmAppManager, this.applicationACLsManager, this.queueACLsManager, this.getRMConte...
@Override public String named() { return PluginEnum.REDIRECT.getName(); }
@Test public void testNamed() { final String result = redirectPlugin.named(); assertThat(PluginEnum.REDIRECT.getName(), Matchers.is(result)); }
public static Optional<Object> getAdjacentValue(Type type, Object value, boolean isPrevious) { if (!type.isOrderable()) { throw new IllegalStateException("Type is not orderable: " + type); } requireNonNull(value, "value is null"); if (type.equals(BIGINT) || type instance...
@Test public void testNextValueForIntegerAndDate() { long minValue = Integer.MIN_VALUE; long maxValue = Integer.MAX_VALUE; assertThat(getAdjacentValue(INTEGER, minValue, false)) .isEqualTo(Optional.of(minValue + 1)); assertThat(getAdjacentValue(INTEGER, minValue ...
@Override public <R> R evalSha(Mode mode, String shaDigest, ReturnType returnType) { return evalSha(null, mode, shaDigest, returnType, Collections.emptyList()); }
@Test public void testEvalSha() { RScript s = redisson.getScript(); String res = s.scriptLoad("return redis.call('get', 'foo')"); Assertions.assertEquals("282297a0228f48cd3fc6a55de6316f31422f5d17", res); redisson.getBucket("foo").set("bar"); String r1 = s.evalSha(Mode.READ_O...
@Override @SuppressFBWarnings({ "SERVLET_HEADER_REFERER", "SERVLET_HEADER_USER_AGENT" }) public String format(ContainerRequestType servletRequest, ContainerResponseType servletResponse, SecurityContext ctx) { //LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined Str...
@Test void logsCurrentTimeWhenRequestTimeZero() { // given context.setRequestTimeEpoch(0); // when String actual = sut.format(mockServletRequest, mockServletResponse, null); // then assertThat(actual, containsString("[07/02/1991:01:02:03Z]")); }
@Override public ConfigOperateResult insertOrUpdateTagCas(final ConfigInfo configInfo, final String tag, final String srcIp, final String srcUser) { if (findConfigInfo4TagState(configInfo.getDataId(), configInfo.getGroup(), configInfo.getTenant(), tag) == null) { return addConfigInfo...
@Test void testInsertOrUpdateTagCasOfUpdate() { String dataId = "dataId111222"; String group = "group"; String tenant = "tenant"; String appName = "appname1234"; String content = "c12345"; ConfigInfo configInfo = new ConfigInfo(dataId, group, tenant, appName,...
public Transfer deserialize(final T serialized) { final Deserializer<T> dict = factory.create(serialized); final T hostObj = dict.objectForKey("Host"); if(null == hostObj) { log.warn("Missing host in transfer"); return null; } final Host host = new HostDic...
@Test public void testSerializeComplete() throws Exception { // Test transfer to complete with existing directory final Host host = new Host(new TestProtocol()); final Transfer t = new DownloadTransfer(host, new Path("/t", EnumSet.of(Path.Type.directory)), new NullLocal("t") { @O...
public static ShardingRouteEngine newInstance(final ShardingRule shardingRule, final ShardingSphereDatabase database, final QueryContext queryContext, final ShardingConditions shardingConditions, final ConfigurationProperties props, final ConnectionContext connectionCon...
@Test void assertNewInstanceForCursorStatementWithSingleTable() { CursorStatementContext cursorStatementContext = mock(CursorStatementContext.class, RETURNS_DEEP_STUBS); OpenGaussCursorStatement cursorStatement = mock(OpenGaussCursorStatement.class); when(cursorStatementContext.getSqlStateme...
public Future<?> scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit) { Preconditions.checkState(isOpen.get(), "CloseableExecutorService is closed"); ScheduledFuture<?> scheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(task, initialDelay, d...
@Test public void testCloseableScheduleWithFixedDelayAndAdditionalTasks() throws InterruptedException { final AtomicInteger outerCounter = new AtomicInteger(0); Runnable command = new Runnable() { @Override public void run() { outerCounter.incrementAndGet(); ...
@Description("Recursively flattens GeometryCollections") @ScalarFunction("flatten_geometry_collections") @SqlType("array(" + GEOMETRY_TYPE_NAME + ")") public static Block flattenGeometryCollections(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = EsriGeometrySerde.deserialize(i...
@Test public void testFlattenGeometryCollections() { assertFlattenGeometryCollections("POINT (0 0)", "POINT (0 0)"); assertFlattenGeometryCollections("MULTIPOINT ((0 0), (1 1))", "MULTIPOINT ((0 0), (1 1))"); assertFlattenGeometryCollections("GEOMETRYCOLLECTION EMPTY"); assertFla...
public MetricSampleAggregationResult<String, PartitionEntity> aggregate(Cluster cluster, long now, OperationProgress operationProgress) throws NotEnoughValidWindowsEx...
@Test public void testAggregateWithUpdatedCluster() throws NotEnoughValidWindowsException { KafkaCruiseControlConfig config = new KafkaCruiseControlConfig(getLoadMonitorProperties()); Metadata metadata = getMetadata(Collections.singleton(TP)); KafkaPartitionMetricSampleAggregator metricSampleAggre...
public static String getProperty(final String propertyName) { final String propertyValue = System.getProperty(propertyName); return NULL_PROPERTY_VALUE.equals(propertyValue) ? null : propertyValue; }
@Test void shouldGetNullProperty() { final String key = "org.agrona.test.case"; final String value = "@null"; System.setProperty(key, value); try { assertNull(SystemUtil.getProperty(key)); } finally { System.clearProperty(...
public Protocol forNameOrDefault(final String identifier) { return forNameOrDefault(identifier, null); }
@Test public void testForNameOrDefault() throws Exception { final TestProtocol ftp = new TestProtocol(Scheme.ftp); final TestProtocol dav = new TestProtocol(Scheme.dav); final ProtocolFactory f = new ProtocolFactory(new LinkedHashSet<>(Arrays.asList(ftp, dav))); assertEquals(dav, f.f...
public static void registerHook(TransactionHook transactionHook) { if (transactionHook == null) { throw new NullPointerException("transactionHook must not be null"); } List<TransactionHook> transactionHooks = LOCAL_HOOKS.get(); if (transactionHooks == null) { LOCA...
@Test public void testRegisterHook() { TransactionHookAdapter transactionHookAdapter = new TransactionHookAdapter(); TransactionHookManager.registerHook(transactionHookAdapter); List<TransactionHook> hooks = TransactionHookManager.getHooks(); assertThat(hooks).isNotEmpty(); a...
@Override public Optional<DatabaseAdminExecutor> create(final SQLStatementContext sqlStatementContext) { return delegated.create(sqlStatementContext); }
@Test void assertCreateExecutorForSelectTables() { SelectStatementContext selectStatementContext = mock(SelectStatementContext.class, RETURNS_DEEP_STUBS); when(selectStatementContext.getTablesContext().getTableNames()).thenReturn(Collections.singletonList("pg_tables")); Optional<DatabaseAdmi...
public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) { FunctionConfig mergedConfig = existingConfig.toBuilder().build(); if (!existingConfig.getTenant().equals(newConfig.getTenant())) { throw new IllegalArgumentException("Tenants differ"); ...
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Output Schema mismatch") public void testMergeDifferentOutputSchemaTypes() { FunctionConfig functionConfig = createFunctionConfig(); FunctionConfig newFunctionConfig = createUpdatedFunctionConfig("outputSch...
public static void latchAwait(CountDownLatch latch) { try { latch.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
@Test void testLatchAwait() { final CountDownLatch countDownLatch = new CountDownLatch(1); long currentTime = System.currentTimeMillis(); executorService.execute(() -> { ThreadUtils.sleep(100); ThreadUtils.countDown(countDownLatch); }); ThreadUtils.lat...
public static Optional<String> getDatabaseName(final String nodePath) { Pattern pattern = Pattern.compile(getRootNodePath() + "/(\\w+)$", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(nodePath); return matcher.find() ? Optional.of(matcher.group(1)) : Optional.empty(); }
@Test void assertGetDatabaseName() { Optional<String> actual = ListenerAssistedNodePath.getDatabaseName("/listener_assisted/foo_db"); assertTrue(actual.isPresent()); assertThat(actual.get(), Matchers.is("foo_db")); }
@Override public synchronized KafkaMessageBatch fetchMessages(StreamPartitionMsgOffset startMsgOffset, int timeoutMs) { long startOffset = ((LongMsgOffset) startMsgOffset).getOffset(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Polling partition: {}, startOffset: {}, timeout: {}ms", _topicPartition, s...
@Test public void testFetchMessages() { String streamType = "kafka"; String streamKafkaTopicName = "theTopic"; String streamKafkaBrokerList = _kafkaBrokerAddress; String streamKafkaConsumerType = "simple"; String clientId = "clientId"; String tableNameWithType = "tableName_REALTIME"; Map<...
public T orElseGet(Supplier<T> defaultSupplier) { return valid ? value : defaultSupplier.get(); }
@Test public void orElseGet() { assertThat(ValueWrapper.of(1).orElseGet(() -> 3)).isEqualTo((Integer) 1); assertThat(ValueWrapper.errorWithValidValue(null, null).orElseGet(() -> 3)).isEqualTo(3); assertThat(ValueWrapper.of(null).orElseGet(() -> 3)).isNull(); }
@VisibleForTesting void validateMobileUnique(Long id, String mobile) { if (StrUtil.isBlank(mobile)) { return; } AdminUserDO user = userMapper.selectByMobile(mobile); if (user == null) { return; } // 如果 id 为空,说明不用比较是否为相同 id 的用户 if (id ==...
@Test public void testValidateMobileUnique_mobileExistsForCreate() { // 准备参数 String mobile = randomString(); // mock 数据 userMapper.insert(randomAdminUserDO(o -> o.setMobile(mobile))); // 调用,校验异常 assertServiceException(() -> userService.validateMobileUnique(null, mobi...
@Override @CanIgnoreReturnValue public Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes) throws IOException { JimfsPath path = checkWatchable(watchable); Key key = super.register(path, eventTypes); Snapshot snapshot = takeSnapshot(path); synchronized (this...
@Test public void testRegister() throws IOException { Key key = watcher.register(createDirectory(), ImmutableList.of(ENTRY_CREATE)); assertThat(key.isValid()).isTrue(); assertThat(watcher.isPolling()).isTrue(); }
@SneakyThrows(GeneralSecurityException.class) @Override public Object decrypt(final Object cipherValue) { if (null == cipherValue) { return null; } byte[] result = getCipher(Cipher.DECRYPT_MODE).doFinal(Base64.getDecoder().decode(cipherValue.toString().trim())); retur...
@Test void assertDecryptNullValue() { assertNull(cryptographicAlgorithm.decrypt(null)); }
@Override public long size() { return hsa.size(); }
@Test public void testSize() { assertEquals(0, map.size()); int expected = 100; for (long i = 0; i < expected; i++) { long value = newValue(); map.put(i, value); } assertEquals(map.toString(), expected, map.size()); }
public long removeKey(final K key) { final int mask = values.length - 1; int index = Hashing.hash(key, mask); long value; while (missingValue != (value = values[index])) { if (key.equals(keys[index])) { keys[index] = null; ...
@Test public void removeShouldReturnMissing() { assertEquals(MISSING_VALUE, map.removeKey("1")); }
public void runExtractor(Message msg) { try(final Timer.Context ignored = completeTimer.time()) { final String field; try (final Timer.Context ignored2 = conditionTimer.time()) { // We can only work on Strings. if (!(msg.getField(sourceField) instanceof St...
@Test public void testCursorStrategyCopy() throws Exception { final TestExtractor extractor = new TestExtractor.Builder() .cursorStrategy(COPY) .sourceField("msg") .callback(new Callable<Result[]>() { @Override public Re...
public PeriodicityType getPeriodicityType() { return periodicityType; }
@Test public void testMillisecondPeriodicity() { // The length of the 'S' pattern letter matters on different platforms, // and can render different results on different versions of Android. // This test verifies that the periodicity is correct for different // pattern lengths. { RollingCal...
@Override public Set<UnloadDecision> findBundlesForUnloading(LoadManagerContext context, Map<String, Long> recentlyUnloadedBundles, Map<String, Long> recentlyUnloadedBrokers) { final var conf = context.broker...
@Test public void testBundleThroughputLargerThanOffloadThreshold() { UnloadCounter counter = new UnloadCounter(); TransferShedder transferShedder = new TransferShedder(counter); var ctx = setupContext(); var topBundlesLoadDataStore = ctx.topBundleLoadDataStore(); topBundlesLo...
@Override public boolean isIncomplete() { return incomplete; }
@Test public void testConstruction() { LispReferralRecord record = record1; LispIpv4Address ipv4Address1 = new LispIpv4Address(IpAddress.valueOf(IP_ADDRESS1)); assertThat(record.getRecordTtl(), is(100)); assertThat(record.isAuthoritative(), is(true)); ...
public String digestHex16(String data, Charset charset) { return DigestUtil.md5HexTo16(digestHex(data, charset)); }
@Test public void md5To16Test() { String hex16 = new MD5().digestHex16("中国"); assertEquals(16, hex16.length()); assertEquals("cb143acd6c929826", hex16); }
@Override public boolean addAll(Collection<? extends E> c) { return c.stream() .map(e -> map.putIfAbsent(e, e) == null) .reduce(Boolean::logicalOr) .orElse(false); }
@Test public void testAddAll() { ExtendedSet<TestValue> nonemptyset = new ExtendedSet<>(Maps.newConcurrentMap()); TestValue val = new TestValue("foo", 1); assertTrue(nonemptyset.add(val)); TestValue nextval = new TestValue("goo", 2); TestValue finalval = new TestValue("shoo",...
public static void maxValueCheck(String paramName, long value, long maxValue) { if (value > maxValue) { throw new IllegalArgumentException(paramName + " cannot be bigger than <" + maxValue + ">!"); } }
@Test public void testMaxValueCheck() { assertThrows(IllegalArgumentException.class, () -> ValueValidationUtil.maxValueCheck("param1", 11L, 10L)); ValueValidationUtil.maxValueCheck("param2", 10L, 10L); ValueValidationUtil.maxValueCheck("param3", 9L, 10L); }
@GET @Produces(MediaType.APPLICATION_JSON) public UserRemoteConfigList getAll(@ReadOnly @Auth AuthenticatedDevice auth) { try { MessageDigest digest = MessageDigest.getInstance("SHA1"); final Stream<UserRemoteConfig> globalConfigStream = globalConfig.entrySet().stream() .map(entry -> new ...
@Test void testRetrieveConfig() { UserRemoteConfigList configuration = resources.getJerseyTest() .target("/v1/config/") .request() .header("Authorization", AuthHelp...
@VisibleForTesting public List<PlacementRule> getPlacementRules() { return rules; }
@Test public void testPlacementRuleUpdationOrder() throws Exception { List<QueueMapping> queueMappings = new ArrayList<>(); QueueMapping userQueueMapping = QueueMappingBuilder.create() .type(MappingType.USER).source(USER1) .queue(getQueueMapping(PARENT_QUEUE, USER1)).build(); CSMappingPla...
@ScalarOperator(CAST) @SqlType(StandardTypes.TINYINT) public static long castToTinyint(@SqlType(StandardTypes.SMALLINT) long value) { try { return SignedBytes.checkedCast(value); } catch (IllegalArgumentException e) { throw new PrestoException(NUMERIC_VALUE_OU...
@Test public void testCastToTinyint() { assertFunction("cast(SMALLINT'37' as tinyint)", TINYINT, (byte) 37); assertFunction("cast(SMALLINT'17' as tinyint)", TINYINT, (byte) 17); }
public String getStyle() { return getCOSObject().getNameAsString(COSName.S, PDTransitionStyle.R.name()); }
@Test void defaultStyle() { PDTransition transition = new PDTransition(); assertEquals(COSName.TRANS, transition.getCOSObject().getCOSName(COSName.TYPE)); assertEquals(PDTransitionStyle.R.name(), transition.getStyle()); }
public static String replaceNodeName(Document document, String containerNodeName, String childNodeNameToReplace, String childNodeNameReplacement) throws TransformerException { final NodeList containerNodes = document.getElementsByTagName(containerNodeName); if (containerNodes != null) { for ...
@Test public void replaceNodeName() throws Exception { final String replacement = "replacement"; Document document = DOMParserUtil.getDocument(XML); DOMParserUtil.replaceNodeName(document, MAIN_NODE, TEST_NODE, replacement); final Map<Node, List<Node>> retrieved = D...
@Override public String lock(final Path file) throws BackgroundException { if(!containerService.getContainer(file).getType().contains(Path.Type.shared)) { log.warn(String.format("Skip attempting to lock file %s not in shared folder", file)); throw new UnsupportedException(); ...
@Test public void testLockNotShared() throws Exception { final DropboxTouchFeature touch = new DropboxTouchFeature(session); final Path file = touch.touch(new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferS...
public Result parse(final String string) throws DateNotParsableException { return this.parse(string, new Date()); }
@Test public void testTemporalOrder() throws Exception { NaturalDateParser.Result result1 = naturalDateParserUtc.parse("last hour"); assertThat(result1.getFrom()).as("from should be before to in").isBefore(result1.getTo()); NaturalDateParser.Result result2 = naturalDateParserUtc.parse("last...
boolean tryCloseGateway(long checkpointId) { checkRunsInMainThread(); if (currentMarkedCheckpointIds.contains(checkpointId)) { blockedEventsMap.putIfAbsent(checkpointId, new LinkedList<>()); return true; } return false; }
@Test void notClosingUnmarkedGateway() { final EventReceivingTasks receiver = EventReceivingTasks.createForRunningTasks(); final SubtaskGatewayImpl gateway = new SubtaskGatewayImpl( getUniqueElement(receiver.getAccessesForSubtask(11)), ...
@Override public SchemaAndValue toConnectHeader(String topic, String headerKey, byte[] value) { return toConnectData(topic, value); }
@Test public void stringHeaderToConnect() { assertEquals(new SchemaAndValue(Schema.STRING_SCHEMA, "foo-bar-baz"), converter.toConnectHeader(TOPIC, "headerName", "{ \"schema\": { \"type\": \"string\" }, \"payload\": \"foo-bar-baz\" }".getBytes())); }
@Override public ModeConfiguration swapToObject(final YamlModeConfiguration yamlConfig) { if (null == yamlConfig.getRepository()) { return new ModeConfiguration(yamlConfig.getType(), null); } YamlPersistRepositoryConfigurationSwapper<PersistRepositoryConfiguration> swapper = Type...
@Test void assertSwapToObject() { YamlModeConfiguration yamlConfig = new YamlModeConfiguration(); yamlConfig.setType(TEST_TYPE); ModeConfiguration actual = swapper.swapToObject(yamlConfig); assertThat(actual.getType(), is(TEST_TYPE)); }
@Override public void clearChanged() { changed_steps = false; changed_hops = false; for ( int i = 0; i < nrSteps(); i++ ) { getStep( i ).setChanged( false ); if ( getStep( i ).getStepPartitioningMeta() != null ) { getStep( i ).getStepPartitioningMeta().hasChanged( false ); } ...
@Test public void testContentChangeListener() { ContentChangedListener listener = mock( ContentChangedListener.class ); transMeta.addContentChangedListener( listener ); transMeta.setChanged(); transMeta.setChanged( true ); verify( listener, times( 2 ) ).contentChanged( same( transMeta ) ); ...
public static boolean isValidKsqlModuleType(final String moduleType) { for (KSqlValidModuleType type: KSqlValidModuleType.values()) { if (moduleType.equals(type.name())) { return true; } } return false; }
@Test public void testValidKsqlDeploymentMode() { List<String> validDeploymentModes = Arrays.asList( "LOCAL_CLI", "REMOTE_CLI", "SERVER", "EMBEDDED", "CLI" ); for (String mode: validDeploymentModes) { assertTrue("Expected KSQL deployment mode '" + mode + "' to be valid", Met...
public static Pair<Double, String> getByteUint(long value) { double doubleValue = (double) value; String unit; if (value >= TERABYTE) { unit = "TB"; doubleValue /= TERABYTE; } else if (value >= GIGABYTE) { unit = "GB"; doubleValue /= GIGABY...
@Test public void testGetByteUint() { Pair<Double, String> result; result = DebugUtil.getByteUint(0); Assert.assertEquals(result.first, Double.valueOf(0.0)); Assert.assertEquals(result.second, "B"); result = DebugUtil.getByteUint(123); // B Assert.assertEquals(re...
public static ShardingRouteEngine newInstance(final ShardingRule shardingRule, final ShardingSphereDatabase database, final QueryContext queryContext, final ShardingConditions shardingConditions, final ConfigurationProperties props, final ConnectionContext connectionCon...
@Test void assertNewInstanceForSubqueryWithSameConditions() { SelectStatementContext sqlStatementContext = mock(SelectStatementContext.class, RETURNS_DEEP_STUBS); tableNames.add("t_order"); when(sqlStatementContext.getTablesContext().getTableNames()).thenReturn(tableNames); when(sqlS...
public void fetchLongValues(String column, int[] inDocIds, int length, long[] outValues) { _columnValueReaderMap.get(column).readLongValues(inDocIds, length, outValues); }
@Test public void testFetchLongValues() { testFetchLongValues(INT_COLUMN); testFetchLongValues(LONG_COLUMN); testFetchLongValues(FLOAT_COLUMN); testFetchLongValues(DOUBLE_COLUMN); testFetchLongValues(BIG_DECIMAL_COLUMN); testFetchLongValues(STRING_COLUMN); testFetchLongValues(NO_DICT_INT_C...
public void validateTabNameUniqueness(ArrayList<Tab> tabs) { for (Tab tab : tabs) { if(name.equals(tab.getName())){ this.addError(NAME, String.format("Tab name '%s' is not unique.", name)); tab.addError(NAME, String.format("Tab name '%s' is not unique.", name)); ...
@Test public void shouldNotErrorOutWhenNamesAreOfDifferentCase() { Tab tab = new Tab("foO", "bar"); ArrayList<Tab> visitedTabs = new ArrayList<>(); Tab existingTab = new Tab("foo", "bar"); visitedTabs.add(existingTab); tab.validateTabNameUniqueness(visitedTabs); ass...
public boolean initWithCommittedOffsetsIfNeeded(Timer timer) { final Set<TopicPartition> initializingPartitions = subscriptions.initializingPartitions(); final Map<TopicPartition, OffsetAndMetadata> offsets = fetchCommittedOffsets(initializingPartitions, timer); // "offsets" will be null if the...
@Test public void testRefreshOffsetWithNoFetchableOffsets() { client.prepareResponse(groupCoordinatorResponse(node, Errors.NONE)); coordinator.ensureCoordinatorReady(time.timer(Long.MAX_VALUE)); subscriptions.assignFromUser(singleton(t1p)); client.prepareResponse(offsetFetchResponse...
public static void incrementIpCountWithBatchRegister(InstancePublishInfo old, BatchInstancePublishInfo instancePublishInfo) { int newSize = instancePublishInfo.getInstancePublishInfos().size(); if (null == old) { // First time increment batchPublishInfo, add all into metrics. ...
@Test void testIncrementIpCountWithBatchRegister() { BatchInstancePublishInfo test = new BatchInstancePublishInfo(); List<InstancePublishInfo> instancePublishInfos = new LinkedList<>(); instancePublishInfos.add(new InstancePublishInfo()); test.setInstancePublishInfos(instancePublishI...
public static String getChineseZodiac(Date date) { return getChineseZodiac(DateUtil.calendar(date)); }
@Test public void getChineseZodiacTest() { assertEquals("狗", Zodiac.getChineseZodiac(1994)); assertEquals("狗", Zodiac.getChineseZodiac(2018)); assertEquals("猪", Zodiac.getChineseZodiac(2019)); final Calendar calendar = Calendar.getInstance(); calendar.set(2022, Calendar.JULY, 17); assertEquals("虎", Zodiac...
public SubscriptionGroupWrapper getAllSubscriptionGroup(final String brokerAddr, long timeoutMillis) throws InterruptedException, RemotingTimeoutException, RemotingSendRequestException, RemotingConnectException, MQBrokerException { RemotingCommand request = RemotingCommand.createRequestCommand(R...
@Test public void assertGetAllSubscriptionGroupForSubscriptionGroupWrapper() throws RemotingException, InterruptedException, MQBrokerException { mockInvokeSync(); SubscriptionGroupWrapper responseBody = new SubscriptionGroupWrapper(); responseBody.getSubscriptionGroupTable().put("key", new S...
public ImmutableSet<GrantDTO> getForGrantee(GRN grantee) { return streamQuery(DBQuery.is(GrantDTO.FIELD_GRANTEE, grantee)) .collect(ImmutableSet.toImmutableSet()); }
@Test @MongoDBFixtures("grants.json") public void getForGrantee() { final GRN jane = grnRegistry.newGRN("user", "jane"); final GRN john = grnRegistry.newGRN("user", "john"); assertThat(dbService.getForGrantee(jane)).hasSize(3); assertThat(dbService.getForGrantee(john)).hasSize(2...
public Future<KafkaVersionChange> reconcile() { return getVersionFromController() .compose(i -> getPods()) .compose(this::detectToAndFromVersions) .compose(i -> prepareVersionChange()); }
@Test public void testNoopWithNewProtocolVersion(VertxTestContext context) { String kafkaVersion = VERSIONS.defaultVersion().version(); String interBrokerProtocolVersion = "3.2"; String logMessageFormatVersion = "2.8"; VersionChangeCreator vcc = mockVersionChangeCreator( ...
public Sensor sensor(String name) { return this.sensor(name, Sensor.RecordingLevel.INFO); }
@Test public void testBadSensorHierarchy() { Sensor p = metrics.sensor("parent"); Sensor c1 = metrics.sensor("child1", p); Sensor c2 = metrics.sensor("child2", p); assertThrows(IllegalArgumentException.class, () -> metrics.sensor("gc", c1, c2)); }
@PublicAPI(usage = ACCESS) public static PackageMatcher of(String packageIdentifier) { return new PackageMatcher(packageIdentifier); }
@Test @UseDataProvider public void test_reject_nesting_of_groups(String packageIdentifier) { assertThatThrownBy(() -> PackageMatcher.of(packageIdentifier)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Package Identifier does not support nesting '()' or '[]' ...
public static boolean isValidIp(String ip, boolean validLocalAndAny) { if (ip == null) { return false; } ip = convertIpIfNecessary(ip); if (validLocalAndAny) { return isValidIPv4(ip) || isValidIPv6(ip); } else { return !FORBIDDEN_HOSTS.contains...
@Test public void testIsValidIp() { String localIp = "127.0.0.1"; String someIp = "8.210.212.91"; String someHostName = "seata.io"; String unknownHost = "knownHost"; assertThat(NetUtil.isValidIp(localIp, true)).isTrue(); assertThat(NetUtil.isValidIp(localIp, false)).i...
@Override public String getName() { return ANALYZER_NAME; }
@Test public void testAnalyzePinnedInstallJsonV2() throws Exception { try (Engine engine = new Engine(getSettings())) { final Dependency result = new Dependency(BaseTest.getResourceAsFile(this, "maven_install_v2.json")); engine.addDependency(result); analyzer.analyze(resu...
public <T extends BaseRequest<T, R>, R extends BaseResponse> R execute(BaseRequest<T, R> request) { return api.send(request); }
@Test public void sendVideoNote() { SendResponse response = bot.execute(new SendVideoNote(chatId, "DQADAgADmQADYgwpSbum1JrxPsbmAg")); VideoNoteCheck.check(response.message().videoNote()); }
public static long readLengthCodedBinary(byte[] data, int index) throws IOException { int firstByte = data[index] & 0xFF; switch (firstByte) { case 251: return NULL_LENGTH; case 252: return readUnsignedShortLittleEndian(data, index + 1); ...
@Test public void testReadLengthCodedBinary() throws IOException { Assert.assertEquals(0L, ByteHelper.readLengthCodedBinary(new byte[] {0}, 0)); Assert.assertEquals(-1L, ByteHelper.readLengthCodedBinary(new byte[] {-5, -1, -7, 4, -7}, 0)); Assert.assertEquals(65_021L, ByteHelper.readLengthCodedBinary(ne...
public static OpensslCipher getInstance(String transformation) throws NoSuchAlgorithmException, NoSuchPaddingException { return getInstance(transformation, null); }
@Test(timeout=120000) public void testGetInstance() throws Exception { Assume.assumeTrue(OpensslCipher.getLoadingFailureReason() == null); OpensslCipher cipher = OpensslCipher.getInstance("AES/CTR/NoPadding"); Assert.assertTrue(cipher != null); try { cipher = OpensslCipher.getInstance("AES2...