Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 70 for simulate (0.14 seconds)

  1. guava-tests/test/com/google/common/collect/ConcurrentHashMultisetTest.java

        assertThrows(IllegalArgumentException.class, () -> multiset.add(KEY, COUNT_TO_ADD));
      }
    
      /**
       * Simulate some of the races that can happen on add. We can't easily simulate the race that
       * happens when an {@link AtomicInteger#compareAndSet} fails, but we can simulate the case where
       * the putIfAbsent returns a non-null value, and the case where the replace() of an observed zero
       * fails.
       */
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Mar 12 17:47:10 GMT 2026
    - 16.3K bytes
    - Click Count (0)
  2. fastapi/.agents/skills/fastapi/references/dependencies.md

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    @dataclass
    class DatabasePaginator:
        offset: int = 0
        limit: int = 100
        q: str | None = None
    
        def get_page(self) -> dict:
            # Simulate a page of data
            return {
                "offset": self.offset,
                "limit": self.limit,
                "q": self.q,
                "items": [],
            }
    
    
    def get_db_paginator(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 01 10:05:57 GMT 2026
    - 3.2K bytes
    - Click Count (0)
  3. src/test/java/org/codelibs/fess/mylasta/direction/sponsor/FessCurtainFinallyHookTest.java

            // Create a hook that simulates an exception scenario
            AtomicBoolean exceptionHandled = new AtomicBoolean(false);
    
            FessCurtainFinallyHook customHook = new FessCurtainFinallyHook() {
                @Override
                public void hook(final FwAssistantDirector assistantDirector) {
                    try {
                        // Simulate a scenario where the method exists but invocation fails
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 8.7K bytes
    - Click Count (0)
  4. src/test/java/org/codelibs/fess/job/UpdateLabelJobTest.java

        }
    
        // Test handling of processing exception
        @Test
        public void test_execute_withProcessingException() {
            // Create a mock that returns 0 to simulate processing error
            SearchEngineClient errorClient = new SearchEngineClient() {
                @Override
                public long updateByQuery(String index,
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 9.6K bytes
    - Click Count (0)
  5. docs/en/docs/advanced/stream-data.md

    Then you can use this new class in `response_class=PNGStreamingResponse` in your *path operation function*:
    
    {* ../../docs_src/stream_data/tutorial002_py310.py ln[23:27] hl[23] *}
    
    ### Simulate a File { #simulate-a-file }
    
    In this example, we are simulating a file with `io.BytesIO`, which is a file-like object that lives only in memory, but lets us use the same interface.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 5.4K bytes
    - Click Count (0)
  6. src/test/java/org/codelibs/fess/thumbnail/ThumbnailGeneratorTest.java

                    return false;
                }
    
                // Simulate thumbnail generation
                try {
                    if (!outputFile.exists()) {
                        outputFile.createNewFile();
                    }
                    // Write some dummy content to simulate actual thumbnail
                    Files.write(outputFile.toPath(), ("thumbnail-" + thumbnailId).getBytes());
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Wed Jan 14 14:29:07 GMT 2026
    - 11.7K bytes
    - Click Count (0)
  7. tests/test_stream_cancellation.py

        Returns `True` if the cancellation was delivered (i.e. it did not hang).
        """
        chunks: list[bytes] = []
    
        async def receive():  # type: ignore[no-untyped-def]
            # Simulate a client that never disconnects, rely on cancellation
            await anyio.sleep(float("inf"))
            return {"type": "http.disconnect"}  # pragma: no cover
    
        async def send(message: dict) -> None:  # type: ignore[type-arg]
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 27 18:56:47 GMT 2026
    - 2.7K bytes
    - Click Count (0)
  8. src/test/java/org/codelibs/fess/chat/ChatPhaseCallbackTest.java

                }
    
                @Override
                public void onError(String phase, String errorMessage) {
                }
            };
    
            // Simulate typical flow
            callback.onPhaseStart(ChatPhaseCallback.PHASE_INTENT, "msg");
            callback.onPhaseStart(ChatPhaseCallback.PHASE_SEARCH, "msg");
            callback.onPhaseStart(ChatPhaseCallback.PHASE_EVALUATE, "msg");
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Mon Jan 12 10:32:40 GMT 2026
    - 7.3K bytes
    - Click Count (0)
  9. src/test/java/org/codelibs/fess/query/QueryFieldConfigSetBasedLookupTest.java

            }
            long setDuration = System.nanoTime() - setStartTime;
    
            // For comparison, simulate array-based lookup
            long arrayStartTime = System.nanoTime();
            for (int i = 0; i < 10000; i++) {
                // Simulate original array-based lookup
                boolean found = false;
                for (String field : queryFieldConfig.sortFields) {
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 19.4K bytes
    - Click Count (0)
  10. src/test/java/org/codelibs/fess/helper/CoordinatorHelperTest.java

            assertEquals(3, passedRetries.get());
        }
    
        /**
         * Creates a testable CoordinatorHelper that overrides tryStartOperation(name,data,retries)
         * to simulate "create always fails" (no OpenSearch), preserving the retry/cleanup dispatch logic.
         */
        private CoordinatorHelper createRetryTestHelper(final AtomicBoolean cleanupCalled, final AtomicInteger cleanupRetries,
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Sat Mar 28 06:59:19 GMT 2026
    - 58.6K bytes
    - Click Count (0)
Back to Top