当前位置: 首页>>代码示例>>Java>>正文


Java Invocation.getParameter方法代码示例

本文整理汇总了Java中org.jmock.api.Invocation.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java Invocation.getParameter方法的具体用法?Java Invocation.getParameter怎么用?Java Invocation.getParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jmock.api.Invocation的用法示例。


在下文中一共展示了Invocation.getParameter方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: returnInstantiatedAndInitializedViewModel

import org.jmock.api.Invocation; //导入方法依赖的package包/类
private Action returnInstantiatedAndInitializedViewModel() {
    return new Action() {
        @Override
        public Object invoke(Invocation invocation) throws Throwable {
            final Class<?> cls = (Class<?>) invocation.getParameter(0);
            final String memento = (String) invocation.getParameter(1);
            final ViewModel viewModelInstance = (ViewModel) cls.newInstance();
            viewModelInstance.viewModelInit(memento);
            if(viewModelInstance instanceof UserPermissionViewModel) {
                ((UserPermissionViewModel) viewModelInstance).applicationPermissionRepository = mockApplicationPermissionRepository;
            }
            return viewModelInstance;
        }

        @Override
        public void describeTo(Description description) {
            description.appendText("return instantiated and initialized view model ");
        }
    };
}
 
开发者ID:isisaddons-legacy,项目名称:isis-module-security,代码行数:21,代码来源:UserPermissionViewModelTest.java

示例2: addToInMemoryDB

import org.jmock.api.Invocation; //导入方法依赖的package包/类
private Action addToInMemoryDB() {
    return new Action() {
        
        @Override
        public Object invoke(Invocation invocation) throws Throwable {
            final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
            final String name = (String)invocation.getParameter(0);
            final SimpleObject obj = new SimpleObject();
            obj.setName(name);
            inMemoryDB.put(SimpleObject.class, name, obj);
            return obj;
        }
        
        @Override
        public void describeTo(Description description) {
            description.appendText("add to database");
        }
    };
}
 
开发者ID:danhaywood,项目名称:rrraddd-isis-131,代码行数:20,代码来源:SimpleObjectGlue.java

示例3: invoke

