antora/components/setupguide/modules/eclipse/attachments/jmock2-templates.xml (32 lines of code) (raw):

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <templates> <template autoinsert="true" context="java" deleted="false" description="JMock2 AutoMock Definition" enabled="true" name="jmautomock">${:import(org.jmock.auto.Mock)}@Mock&#13; private ${MockClass} mock${MockClass};&#13; </template> <template autoinsert="true" context="java" deleted="false" description="JMock2 Context field" enabled="true" name="jmcontext">${:import(org.jmock.Mockery,org.jmock.integration.junit4.JUnit4Mockery)}private Mockery context = new JUnit4Mockery();&#13; </template> <template autoinsert="true" context="java" deleted="false" description="JMock2 Expectations" enabled="true" name="jmexpectations">${:import(org.jmock.Expectations)}context.checking(new Expectations() {{&#13; ${cursor}&#13; }}); </template> <template autoinsert="true" context="java" deleted="false" description="JMock2 Mock Definition" enabled="true" name="jmmock">${MockClass} ${mockObject} = context.mock(${MockClass}.class); </template> <template autoinsert="true" context="java" deleted="false" description="JMock2 Rule (Isis variant)" enabled="true" name="jmrule"> ${:import(org.junit.Rule,org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2,org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode)}@Rule&#13; public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES${cursor});&#13; &#13; </template> <template autoinsert="true" context="java" deleted="false" description="JMock2 RunWith" enabled="true" name="jmrunwith"> ${:import(org.junit.runner.RunWith,org.jmock.integration.junit4.JMock)}@RunWith(JMock.class) </template> <template autoinsert="true" context="java" deleted="false" description="JMock2 Expectation Return Value" enabled="true" name="jmvalue">will(returnValue(${cursor})); </template> </templates>