Examples of drain()


Examples of org.rococoa.cocoa.foundation.NSAutoreleasePool.drain()


    @Test
    public void drainPoolAndFinalize() {
        NSAutoreleasePool pool = NSAutoreleasePool.new_();
        pool.drain();
        WeakReference<Object> reference = new WeakReference<Object>(pool);
        pool = null;
        while(reference.get() != null) {
            RococoaTestCase.gc();
        }
View Full Code Here

Examples of org.rococoa.cocoa.foundation.NSAutoreleasePool.drain()

        assertRetainCount(1, idOfString); // autorelease does not increase the count
       
        Foundation.sendReturnsVoid(idOfString, "retain");
        assertRetainCount(2, idOfString);
       
        pool.drain();
        assertRetainCount(1, idOfString);

        Foundation.cfRelease(idOfString);
        // causes count to go to 0 and dispose will happen
    }
View Full Code Here

Examples of org.rococoa.cocoa.foundation.NSAutoreleasePool.drain()

        ID idOfString = Foundation.sendReturnsID(idOfClass, "alloc");
        idOfString = Foundation.sendReturnsID(idOfString, "initWithCString:", "Hello world");
        assertRetainCount(1, idOfString);

        // show that it wasn't in the pool
        pool.drain();
        assertRetainCount(1, idOfString);
        Foundation.cfRelease(idOfString);
    }
   
}
View Full Code Here

Examples of org.rococoa.cocoa.foundation.NSAutoreleasePool.drain()

        NSNumber value = reference.getValueAs(NSNumber.class);
        assertEquals(42, value.intValue());

        // we better have retained the result by the time it gets back
        assertEquals(3, value.retainCount());
        pool.drain();
        assertEquals(2, value.retainCount());
    }

    @Test
    public void testDelegate() {
View Full Code Here

Examples of org.rococoa.cocoa.foundation.NSAutoreleasePool.drain()

            }
        });
        final ID delegate = callback.id();
        shunt.testCallbackWithReference(delegate);
        assertEquals("Callback to delegate failed", 0, count.getCount());
        pool.drain();
    }
}
View Full Code Here

Examples of org.voltdb.client.Client.drain()

        String newCatalogURL;
        VoltTable[] results;
        CatTestCallback callback;

        loadSomeData(client, 0, 25);
        client.drain();

        testStuffThatShouldObviouslyFail(client);

        // asynchronously call some random inserts
        loadSomeData(client, 25, 25);
View Full Code Here

Examples of org.voltdb.client.ClientImpl.drain()

    public void drain() throws InterruptedException, IOException {
        ClientImpl currentClient = this.getClient();
        if (currentClient == null) {
            throw new IOException("Client is unavailable for drain().");
        }
        currentClient.drain();
    }

    /**
     * Blocks the current thread until there is no more backpressure or there are no more
     * connections to the database
View Full Code Here

Examples of org.voltdb.client.VoltBulkLoader.VoltBulkLoader.drain()

            }
            System.out.println(String.format("Attempted inserting %d rows", --rowCnt));

            if (flushInterval <= 0 && rnd.nextBoolean()) {
                // One in 10 tests generate a sync and VoltBulkLoader internal state verification
                bulkLoader.drain();
                assertEquals(0, bulkLoader.getOutstandingRowCount());
                assertEquals(rowCnt, bulkLoader.getCompletedRowCount());
            }
            if (flushInterval > 0) {
                //Lets get timerFlush in
View Full Code Here

Examples of tconstruct.smeltery.logic.LavaTankLogic.drain()

                FluidTankInfo[] tanks = logic.getTankInfo(ForgeDirection.UNKNOWN);
                FluidStack fillFluid = tanks[0].fluid;// getFluid();
                ItemStack fillStack = FluidContainerRegistry.fillFluidContainer(fillFluid, current);
                if (fillStack != null)
                {
                    logic.drain(ForgeDirection.UNKNOWN, FluidContainerRegistry.getFluidForFilledItem(fillStack).amount, true);
                    if (!entityplayer.capabilities.isCreativeMode)
                    {
                        if (current.stackSize == 1)
                        {
                            entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, fillStack);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.