import org.jmock.api.Invocation; //导入方法依赖的package包/类
@Override
public Object invoke(Invocation invocation) throws Throwable {
	byte[] tag = (byte[]) invocation.getParameter(0);
	random.nextBytes(tag);
	if (tags != null) tags.add(tag);
	return null;
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:8,代码来源:TransportKeyManagerImplTest.java

示例4: invoke

import org.jmock.api.Invocation; //导入方法依赖的package包/类
@Override
public Object invoke(Invocation invocation) throws Throwable {
	BdfDictionary d = (BdfDictionary) invocation.getParameter(0);
	assertEquals(outgoingPosition, d.getLong("nextOut").longValue());
	assertEquals(incomingPosition, d.getLong("nextIn").longValue());
	assertEquals(pending, d.getList("pending"));
	return new byte[123];
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:9,代码来源:MessageQueueManagerImplTest.java

示例5: invoke

import org.jmock.api.Invocation; //导入方法依赖的package包/类
public Object invoke(Invocation invocation) throws Throwable {
	byte[] tag = (byte[]) invocation.getParameter(0);
	SecretKey key = (SecretKey) invocation.getParameter(1);
	long streamNumber = (Long) invocation.getParameter(2);
	encodeTag(tag, key.getEncoded(), streamNumber);
	return null;
}
 
开发者ID:kiggundu,项目名称:briar,代码行数:8,代码来源:KeyRotationIntegrationTest.java

示例6: invoke

import org.jmock.api.Invocation; //导入方法依赖的package包/类
public Object invoke(Invocation invocation) throws Throwable {
	byte[] tag = (byte[]) invocation.getParameter(0);
	long streamNumber = (Long) invocation.getParameter(2);
	// Encode a fake tag based on the stream number
	ByteUtils.writeUint32(streamNumber, tag, 0);
	return null;
}
 
开发者ID:kiggundu,项目名称:briar,代码行数:8,代码来源:TransportTagRecogniserTest.java

示例7: invoke

import org.jmock.api.Invocation; //导入方法依赖的package包/类
public Object invoke(Invocation invocation) throws Throwable {
	DuplexTransportConnection conn =
			(DuplexTransportConnection) invocation.getParameter(1);
	conn.getReader().dispose(false, true);
	conn.getWriter().dispose(false);
	invoked.countDown();
	return null;
}
 
开发者ID:kiggundu,项目名称:briar,代码行数:9,代码来源:ModemPluginTest.java

示例8: executeCallableAndReturn

import org.jmock.api.Invocation; //导入方法依赖的package包/类
private static Action executeCallableAndReturn() {
    return new Action() {
        @Override
        public Object invoke(Invocation invocation) throws Throwable {
            Callable<Object> callable = (Callable<Object>) invocation.getParameter(0);
            return callable.call();
        }

        @Override
        public void describeTo(Description description) {
            description.appendText("execute arg 0 as callable and return");
        }
    };
}
 
开发者ID:estatio,项目名称:estatio,代码行数:15,代码来源:IndexValueRepository_Test.java

示例9: returnLeaseTerm

import org.jmock.api.Invocation; //导入方法依赖的package包/类
private Action returnLeaseTerm() {
    return new Action() {
        @Override
        public Object invoke(Invocation invocation) throws Throwable {
            LeaseItem leaseItem = (LeaseItem) invocation.getParameter(0);
            LeaseTerm leaseTerm = (LeaseTerm) invocation.getParameter(1);
            LocalDate startDate = (LocalDate) invocation.getParameter(2);
            LocalDate endDate = (LocalDate) invocation.getParameter(3);
            LeaseTermForTesting ltt = new LeaseTermForTesting();
            // relationships
            ltt.setLeaseItem(leaseItem);
            leaseItem.getTerms().add(ltt);
            ltt.setPrevious(leaseTerm);
            leaseTerm.setNext(ltt);
            // set values
            ltt.modifyStartDate(startDate);
            ltt.modifyEndDate(endDate);
            ltt.clockService = mockClockService;
            return ltt;
        }

        @Override
        public void describeTo(Description description) {
            description.appendText("new Lease Term under item and with previous term");
        }
    };
}
 
开发者ID:estatio,项目名称:estatio,代码行数:28,代码来源:LeaseTerm_Test.java

示例10: saveLocalFileName

import org.jmock.api.Invocation; //导入方法依赖的package包/类
private CustomAction saveLocalFileName() {
    return new CustomAction("file") {
        public Object invoke(Invocation invocation) throws Throwable {
            localFileName = (String) invocation.getParameter(0);
            return new ByteArrayOutputStream();
        }
    };
}
 
开发者ID:fadeyev,项目名称:intellijcoder,代码行数:9,代码来源:ArenaJarDownloaderTest.java

示例11: invoke

import org.jmock.api.Invocation; //导入方法依赖的package包/类
@Override
public Object invoke(Invocation invocation) throws Throwable {
	Runnable task = (Runnable) invocation.getParameter(0);
	task.run();
	return null;
}
 
开发者ID:rafjordao,项目名称:Nird2,代码行数:7,代码来源:RunAction.java

示例12: invoke

import org.jmock.api.Invocation; //导入方法依赖的package包/类
@Override
public Object invoke(Invocation invocation) throws Throwable {
    final ByteBuffer buffer = (ByteBuffer) invocation.getParameter(0);
    buffer.position(buffer.limit());
    return super.invoke(invocation);
}
 
开发者ID:StochasticTinkr,项目名称:net.virtualinfinity.nio,代码行数:7,代码来源:SocketSelectionActionsTest.java

示例13: invoke

import org.jmock.api.Invocation; //导入方法依赖的package包/类
@Override
public Object invoke(final Invocation invocation) throws Throwable {
    final Object arg0 = invocation.getParameter(0);
    finderInteraction[0] = new FinderInteraction(  arg0 instanceof Query ? (Query<?>) arg0 : null, finderMethod);
    return null;
}
 
开发者ID:estatio,项目名称:estatio,代码行数:7,代码来源:StateRepositoryTest.java


注:本文中的org.jmock.api.Invocation.getParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。