Home / Function/ mustReturnValuesInOrder() — netty Function Reference

mustReturnValuesInOrder() — netty Function Reference

Architecture documentation for the mustReturnValuesInOrder() function in IntPriorityQueueTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  482daf96_c62c_6b37_292d_b6731c492ef0["mustReturnValuesInOrder()"]
  b98c03f4_3d86_02c0_747b_f06548c0b7f8["IntPriorityQueueTest"]
  482daf96_c62c_6b37_292d_b6731c492ef0 -->|defined in| b98c03f4_3d86_02c0_747b_f06548c0b7f8
  style 482daf96_c62c_6b37_292d_b6731c492ef0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/IntPriorityQueueTest.java lines 41–75

    @Test
    public void mustReturnValuesInOrder() {
        ThreadLocalRandom tlr = ThreadLocalRandom.current();
        int initialValues = tlr.nextInt(5, 30);
        ArrayList<Integer> values = new ArrayList<Integer>();
        for (int i = 0; i < initialValues; i++) {
            values.add(tlr.nextInt(0, Integer.MAX_VALUE));
        }
        IntPriorityQueue pq = new IntPriorityQueue();
        assertTrue(pq.isEmpty());
        for (Integer value : values) {
            pq.offer(value);
        }
        Collections.sort(values);
        int valuesToRemove = initialValues / 2;
        ListIterator<Integer> itr = values.listIterator();
        for (int i = 0; i < valuesToRemove; i++) {
            assertTrue(itr.hasNext());
            assertThat(pq.poll()).isEqualTo(itr.next());
            itr.remove();
        }
        int moreValues = tlr.nextInt(5, 30);
        for (int i = 0; i < moreValues; i++) {
            int value = tlr.nextInt(0, Integer.MAX_VALUE);
            pq.offer(value);
            values.add(value);
        }
        Collections.sort(values);
        itr = values.listIterator();
        while (itr.hasNext()) {
            assertThat(pq.poll()).isEqualTo(itr.next());
        }
        assertTrue(pq.isEmpty());
        assertThat(pq.poll()).isEqualTo(IntPriorityQueue.NO_VALUE);
    }

Domain

Subdomains

Frequently Asked Questions

What does mustReturnValuesInOrder() do?
mustReturnValuesInOrder() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/IntPriorityQueueTest.java.
Where is mustReturnValuesInOrder() defined?
mustReturnValuesInOrder() is defined in buffer/src/test/java/io/netty/buffer/IntPriorityQueueTest.java at line 41.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free