This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 150748
Collapse All | Expand All

(-)a/openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java (+24 lines)
Lines 254-259 Link Here
254
254
255
        assertSame("First node the same", now[0].getName(), after[0].getName());
255
        assertSame("First node the same", now[0].getName(), after[0].getName());
256
        assertSame("Last node the same", now[2].getName(), after[1].getName());
256
        assertSame("Last node the same", now[2].getName(), after[1].getName());
257
    }
258
259
    public void testGetNodesOptimal() throws Exception {
260
        class KOpt extends Keys {
261
            KOpt() {
262
                super(lazy());
263
            }
264
            int cnt;
265
            @Override
266
            public Node[] getNodes(boolean optimal) {
267
                assertTrue("Only calling with true", optimal);
268
                cnt++;
269
                return super.getNodes(optimal);
270
            }
271
        }
272
273
        KOpt k = new KOpt();
274
        k.keys("1", "2", "3");
275
        Node n = createNode(k);
276
277
        Node[] arr = n.getChildren().getNodes(true);
278
        assertEquals("3 nodes", 3, arr.length);
279
        assertEquals("Calling cnt once", 1, k.cnt);
280
257
    }
281
    }
258
282
259
    public void testRefreshOnFavoritesAdding() throws Exception {
283
    public void testRefreshOnFavoritesAdding() throws Exception {

Return to bug 150748