| At line 1 changed 8 lines. |
| <pre> |
| <?xml version="1.0"?> |
| <!DOCTYPE page-specification PUBLIC |
| "-//Apache Software Foundation//Tapestry Specification 3.0//EN" |
| "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd"> |
| |
| <page-specification class="org.appfuse.webapp.action.PersonForm"> |
| <span style="background-color: yellow"><bean name="delegate" class="org.appfuse.webapp.action.Validator"/></span> |
| [this mailing list thread|http://nagoya.apache.org/eyebrowse/[email protected]&msgNo=451]. |
| At line 10 changed 4 lines. |
| <bean name="requiredValidator" class="org.apache.tapestry.valid.StringValidator"> |
| <set-property name="required" expression="true"/> |
| <set-property name="clientScriptingEnabled" expression="true"/> |
| </bean></span> |
| [What is this SandBox?|WhatIsThisSandBox] |
| At line 15 changed 5 lines. |
| <property-specification name="person" type="org.appfuse.model.Person"/> |
| <property-specification name="manager" type="org.appfuse.service.Manager"> |
| global.appContext.getBean("manager") |
| </property-specification> |
| <property-specification name="message" type="java.lang.String"/> |
| [{Java2HtmlPlugin |
| At line 21 changed 5 lines. |
| <span style="background-color: yellow"><component id="firstNameField" type="ValidField"></span> |
| <span style="background-color: yellow"><binding name="value" expression="person.firstName"/></span> |
| <span style="background-color: yellow"><binding name="validator" expression="beans.requiredValidator"/></span> |
| <span style="background-color: yellow"><message-binding name="displayName" key="person.firstName"/></span> |
| <span style="background-color: yellow"></component></span> |
| import javax.naming.Context; |
| import javax.naming.InitialContext; |
| At line 27 changed 7 lines. |
| <span style="background-color: yellow"><component id="lastNameField" type="ValidField"></span> |
| <span style="background-color: yellow"><binding name="value" expression="person.lastName"/></span> |
| <span style="background-color: yellow"><binding name="validator" expression="beans.requiredValidator"/></span> |
| <span style="background-color: yellow"><message-binding name="displayName" key="person.lastName"/></span> |
| <span style="background-color: yellow"></component></span> |
| </page-specification> |
| </pre> |
| import junit.framework.TestCase; |
|
| import org.mockejb.MockContainer; |
| import org.mockejb.SessionBeanDescriptor; |
| import org.mockejb.jndi.MockContextFactory; |
| import org.springframework.context.ApplicationContext; |
| import org.springframework.context.support.ClassPathXmlApplicationContext; |
|
| /** |
| * Parent TestCase class for testing EJBs using MockEJB |
| * |
| * @author mraible |
| * |
| */ |
| public abstract class MockEJBTestCase extends TestCase { |
|
| /** |
| * This method sets up a MockContainer and allows you to deploy an EJB to |
| * it. Override <code>onSetUp()</code> to add custom set-up behavior. |
| * |
| * @see #onSetUp() |
| */ |
| protected final void setUp() throws Exception { |
| MockContextFactory.setAsInitial(); |
|
| Context ctx = new InitialContext(); |
| ApplicationContext appCtx = |
| new ClassPathXmlApplicationContext(getConfigLocations()); |
| |
| ctx.bind("java:comp/env/jdbc/appDS", appCtx.getBean("dataSource")); |
| |
| MockContainer mc = new MockContainer(ctx); |
| SessionBeanDescriptor dd = getDeploymentDescriptor(); |
| mc.deploy(dd); |
| onSetUp(); |
| } |
|
| protected String[] getConfigLocations() { |
| return new String[] { "classpath:/applicationContext.xml" }; |
| } |
|
| protected void onSetUp() throws Exception {} |
|
| protected abstract SessionBeanDescriptor getDeploymentDescriptor(); |
| } |
|
| }] |
|
| [CreateDAO_zh] |
| [CreateDAO_sp] |
|
| [CreateManager_es] |
|
| [QuickStart Guide_es] |
|
| [SpringControllerUnitTest] |
|
|
| [δΈζζε|Articles_zh] |