Package org.jmock.cglib

Examples of org.jmock.cglib.MockObjectTestCase.atLeastOnce()


        final MockObjectTestCase mockTestCase = (MockObjectTestCase) testCase;
        MockInitializer initializer = new MockInitializer() {
            public void init(Mock mockDesc) {
                BootLogInstance.get().debug("devSize=" + deviceSize);
                Boolean bSupp48bitsAddr = Boolean.valueOf(supp48bitsAddr);
                mockDesc.expects(mockTestCase.atLeastOnce()).
                    method("supports48bitAddressing").
                    withNoArguments().will(new ReturnStub(bSupp48bitsAddr));

                long nbSectors = deviceSize / IDEConstants.SECTOR_SIZE;
                Long lNbSectors = new Long(nbSectors);
View Full Code Here


                long nbSectors = deviceSize / IDEConstants.SECTOR_SIZE;
                Long lNbSectors = new Long(nbSectors);
                String methodName = supp48bitsAddr ?
                    "getSectorsIn48bitAddressing" :
                    "getSectorsIn28bitAddressing";
                mockDesc.expects(mockTestCase.atLeastOnce()).
                    method(methodName).
                    withNoArguments().will(new ReturnStub(lNbSectors));

            }
        };
View Full Code Here

    public static void createResourceManager(TestCase testCase) throws NameAlreadyBoundException, NamingException {
        final MockObjectTestCase mockTestCase = (MockObjectTestCase) testCase;
        MockInitializer initializer = new MockInitializer() {

            public void init(Mock mockResMgr) {
                mockResMgr.expects(mockTestCase.atLeastOnce()).method("claimIOResource").withAnyArguments();
                mockResMgr.expects(mockTestCase.atLeastOnce()).method("claimIRQ").withAnyArguments();
            }
        };
        ResourceManager resMgr = MockUtils.createMockObject(ResourceManager.class, initializer);
        InitialNaming.bind(ResourceManager.NAME, resMgr);
View Full Code Here

        final MockObjectTestCase mockTestCase = (MockObjectTestCase) testCase;
        MockInitializer initializer = new MockInitializer() {

            public void init(Mock mockResMgr) {
                mockResMgr.expects(mockTestCase.atLeastOnce()).method("claimIOResource").withAnyArguments();
                mockResMgr.expects(mockTestCase.atLeastOnce()).method("claimIRQ").withAnyArguments();
            }
        };
        ResourceManager resMgr = MockUtils.createMockObject(ResourceManager.class, initializer);
        InitialNaming.bind(ResourceManager.NAME, resMgr);
    }
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.