focal_method
stringlengths
13
60.9k
test_case
stringlengths
25
109k
@Override public void export(RegisterTypeEnum registerType) { if (this.exported) { return; } if (getScopeModel().isLifeCycleManagedExternally()) { // prepare model for reference getScopeModel().getDeployer().prepare(); } else { // ensu...
@Test void testMethodConfigWithInvalidArgumentIndex() { Assertions.assertThrows(IllegalArgumentException.class, () -> { ServiceConfig<DemoServiceImpl> service = new ServiceConfig<>(); service.setInterface(DemoService.class); service.setRef(new DemoServiceImpl()); ...
@Override public void subscribe(String serviceName, EventListener listener) throws NacosException { subscribe(serviceName, new ArrayList<>(), listener); }
@Test void testSubscribe3() throws NacosException { //given String serviceName = "service1"; List<String> clusterList = Arrays.asList("cluster1", "cluster2"); EventListener listener = event -> { }; //when client.subscribe(serviceName, clusterList, lis...
@VisibleForTesting static void validateWorkerSettings(DataflowPipelineWorkerPoolOptions workerOptions) { DataflowPipelineOptions dataflowOptions = workerOptions.as(DataflowPipelineOptions.class); validateSdkContainerImageOptions(workerOptions); GcpOptions gcpOptions = workerOptions.as(GcpOptions.class);...
@Test public void testAliasForSdkContainerImage() { DataflowPipelineWorkerPoolOptions options = PipelineOptionsFactory.as(DataflowPipelineWorkerPoolOptions.class); String testImage = "image.url:sdk"; options.setSdkContainerImage("image.url:sdk"); DataflowRunner.validateWorkerSettings(options);...
@Override public void createFunction(SqlInvokedFunction function, boolean replace) { checkCatalog(function); checkFunctionLanguageSupported(function); checkArgument(!function.hasVersion(), "function '%s' is already versioned", function); QualifiedObjectName functionName = functi...
@Test(expectedExceptions = PrestoException.class, expectedExceptionsMessageRegExp = "Parameter name exceeds max length of 100.*") public void testParameterNameTooLong() { List<Parameter> parameters = ImmutableList.of(new Parameter(dummyString(101), parseTypeSignature(DOUBLE))); createFunction(cr...
protected static boolean isPublicInstanceField(Field field) { return Modifier.isPublic(field.getModifiers()) && !Modifier.isStatic(field.getModifiers()) && !Modifier.isFinal(field.getModifiers()) && !field.isSynthetic(); }
@Test public void testIsPublicInstanceField() throws Exception { Assert.assertTrue(isPublicInstanceField(TestReflect.class.getField("f1"))); Assert.assertFalse(isPublicInstanceField(TestReflect.class.getDeclaredField("f2"))); Assert.assertFalse(isPublicInstanceField(TestReflect.class.getDecl...
@Override public HashSlotCursor8byteKey cursor() { return new Cursor(); }
@Test public void testCursor_advance_whenEmpty() { HashSlotCursor8byteKey cursor = hsa.cursor(); assertFalse(cursor.advance()); }
@Override public AdjacencyMatrix subgraph(int[] vertices) { int[] v = vertices.clone(); Arrays.sort(v); AdjacencyMatrix g = new AdjacencyMatrix(v.length, digraph); for (int i = 0; i < v.length; i++) { for (int j = 0; j < v.length; j++) { g.graph[i...
@Test public void testSubgraph() { System.out.println("subgraph digraph = false"); AdjacencyMatrix graph = new AdjacencyMatrix(8, false); graph.addEdge(0, 2); graph.addEdge(1, 7); graph.addEdge(2, 6); graph.addEdge(7, 4); graph.addEdge(3, 4); graph.ad...
public final void containsKey(@Nullable Object key) { check("keySet()").that(checkNotNull(actual).keySet()).contains(key); }
@Test public void containsKeyNullFailure() { ImmutableMultimap<String, String> multimap = ImmutableMultimap.of("kurt", "kluever"); expectFailureWhenTestingThat(multimap).containsKey(null); assertFailureKeys("value of", "expected to contain", "but was", "multimap was"); assertFailureValue("value of", "...
public static String sanitizeUri(String uri) { // use xxxxx as replacement as that works well with JMX also String sanitized = uri; if (uri != null) { sanitized = ALL_SECRETS.matcher(sanitized).replaceAll("$1=xxxxxx"); sanitized = USERINFO_PASSWORD.matcher(sanitized).repl...
@Test public void testSanitizeUriWithRawPasswordAndSimpleExpression() { String uriPlain = "http://foo?username=me&password=RAW(me#@123)&foo=bar&port=21&tempFileName=${file:name.noext}.tmp&anotherOption=true"; String uriCurly = "http://foo?username=me&password=RAW{me#@...
@Override public String method() { return DubboParser.method(invocation); }
@Test void method() { when(invocation.getMethodName()).thenReturn("sayHello"); assertThat(request.method()).isEqualTo("sayHello"); }
@Override public void write(T record) { recordConsumer.startMessage(); try { messageWriter.writeTopLevelMessage(record); } catch (RuntimeException e) { Message m = (record instanceof Message.Builder) ? ((Message.Builder) record).build() : (Message) record; LOG.error("Cannot write message...
@Test public void testRepeatedIntMessage() throws Exception { RecordConsumer readConsumerMock = Mockito.mock(RecordConsumer.class); ProtoWriteSupport<TestProtobuf.RepeatedIntMessage> instance = createReadConsumerInstance(TestProtobuf.RepeatedIntMessage.class, readConsumerMock); TestProtobuf.Repea...
public void setResources(ResourceSpec minResources, ResourceSpec preferredResources) { OperatorValidationUtils.validateMinAndPreferredResources(minResources, preferredResources); this.minResources = minResources; this.preferredResources = preferredResources; }
@Test void testSetResourcesUseCaseFailNullResources() { ResourceSpec resourceSpec = ResourceSpec.newBuilder(1.0, 100).build(); assertThatThrownBy(() -> transformation.setResources(null, resourceSpec)) .isInstanceOf(NullPointerException.class); assertThatThrownBy(() -> transf...
@Override public void deleteClient(ClientDetailsEntity client) throws InvalidClientException { if (clientRepository.getById(client.getId()) == null) { throw new InvalidClientException("Client with id " + client.getClientId() + " was not found"); } // clean out any tokens that this client had issued tokenR...
@Test public void deleteClient() { Long id = 12345L; String clientId = "b00g3r"; ClientDetailsEntity client = Mockito.mock(ClientDetailsEntity.class); Mockito.when(client.getId()).thenReturn(id); Mockito.when(client.getClientId()).thenReturn(clientId); Mockito.when(clientRepository.getById(id)).thenRetu...
public static PluginVO buildPluginVO(final PluginDO pluginDO) { return new PluginVO(pluginDO.getId(), pluginDO.getRole(), pluginDO.getName(), pluginDO.getConfig(), pluginDO.getSort(), pluginDO.getEnabled(), DateUtils.localDateTimeToString(pluginDO.getDateCreated().toLocalDateTime...
@Test public void testBuildPluginVO() { Timestamp currentTime = new Timestamp(System.currentTimeMillis()); assertNotNull(PluginVO.buildPluginVO(PluginDO.builder() .name(PluginEnum.GLOBAL.getName()) .dateCreated(currentTime) .dateUpdated(currentTime) ...
CompressionConfig getStreamRequestCompressionConfig(String httpServiceName, StreamEncodingType requestContentEncoding) { if (_requestCompressionConfigs.containsKey(httpServiceName)) { if (requestContentEncoding == StreamEncodingType.IDENTITY) { // This will likely happen when the service ...
@Test(dataProvider = "compressionConfigsData") public void testGetRequestCompressionConfig(String serviceName, int requestCompressionThresholdDefault, CompressionConfig expectedConfig) { Map<String, CompressionConfig> requestCompressionConfigs = new HashMap<>(); requestCompressionConfigs.put("service1", new...
public static <T> CompletableFuture<T> addTimeoutHandling(CompletableFuture<T> future, Duration timeout, ScheduledExecutorService executor, Supplier<Throwable> exceptionSupplier) { ScheduledFuture<?> scheduledFuture = ...
@Test public void testTimeoutHandling() { CompletableFuture<Void> future = new CompletableFuture<>(); @Cleanup("shutdownNow") ScheduledExecutorService executor = Executors.newScheduledThreadPool(1); Exception e = new Exception(); try { FutureUtil.addTimeoutHandlin...
public Usage getDailyApiRequests() { return forOperation(Operation.DailyApiRequests.name()); }
@Test public void shouldDeserializeFromSalesforceGeneratedJSON() throws IOException { final ObjectMapper mapper = JsonUtils.createObjectMapper(); final Object read = mapper.readerFor(Limits.class) .readValue(LimitsTest.class.getResource("/org/apache/camel/component/salesforce/api/dt...
@Udf public List<Integer> generateSeriesInt( @UdfParameter(description = "The beginning of the series") final int start, @UdfParameter(description = "Marks the end of the series (inclusive)") final int end ) { return generateSeriesInt(start, end, end - start > 0 ? 1 : -1); }
@Test public void shouldThrowIfStepWrongSignInt2() { // When: final Exception e = assertThrows( KsqlFunctionException.class, () -> rangeUdf.generateSeriesInt(9, 0, 1) ); // Then: assertThat(e.getMessage(), containsString( "GENERATE_SERIES step has wrong sign")); }
public CLIConnectionFactory bearerAuth(String bearerToken) { return authorization("Bearer " + bearerToken); }
@Test void testBearerFromToken() { Assertions.assertEquals("Bearer some-token", cliFactory.bearerAuth("some-token").authorization); }
protected void setInternalEntryCurrentDirectory() { variables.setVariable( Const.INTERNAL_VARIABLE_ENTRY_CURRENT_DIRECTORY, variables.getVariable( repository != null ? Const.INTERNAL_VARIABLE_JOB_REPOSITORY_DIRECTORY : filename != null ? Const.INTERNAL_VARIABLE_JOB_FILENAME_DIRECTORY : Const.I...
@Test public void testSetInternalEntryCurrentDirectoryWithRepository( ) { JobMeta jobMetaTest = new JobMeta( ); RepositoryDirectoryInterface path = mock( RepositoryDirectoryInterface.class ); when( path.getPath() ).thenReturn( "aPath" ); jobMetaTest.setRepository( mock( Repository.class ) ); job...
boolean hasEnoughResource(ContinuousResource request) { double allocated = allocations.stream() .filter(x -> x.resource() instanceof ContinuousResource) .map(x -> (ContinuousResource) x.resource()) .mapToDouble(ContinuousResource::value) .sum(); ...
@Test public void testHasEnoughResourceWhenLargeResourceIsRequested() { ContinuousResource original = Resources.continuous(DID, PN1, Bandwidth.class).resource(Bandwidth.gbps(1).bps()); ContinuousResource allocated = Resources.continuous(DID, PN1, Bandwidth.class).reso...
@Override public void serialize(Asn1OutputStream out, Class<? extends Object> type, Object instance, Asn1ObjectMapper mapper) throws IOException { for (final Map.Entry<String, List<Asn1Field>> entry : fieldsMap(mapper.getFields(type)).entrySet()) { final List<Asn1Field> fields = entr...
@Test public void shouldSerializeWithOptional() { assertArrayEquals( new byte[] { 0x30, 6, 0x06, 1, 44, 0x02, 1, 4, 0x30, 6, 0x06, 1, 83, 0x02, 1, 3, 0x30, 9, 0x06, 1, 84, 0x02, 1, 1, 0x02, 1, 2 }, serialize(new SetOfIdentifiedConverter(), ...
@Override public ClientDetailsEntity saveNewClient(ClientDetailsEntity client) { if (client.getId() != null) { // if it's not null, it's already been saved, this is an error throw new IllegalArgumentException("Tried to save a new client with an existing ID: " + client.getId()); } if (client.getRegisteredRedi...
@Test(expected = IllegalArgumentException.class) public void heartMode_authcode_redirectUris() { Mockito.when(config.isHeartMode()).thenReturn(true); ClientDetailsEntity client = new ClientDetailsEntity(); Set<String> grantTypes = new LinkedHashSet<>(); grantTypes.add("authorization_code"); client.setGrantT...
public List<HistoryKey> getCurrentHistory() { if (mLoadedKeys.size() == 0) // For a unknown reason, we cannot have 0 history emoji... mLoadedKeys.add(new HistoryKey(DEFAULT_EMOJI, DEFAULT_EMOJI)); return Collections.unmodifiableList(mLoadedKeys); }
@Test public void testLoadHasDefaultValue() { mUnderTest = new QuickKeyHistoryRecords(mSharedPreferences); List<QuickKeyHistoryRecords.HistoryKey> keys = mUnderTest.getCurrentHistory(); Assert.assertNotNull(keys); Assert.assertEquals(1, keys.size()); Assert.assertEquals(QuickKeyHistoryRecords.DEFA...
@Override public V put(K key, V value, Duration ttl) { return get(putAsync(key, value, ttl)); }
@Test public void testEntryUpdate() throws InterruptedException { RMapCacheNative<Integer, Integer> map = redisson.getMapCacheNative("simple"); map.put(1, 1, Duration.ofSeconds(1)); assertThat(map.get(1)).isEqualTo(1); Thread.sleep(1000); assertThat(map.put(1, 1, Duration.o...
public static UArrayType create(UType componentType) { return new AutoValue_UArrayType(componentType); }
@Test public void equality() { new EqualsTester() .addEqualityGroup(UArrayType.create(UPrimitiveType.INT)) .addEqualityGroup(UArrayType.create(UClassType.create("java.lang.String"))) .addEqualityGroup(UArrayType.create(UArrayType.create(UPrimitiveType.INT))) .testEquals(); }
@Override public void validate(final String name, final Object value) { if (immutableProps.contains(name)) { throw new IllegalArgumentException(String.format("Cannot override property '%s'", name)); } final Consumer<Object> validator = HANDLERS.get(name); if (validator != null) { validato...
@Test public void shouldNotThrowOnConfigurableProp() { validator.validate("mutable-1", "anything"); }
@Override public boolean assign(final Map<ProcessId, ClientState> clients, final Set<TaskId> allTaskIds, final Set<TaskId> statefulTaskIds, final AssignmentConfigs configs) { final int numStandbyReplicas = configs.numStandbyReplic...
@Test public void shouldDistributeClientsOnDifferentZoneTagsEvenWhenClientsReachedCapacity() { final Map<ProcessId, ClientState> clientStates = mkMap( mkEntry(PID_1, createClientStateWithCapacity(PID_1, 1, mkMap(mkEntry(ZONE_TAG, ZONE_1), mkEntry(CLUSTER_TAG, CLUSTER_1)), TASK_0_0)), ...
public static String toCloudTime(ReadableInstant instant) { // Note that since Joda objects use millisecond resolution, we always // produce either no fractional seconds or fractional seconds with // millisecond resolution. // Translate the ReadableInstant to a DateTime with ISOChronology. DateTime...
@Test public void toCloudTimeShouldPrintTimeStrings() { assertEquals("1970-01-01T00:00:00Z", toCloudTime(new Instant(0))); assertEquals("1970-01-01T00:00:00.001Z", toCloudTime(new Instant(1))); }
public String table(TableIdentifier ident) { return SLASH.join( "v1", prefix, "namespaces", RESTUtil.encodeNamespace(ident.namespace()), "tables", RESTUtil.encodeString(ident.name())); }
@Test public void testTable() { TableIdentifier ident = TableIdentifier.of("ns", "table"); assertThat(withPrefix.table(ident)).isEqualTo("v1/ws/catalog/namespaces/ns/tables/table"); assertThat(withoutPrefix.table(ident)).isEqualTo("v1/namespaces/ns/tables/table"); }
@Override public TransformResultMetadata getResultMetadata() { return _resultMetadata; }
@Test public void testArrayElementAtInt() { Random rand = new Random(); int index = rand.nextInt(MAX_NUM_MULTI_VALUES); ExpressionContext expression = RequestContextUtils.getExpression(String.format("array_element_at_int(%s, %d)", INT_MV_COLUMN, index + 1)); TransformFunction transformFunction...
@Override public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback, final ConnectionCallback connectionCallback) throws BackgroundException { if(containerService.isContainer(source)) { if(new SimplePathPredicate(sourc...
@Test public void testMoveToEncryptedDataRoom() throws Exception { final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session); final Path room1 = new SDSDirectoryFeature(session, nodeid).createRoom( new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.di...
public static List<String> listFileNames(String path) throws IORuntimeException { if (path == null) { return new ArrayList<>(0); } int index = path.lastIndexOf(FileUtil.JAR_PATH_EXT); if (index < 0) { // 普通目录 final List<String> paths = new ArrayList<>(); final File[] files = ls(path); for (File f...
@Test public void listFileNamesTest() { List<String> names = FileUtil.listFileNames("classpath:"); assertTrue(names.contains("hutool.jpg")); names = FileUtil.listFileNames(""); assertTrue(names.contains("hutool.jpg")); names = FileUtil.listFileNames("."); assertTrue(names.contains("hutool.jpg")); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(0, Integer.MAX_VALUE, OPTION_PATHONLY, OPTION_DIRECTORY, OPTION_HUMAN, OPTION_HIDENONPRINTABLE, OPTION_RECURSIVE, OPTION_REVERSE, OPTION_MTIME, OPTION_SIZE, OPTION_A...
@Test public void processPathDirectoryAtime() throws IOException { TestFile testfile01 = new TestFile("testDirectory", "testFile01"); TestFile testfile02 = new TestFile("testDirectory", "testFile02"); TestFile testfile03 = new TestFile("testDirectory", "testFile03"); TestFile testfile04 = new TestFile...
@Override public void deleteKey(String name) throws IOException { getKeyProvider().deleteKey(name); getExtension().currentKeyCache.invalidate(name); getExtension().keyMetadataCache.invalidate(name); // invalidating all key versions as we don't know // which ones belonged to the deleted key get...
@Test public void testDeleteKey() throws Exception { KeyProvider.KeyVersion mockKey = Mockito.mock(KeyProvider.KeyVersion.class); KeyProvider mockProv = Mockito.mock(KeyProvider.class); Mockito.when(mockProv.getCurrentKey(Mockito.eq("k1"))).thenReturn(mockKey); Mockito.when(mockProv.getKeyVersion(Mock...
public ListenableFuture<RunResponse> runWithDeadline(RunRequest request, Deadline deadline) { return pluginService.withDeadline(deadline).run(request); }
@Test public void run_singlePluginValidRequest_returnSingleDetectionReport() throws Exception { RunRequest runRequest = createSinglePluginRunRequest(); PluginServiceImplBase runImpl = new PluginServiceImplBase() { @Override public void run(RunRequest request, StreamObserver<RunResp...
@Override public final ChannelFuture writeAndFlush(Object msg, ChannelPromise promise) { return tail.writeAndFlush(msg, promise); }
@Test public void testFreeCalled() throws Exception { final CountDownLatch free = new CountDownLatch(1); final ReferenceCounted holder = new AbstractReferenceCounted() { @Override protected void deallocate() { free.countDown(); } @Ove...
@Override public String selectForUpdateSkipLocked() { return supportsSelectForUpdateSkipLocked ? " FOR UPDATE SKIP LOCKED" : ""; }
@Test void otherDBDoesNotSupportSelectForUpdateSkipLocked() { assertThat(new MySqlDialect("MariaDB", "10.6").selectForUpdateSkipLocked()).isEmpty(); }
@ExceptionHandler(NoSuchElementException.class) public ResponseEntity<ProblemDetail> handleNoSuchElementException(NoSuchElementException exception, Locale locale) { return ResponseEntity.status(HttpStatus.NOT_FOUND) .body(...
@Test void handleNoSuchElementException_ReturnsNotFound() { // given var exception = new NoSuchElementException("error_code"); var locale = Locale.of("ru"); doReturn("error details").when(this.messageSource) .getMessage("error_code", new Object[0], "error_code", Loca...
@Override public String getName() { return FUNCTION_NAME; }
@Test public void testSubtractionNullLiteral() { ExpressionContext expression = RequestContextUtils.getExpression("sub(null, 1)"); TransformFunction transformFunction = TransformFunctionFactory.get(expression, _dataSourceMap); Assert.assertTrue(transformFunction instanceof SubtractionTransformFunction); ...
@Override public void execute(final ConnectionSession connectionSession) { queryResultMetaData = createQueryResultMetaData(); mergedResult = new TransparentMergedResult(getQueryResult()); }
@Test void assertExecute() throws SQLException { ShowProcedureStatusExecutor executor = new ShowProcedureStatusExecutor(new MySQLShowProcedureStatusStatement()); ContextManager contextManager = mockContextManager(); when(ProxyContext.getInstance().getContextManager()).thenReturn(contextManag...
public static List<Long> getLongList(String property, JsonNode node) { Preconditions.checkArgument(node.has(property), "Cannot parse missing list: %s", property); return ImmutableList.<Long>builder().addAll(new JsonLongArrayIterator(property, node)).build(); }
@Test public void getLongList() throws JsonProcessingException { assertThatThrownBy(() -> JsonUtil.getLongList("items", JsonUtil.mapper().readTree("{}"))) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Cannot parse missing list: items"); assertThatThrownBy( () -> JsonU...
@GetMapping("/service/publisher/list") @Secured(action = ActionTypes.READ, resource = "nacos/admin") public Result<List<ObjectNode>> getPublishedClientList( @RequestParam(value = "namespaceId", required = false, defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId, @RequestP...
@Test void testGetPublishedClientList() throws Exception { String baseTestKey = "nacos-getPublishedClientList-test"; // single instance Service service = Service.newService(baseTestKey, baseTestKey, baseTestKey); when(clientServiceIndexesManager.getAllClientsRegisteredService(service...
@Override public BigDecimal getBigNumber( Object object ) throws KettleValueException { try { if ( isNull( object ) ) { return null; } switch ( type ) { case TYPE_BIGNUMBER: switch ( storageType ) { case STORAGE_TYPE_NORMAL: return (BigDecimal)...
@Test( expected = KettleValueException.class ) public void testGetBigDecimalThrowsKettleValueException() throws KettleValueException { ValueMetaBase valueMeta = new ValueMetaBigNumber(); valueMeta.getBigNumber( "1234567890" ); }
@Override public boolean parseClientIpAndPort(Span span) { if (parseClientIpFromXForwardedFor(span)) return true; return span.remoteIpAndPort(delegate.getRemoteAddr(), delegate.getRemotePort()); }
@Test void parseClientIpAndPort_skipsRemotePortOnXForwardedFor() { when(request.getHeader("X-Forwarded-For")).thenReturn("1.2.3.4"); when(span.remoteIpAndPort("1.2.3.4", 0)).thenReturn(true); wrapper.parseClientIpAndPort(span); verify(span).remoteIpAndPort("1.2.3.4", 0); verifyNoMoreInteractions(s...
public static String[] getJobFilterNames() { if ( STRING_JOB_FILTER_NAMES == null ) { STRING_JOB_FILTER_NAMES = new String[] { BaseMessages.getString( PKG, "Const.FileFilter.Jobs" ), BaseMessages.getString( PKG, "Const.FileFilter.XML" ), BaseMessages.getString( PKG, "Cons...
@Test public void testGetJobFilterNames() { List<String> filters = Arrays.asList( Const.getJobFilterNames() ); assertTrue( filters.size() == 3 ); for ( String filter : filters ) { assertFalse( filter.isEmpty() ); } }
@Override protected double maintain() { NodeList candidates = nodeRepository().nodes().list().rebuilding(true); if (candidates.isEmpty()) { return 0; } int failures = 0; List<Node> rebuilding; try (var locked = nodeRepository().nodes().lockAndGetAll(candid...
@Test public void rebuild_host() { tester.makeReadyHosts(2, new NodeResources(1, 1, 1, 1, NodeResources.DiskSpeed.fast, NodeResources.StorageType.remote)).activateTenantHosts(); // No rebuilds in initial run diskReplacer.maintain(); assertEquals(0, tester.nodeRepository().nodes().li...
public LibResponse deleteBook(Long id) { LibResponse resp = null; AuditDto audit = null; try { Call<LibResponse> callLibResponse = libraryClient.deleteBook(id); Response<LibResponse> libResponse = callLibResponse.execute(); if (libResponse.isSuccessful()) { ...
@Test @DisplayName("Cannot delete a book") public void deleteBookRequestTest() throws Exception { LibResponse response = new LibResponse(Status.ERROR.toString(), "Could not delete book for id : 1000"); ResponseBody respBody = ResponseBody.create(MediaType.parse("application/json"), ...
public FloatArrayAsIterable usingExactEquality() { return new FloatArrayAsIterable(EXACT_EQUALITY_CORRESPONDENCE, iterableSubject()); }
@Test public void usingExactEquality_containsAnyOf_primitiveFloatArray_success() { assertThat(array(1.0f, 2.0f, 3.0f)).usingExactEquality().containsAnyOf(array(99.99f, 2.0f)); }
public static String toOperationDesc(Operation op) { Class<? extends Operation> operationClass = op.getClass(); if (PartitionIteratingOperation.class.isAssignableFrom(operationClass)) { PartitionIteratingOperation partitionIteratingOperation = (PartitionIteratingOperation) op; Op...
@Test public void testPartitionIteratingOperation() { PartitionIteratingOperation op = new PartitionIteratingOperation(new DummyOperationFactory(), new int[0]); String result = toOperationDesc(op); assertEquals(format("PartitionIteratingOperation(%s)", DummyOperationFactory.class.getName()),...
public void setWorkingDirectory(String workingDir) { this.workingDirectory = workingDir; }
@Test public void shouldErrorOutIfWorkingDirectoryIsOutsideTheCurrentWorkingDirectory() { BuildTask task = new BuildTask() { @Override public String getTaskType() { return "build"; } @Override public String getTypeForDisplay() { ...
static Optional<SearchPath> fromString(String path) { if (path == null || path.isEmpty()) { return Optional.empty(); } if (path.indexOf(';') >= 0) { return Optional.empty(); // multi-level not supported at this time } try { SearchPath sp = pars...
@Test void invalidRangeMustThrowException() { try { SearchPath.fromString("[p,0>/0"); fail("Expected exception"); } catch (InvalidSearchPathException e) { // success } }
public static List<String> getAllGroups(Pattern pattern, CharSequence content) { return getAllGroups(pattern, content, true); }
@Test public void getAllGroupsTest() { //转义给定字符串,为正则相关的特殊符号转义 final Pattern pattern = Pattern.compile("(\\d+)-(\\d+)-(\\d+)"); List<String> allGroups = ReUtil.getAllGroups(pattern, "192-168-1-1"); assertEquals("192-168-1", allGroups.get(0)); assertEquals("192", allGroups.get(1)); assertEquals("168", allGro...
@ApiOperation(value = "Get LwM2M Objects (getLwm2mListObjectsPage)", notes = "Returns a page of LwM2M objects parsed from Resources with type 'LWM2M_MODEL' owned by tenant or sysadmin. " + PAGE_DATA_PARAMETERS + LWM2M_OBJECT_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH) @PreAuthorize("ha...
@Test public void testGetLwm2mListObjectsPage() throws Exception { loginTenantAdmin(); List<TbResource> resources = loadLwm2mResources(); List<LwM2mObject> objects = doGetTyped("/api/resource/lwm2m/page?pageSize=100&page=0", new TypeReference<>() {}); Assert.assertN...
public int deleteByEventDefinitionId(String id) { return findByEventDefinitionId(id) .map(dto -> db.removeById(new ObjectId(requireNonNull(dto.id()))).getN()) .orElse(0); }
@Test @MongoDBFixtures("event-processor-state.json") public void deleteByEventProcessorId() { assertThat(stateService.deleteByEventDefinitionId("54e3deadbeefdeadbeefaff3")).isEqualTo(1); assertThat(stateService.deleteByEventDefinitionId("nope")).isEqualTo(0); }
@Override protected CompletableFuture<JobSubmitResponseBody> handleRequest( @Nonnull HandlerRequest<JobSubmitRequestBody> request, @Nonnull DispatcherGateway gateway) throws RestHandlerException { final Collection<File> uploadedFiles = request.getUploadedFiles(); ...
@TestTemplate void testSuccessfulJobSubmission() throws Exception { final Path jobGraphFile = TempDirUtils.newFile(temporaryFolder).toPath(); try (ObjectOutputStream objectOut = new ObjectOutputStream(Files.newOutputStream(jobGraphFile))) { objectOut.writeObject(JobGraphT...
public Record convert(final AbstractWALEvent event) { if (filter(event)) { return createPlaceholderRecord(event); } if (!(event instanceof AbstractRowEvent)) { return createPlaceholderRecord(event); } PipelineTableMetaData tableMetaData = getPipelineTableM...
@Test void assertConvertUpdateRowEvent() { Record record = walEventConverter.convert(mockUpdateRowEvent()); assertThat(record, instanceOf(DataRecord.class)); assertThat(((DataRecord) record).getType(), is(PipelineSQLOperationType.UPDATE)); }
static String formatRequestBody(String scope) throws IOException { try { StringBuilder requestParameters = new StringBuilder(); requestParameters.append("grant_type=client_credentials"); if (scope != null && !scope.trim().isEmpty()) { scope = scope.trim(); ...
@Test public void testFormatRequestBodyMissingValues() throws IOException { String expected = "grant_type=client_credentials"; String actual = HttpAccessTokenRetriever.formatRequestBody(null); assertEquals(expected, actual); actual = HttpAccessTokenRetriever.formatRequestBody(""); ...
public SearchQuery parse(String encodedQueryString) { if (Strings.isNullOrEmpty(encodedQueryString) || "*".equals(encodedQueryString)) { return new SearchQuery(encodedQueryString); } final var queryString = URLDecoder.decode(encodedQueryString, StandardCharsets.UTF_8); fina...
@Test void mappedFields() { SearchQueryParser parser = new SearchQueryParser("defaultfield", ImmutableMap.of( "name", SearchQueryField.create("index_name"), "id", SearchQueryField.create("real_id")) ); final SearchQuery query =...
@Override public ColumnStatisticsObj aggregate(List<ColStatsObjWithSourceInfo> colStatsWithSourceInfo, List<String> partNames, boolean areAllPartsFound) throws MetaException { checkStatisticsList(colStatsWithSourceInfo); ColumnStatisticsObj statsObj = null; String colType; String colName = null...
@Test public void testAggregateSingleStatWhenNullValues() throws MetaException { List<String> partitions = Collections.singletonList("part1"); ColumnStatisticsData data1 = new ColStatsBuilder<>(double.class).numNulls(1).numDVs(2).build(); List<ColStatsObjWithSourceInfo> statsList = Collections.sin...
public long displaySizeToByteCount( String displaySize ) { long returnValue = -1; // replace "," for int'l decimal convention String displaySizeDecimal = ( displaySize == null ) ? "" : displaySize.replace( ",", "." ); Pattern pattern = Pattern.compile( "([\\d.]+)([GMK]?B)", Pattern.CASE_INSENSITIVE ); ...
@Test public void displaySizeToByteCount_wholeNumbers() { StorageUnitConverter storageUnitConverter = new StorageUnitConverter(); // TEST 1: whole number Byte assertEquals( 34 * B, storageUnitConverter.displaySizeToByteCount( "34B" ) ); // TEST 2: whole number kilobyte assertEquals( 121 * KB, s...
public void createUser(String username, String password, String realm, Encryption encryption, List<String> userGroups, List<String> algorithms) { if (users.containsKey(username)) { throw MSG.userToolUserExists(username); } realm = checkRealm(realm); users.put(username, Encryption.CLEAR....
@Test public void testUserToolClearText() throws IOException { UserTool userTool = new UserTool(serverDirectory.getAbsolutePath()); userTool.createUser("user", "password", UserTool.DEFAULT_REALM_NAME, UserTool.Encryption.CLEAR, Collections.singletonList("admin"), null); Properties users = loadPrope...
@Override public TypeDescriptor<Deque<T>> getEncodedTypeDescriptor() { return new TypeDescriptor<Deque<T>>(getClass()) {}.where( new TypeParameter<T>() {}, getElemCoder().getEncodedTypeDescriptor()); }
@Test public void testEncodedTypeDescriptor() throws Exception { TypeDescriptor<Deque<Integer>> typeDescriptor = new TypeDescriptor<Deque<Integer>>() {}; assertThat(TEST_CODER.getEncodedTypeDescriptor(), equalTo(typeDescriptor)); }
public synchronized byte[] getActiveData() throws ActiveNotFoundException, KeeperException, InterruptedException, IOException { try { if (zkClient == null) { createConnection(); } Stat stat = new Stat(); return getDataWithRetries(zkLockFilePath, false, stat); } catch(Keeper...
@Test public void testGetActiveData() throws ActiveNotFoundException, KeeperException, InterruptedException, IOException { // get valid active data byte[] data = new byte[8]; Mockito.when( mockZK.getData(Mockito.eq(ZK_LOCK_NAME), Mockito.eq(false), any())).thenReturn(data); A...
@Udf(description = "Returns the cosine of an INT value") public Double cos( @UdfParameter( value = "value", description = "The value in radians to get the cosine of." ) final Integer value ) { return cos(value == null ? null : value.doubleValue()); }
@Test public void shouldHandlePositive() { assertThat(udf.cos(0.43), closeTo(0.9089657496748851, 0.000000000000001)); assertThat(udf.cos(Math.PI), closeTo(-1.0, 0.000000000000001)); assertThat(udf.cos(2 * Math.PI), closeTo(1.0, 0.000000000000001)); assertThat(udf.cos(6), closeTo(0.960170286650366, 0.0...
@Override @GetMapping("/presigned-url") @PreAuthorize("isAuthenticated()") public ResponseEntity<?> getPresignedUrl(@Validated PresignedUrlDto.Req request, @AuthenticationPrincipal SecurityUserDetails user) { return ResponseEntity.ok(storageUseCase.getPresignedUrl(user.getUserId(), request)); }
@Test @WithSecurityMockUser @DisplayName("Type이 CHATROOM_PROFILE이고, ChatroomId가 NULL일 때 400 응답을 반환한다.") void getPresignedUrlWithNullChatroomIdForChatroomProfile() throws Exception { // given PresignedUrlDto.Req request = new PresignedUrlDto.Req("CHATROOM_PROFILE", "jpg", null); given...
@Override public String reconstructURI() { // If this instance is immutable, then lazy-cache reconstructing the uri. if (immutable) { if (reconstructedUri == null) { reconstructedUri = _reconstructURI(); } return reconstructedUri; } else { ...
@Test void testReconstructURI() { HttpQueryParams queryParams = new HttpQueryParams(); queryParams.add("flag", "5"); Headers headers = new Headers(); headers.add("Host", "blah.netflix.com"); request = new HttpRequestMessageImpl( new SessionContext(), ...
public boolean remove(final UUID accountUuid, final byte[] challengeToken) { try { db().deleteItem(DeleteItemRequest.builder() .tableName(tableName) .key(Map.of(KEY_ACCOUNT_UUID, AttributeValues.fromUUID(accountUuid))) .conditionExpression("#challenge = :challenge AND #ttl >= :cu...
@Test void remove() { final UUID uuid = UUID.randomUUID(); final byte[] token = generateRandomToken(); assertFalse(pushChallengeDynamoDb.remove(uuid, token)); assertTrue(pushChallengeDynamoDb.add(uuid, token, Duration.ofMinutes(1))); assertTrue(pushChallengeDynamoDb.remove(uuid, token)); asse...
public void processOnce() throws IOException { // set status of query to OK. ctx.getState().reset(); executor = null; // reset sequence id of MySQL protocol final MysqlChannel channel = ctx.getMysqlChannel(); channel.setSequenceId(0); // read packet from channel ...
@Test public void testFieldListFailEmptyTable() throws Exception { MysqlSerializer serializer = MysqlSerializer.newInstance(); serializer.writeInt1(4); serializer.writeNulTerminateString(""); serializer.writeEofString(""); ConnectContext ctx = initMockContext(mockChannel(ser...
public static void removeNulls(DataMap dataMap) { try { Data.traverse(dataMap, new NullRemover()); } catch (IOException ioe) { throw new RuntimeException(ioe); } }
@Test public void dataMapCleanUp() { DataMap originalDataMap = new DataMap(ImmutableMap.<String, Object>builder() .put("float", 0F) .put("string", "str") .put("integer", 1) .put("long", 2L) .put("double", Data.NULL) .put("boolean", false) .put("array", new...
@Override public void close() { httpClient.dispatcher().executorService().shutdown(); httpClient.connectionPool().evictAll(); }
@Test public void testResultSetClose() throws Exception { try (Connection connection = createConnection()) { try (Statement statement = connection.createStatement()) { assertTrue(statement.execute("SELECT 123 x, 'foo' y")); ResultSet result = state...
@Override public <VO, VR> KStream<K, VR> join(final KStream<K, VO> otherStream, final ValueJoiner<? super V, ? super VO, ? extends VR> joiner, final JoinWindows windows) { return join(otherStream, toValueJoinerWithKey(joiner), w...
@SuppressWarnings("deprecation") @Test public void shouldNotAllowNullValueJoinerWithKeyOnJoin() { final NullPointerException exception = assertThrows( NullPointerException.class, () -> testStream.join(testStream, (ValueJoinerWithKey<? super String, ? super String, ? super String,...
@Override public List<Metric> getMetrics() { return List.of(PRIORITIZED_RULE_ISSUES); }
@Test void getMetrics() { assertThat(new IssueCountMetrics().getMetrics()) .containsExactlyInAnyOrder(PRIORITIZED_RULE_ISSUES); }
public static String durationToString(long durationMs) { return DFSUtilClient.durationToString(durationMs); }
@Test(timeout=10000) public void testDurationToString() throws Exception { assertEquals("000:00:00:00.000", DFSUtil.durationToString(0)); assertEquals("001:01:01:01.000", DFSUtil.durationToString(((24*60*60)+(60*60)+(60)+1)*1000)); assertEquals("000:23:59:59.999", DFSUtil.durationToString(...
public boolean hasPartitionFor(Facility facility) { return facilityToPartitionMapping.containsKey(facility); }
@Test public void partialFacilityListCanBeQueried() { File file = getResourceFile("eimFacilityPartitionMapping.properties"); FacilityPartitionMapping mapping = new FacilityPartitionMapping(loadProperties(file)); assertThat(mapping.hasPartitionFor(Facility.PVD), is(false)); assertTh...
@Override public long addAndGet(K key, long delta) { return complete(asyncCounterMap.addAndGet(key, delta)); }
@Test public void testAddAndGet() { atomicCounterMap.put(KEY1, VALUE1); Long afterIncrement = atomicCounterMap.addAndGet(KEY1, DELTA1); assertThat(afterIncrement, is(VALUE1 + DELTA1)); }
@JsonIgnore public void enrich(WorkflowInstance instance) { if (instance.getCreateTime() != null) { timelineEvents.add( TimelineStatusEvent.create(instance.getCreateTime(), WorkflowInstance.Status.CREATED)); } if (instance.getStartTime() != null) { timelineEvents.add( Timel...
@Test public void testGetEnrichedStepInstance() throws Exception { StepInstance instance = loadObject("fixtures/instances/sample-step-instance-succeeded.json", StepInstance.class); Timeline timeline = instance.getTimeline(); timeline.enrich(instance); assertEquals(12, instance.getTimeline().g...
public static <T> ProtobufSchema ofGenericClass(Class<T> pojo, Map<String, String> properties) { SchemaDefinition<T> schemaDefinition = SchemaDefinition.<T>builder().withPojo(pojo) .withProperties(properties).build(); return ProtobufSchema.of(schemaDefinition); }
@Test public void testGenericOf() { try { ProtobufSchema<org.apache.pulsar.client.schema.proto.Test.TestMessage> protobufSchema = ProtobufSchema.ofGenericClass(org.apache.pulsar.client.schema.proto.Test.TestMessage.class, new HashMap<>()); } catch ...
public static <T> RedistributeArbitrarily<T> arbitrarily() { return new RedistributeArbitrarily<>(null, false); }
@Test @Category(ValidatesRunner.class) public void testRedistributeAfterSlidingWindows() { PCollection<KV<String, Integer>> input = pipeline .apply( Create.of(ARBITRARY_KVS) .withCoder(KvCoder.of(StringUtf8Coder.of(), VarIntCoder.of()))) .appl...
@Override public List<DeptDO> getDeptList(Collection<Long> ids) { if (CollUtil.isEmpty(ids)) { return Collections.emptyList(); } return deptMapper.selectBatchIds(ids); }
@Test public void testGetDeptList_reqVO() { // mock 数据 DeptDO dept = randomPojo(DeptDO.class, o -> { // 等会查询到 o.setName("开发部"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); }); deptMapper.insert(dept); // 测试 name 不匹配 deptMapper.insert(Obje...
@Override public void process() { JMeterContext context = getThreadContext(); Sampler sam = context.getCurrentSampler(); SampleResult res = context.getPreviousResult(); HTTPSamplerBase sampler; HTTPSampleResult result; if (!(sam instanceof HTTPSamplerBase) || !(res in...
@Test public void testFailSimpleParse3() throws Exception { HTTPSamplerBase config = makeUrlConfig("/home/index.html"); HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html"); String responseText = "<html><head><title>Test page</title></head><body>" ...
public Future<Instant> watermarkFuture(ByteString encodedTag, String stateFamily) { return stateFuture(StateTag.of(StateTag.Kind.WATERMARK, encodedTag, stateFamily), null); }
@Test public void testCachingWithinBatch() throws Exception { underTest.watermarkFuture(STATE_KEY_1, STATE_FAMILY); underTest.watermarkFuture(STATE_KEY_1, STATE_FAMILY); assertEquals(1, underTest.pendingLookups.size()); }
public static <T> T toBean(Object source, Class<T> clazz) { return toBean(source, clazz, null); }
@Test public void beanToBeanTest() { // 修复对象无getter方法导致报错的问题 final Page page1 = new Page(); BeanUtil.toBean(page1, Page.class); }
@Override public void write(final MySQLPacketPayload payload, final Object value) { payload.writeInt2((Integer) value); }
@Test void assertWrite() { new MySQLInt2BinaryProtocolValue().write(payload, 1); verify(payload).writeInt2(1); }
public static void main(String[] args) { /* * Getting bar series */ BarSeries series = CsvTradesLoader.loadBitstampSeries(); /* * Creating the OHLC dataset */ OHLCDataset ohlcDataset = createOHLCDataset(series); /* * Creating the add...
@Test public void test() { CandlestickChart.main(null); }
@Override public void generateLedgerId(BookkeeperInternalCallbacks.GenericCallback<Long> genericCallback) { ledgerIdGenPathPresent() .thenCompose(isIdGenPathPresent -> { if (isIdGenPathPresent) { // We've already started generating 63-bit ledger ID...
@Test(dataProvider = "impl") public void testEnsureCounterIsNotResetWithContainerNodes(String provider, Supplier<String> urlSupplier) throws Exception { @Cleanup MetadataStoreExtended store = MetadataStoreExtended.create(urlSupplier.get(), MetadataStoreConfig.builder().bu...
public static Uri getUriForBaseFile( @NonNull Context context, @NonNull HybridFileParcelable baseFile) { switch (baseFile.getMode()) { case FILE: case ROOT: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { return FileProvider.getUriForFile( context, context.get...
@Test public void testGetUriForBaseFile() { HybridFileParcelable file = new HybridFileParcelable("/storage/emulated/0/test.txt"); for (OpenMode m : new OpenMode[] {OpenMode.FILE, OpenMode.ROOT}) { file.setMode(m); Uri uri = Utils.getUriForBaseFile(ApplicationProvider.getApplicationContext(), file)...
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { return this.list(directory, listener, String.valueOf(Path.DELIMITER)); }
@Test public void testListPlaceholder() throws Exception { final Path container = new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume)); final S3AccessControlListFeature acl = new S3AccessControlListFeature(session); final Path placeholder = new S3Directo...
public static void copyBytes(InputStream in, OutputStream out, int buffSize, boolean close) throws IOException { try { copyBytes(in, out, buffSize); if(close) { out.close(); out = null; in.close(); in = null; } } finally { ...
@Test public void testCopyBytesWithCountShouldCloseStreamsWhenCloseIsTrue() throws Exception { InputStream inputStream = Mockito.mock(InputStream.class); OutputStream outputStream = Mockito.mock(OutputStream.class); Mockito.doReturn(-1).when(inputStream).read(new byte[4096], 0, 1); IOUtils.copyB...
public boolean shouldShow(@Nullable Keyboard.Key pressedKey) { return pressedKey != null && shouldShow(pressedKey.getPrimaryCode()); }
@Test public void testPathReset() { final OnKeyWordHelper helper = new OnKeyWordHelper("test"); Keyboard.Key key = Mockito.mock(Keyboard.Key.class); Mockito.doReturn((int) 'b').when(key).getPrimaryCode(); Assert.assertFalse(helper.shouldShow(key)); Mockito.doReturn((int) 't').when(key).getPrimar...
@Operation(summary = "deleteByCode", description = "DELETE_PROCESS_DEFINITION_BY_ID_NOTES") @Parameters({ @Parameter(name = "code", description = "PROCESS_DEFINITION_CODE", schema = @Schema(implementation = int.class, example = "100")) }) @DeleteMapping(value = "/{code}") @ResponseStatus(Htt...
@Test public void testDeleteProcessDefinitionByCode() { long projectCode = 1L; long code = 1L; // not throw error mean pass Assertions.assertDoesNotThrow( () -> processDefinitionController.deleteProcessDefinitionByCode(user, projectCode, code)); }
public NearCachePreloaderConfig setStoreIntervalSeconds(int storeIntervalSeconds) { this.storeIntervalSeconds = checkPositive("storeIntervalSeconds", storeIntervalSeconds); return this; }
@Test(expected = IllegalArgumentException.class) public void setStoreIntervalSeconds_withZero() { config.setStoreIntervalSeconds(0); }
@Override public Health check(Set<NodeHealth> nodeHealths) { Set<NodeHealth> appNodes = nodeHealths.stream() .filter(s -> s.getDetails().getType() == NodeDetails.Type.APPLICATION) .collect(Collectors.toSet()); return Arrays.stream(AppNodeClusterHealthSubChecks.values()) .map(s -> s.check(ap...
@Test public void status_RED_when_no_application_node() { Set<NodeHealth> nodeHealths = nodeHealths().collect(toSet()); Health check = underTest.check(nodeHealths); assertThat(check) .forInput(nodeHealths) .hasStatus(Health.Status.RED) .andCauses("No application node"); }
@Override public Optional<String> validate(String password) { return password.matches(SYMBOL_REGEX) ? Optional.empty() : Optional.of(SYMBOL_REASONING); }
@Test public void testValidateFailure() { Optional<String> result = symbolValidator.validate("Password123"); Assert.assertTrue(result.isPresent()); Assert.assertEquals(result.get(), "must contain at least one special character"); }
@Override public void deleteProductById(String productId) { final ProductEntity productEntityToBeDelete = productRepository .findById(productId) .orElseThrow(() -> new ProductNotFoundException("With given productID = " + productId)); productRepository.delete(product...
@Test void givenProductId_whenProductNotFound_thenThrowProductNotFoundException() { // Given String productId = "1"; when(productRepository.findById(productId)).thenReturn(Optional.empty()); // When/Then assertThrows(ProductNotFoundException.class, () -> productDeleteServic...
public static String toAddressString(InetSocketAddress address) { if (address == null) { return StringUtils.EMPTY; } else { return toIpString(address) + ":" + address.getPort(); } }
@Test public void toAddressString() throws Exception { }
@Override public void upgrade() { if (clusterConfigService.get(MigrationCompleted.class) != null) { LOG.debug("Migration already completed."); return; } var result = collection.find(Filters.and( Filters.eq("config.type", "aggregation-v1"), ...
@Test public void writesMigrationCompletedAfterSuccess() { this.migration.upgrade(); final V20230629140000_RenameFieldTypeOfEventDefinitionSeries.MigrationCompleted migrationCompleted = captureMigrationCompleted(); assertThat(migrationCompleted).isNotNull(); }
@Override public String toString() { return volumes.toString(); }
@Test public void testDfsReservedForDifferentStorageTypes() throws IOException { Configuration conf = new Configuration(); conf.setLong(DFSConfigKeys.DFS_DATANODE_DU_RESERVED_KEY, 100L); File volDir = new File(baseDir, "volume-0"); volDir.mkdirs(); // when storage type reserved is not configured,...
public static boolean isGzipStream(byte[] bytes) { int minByteArraySize = 2; if (bytes == null || bytes.length < minByteArraySize) { return false; } return GZIPInputStream.GZIP_MAGIC == ((bytes[1] << 8 | bytes[0]) & 0xFFFF); }
@Test void testIsGzipStreamWithEmpty() { assertFalse(IoUtils.isGzipStream(new byte[0])); }
public Predicate convert(ScalarOperator operator) { if (operator == null) { return null; } return operator.accept(this, null); }
@Test public void testGreaterThan() { ConstantOperator value = ConstantOperator.createInt(5); ScalarOperator op = new BinaryPredicateOperator(BinaryType.GT, F0, value); Predicate result = CONVERTER.convert(op); Assert.assertTrue(result instanceof LeafPredicate); LeafPredicate...