Search in sources :

Example 66 with MutableComponentModel

use of org.apache.tapestry5.model.MutableComponentModel in project tapestry-5 by apache.

the class MixinAfterWorkerTest method annotation_present.

@Test
public void annotation_present() {
    PlasticClass pc = newMock(PlasticClass.class);
    MutableComponentModel model = mockMutableComponentModel();
    expect(pc.hasAnnotation(MixinAfter.class)).andReturn(true);
    model.setMixinAfter(true);
    replay();
    new MixinAfterWorker().transform(pc, null, model);
    verify();
}
Also used : PlasticClass(org.apache.tapestry5.plastic.PlasticClass) MutableComponentModel(org.apache.tapestry5.model.MutableComponentModel) Test(org.testng.annotations.Test)

Example 67 with MutableComponentModel

use of org.apache.tapestry5.model.MutableComponentModel in project tapestry-5 by apache.

the class SupportsInformalParametersWorkerTest method annotation_missing.

@Test
public void annotation_missing() {
    PlasticClass plasticClass = mockPlasticClass();
    MutableComponentModel model = mockMutableComponentModel();
    expect(plasticClass.hasAnnotation(SupportsInformalParameters.class)).andReturn(false);
    replay();
    new SupportsInformalParametersWorker().transform(plasticClass, null, model);
    verify();
}
Also used : PlasticClass(org.apache.tapestry5.plastic.PlasticClass) MutableComponentModel(org.apache.tapestry5.model.MutableComponentModel) Test(org.testng.annotations.Test)

Example 68 with MutableComponentModel

use of org.apache.tapestry5.model.MutableComponentModel in project tapestry-5 by apache.

the class SupportsInformalParametersWorkerTest method annotation_present.

@Test
public void annotation_present() {
    PlasticClass plasticClass = mockPlasticClass();
    MutableComponentModel model = mockMutableComponentModel();
    expect(plasticClass.hasAnnotation(SupportsInformalParameters.class)).andReturn(true);
    model.enableSupportsInformalParameters();
    replay();
    new SupportsInformalParametersWorker().transform(plasticClass, null, model);
    verify();
}
Also used : PlasticClass(org.apache.tapestry5.plastic.PlasticClass) MutableComponentModel(org.apache.tapestry5.model.MutableComponentModel) Test(org.testng.annotations.Test)

Aggregations

MutableComponentModel (org.apache.tapestry5.model.MutableComponentModel)42 Test (org.testng.annotations.Test)42 Resource (org.apache.tapestry5.commons.Resource)37 Logger (org.slf4j.Logger)37 MutableEmbeddedComponentModel (org.apache.tapestry5.model.MutableEmbeddedComponentModel)10 PlasticField (org.apache.tapestry5.plastic.PlasticField)7 PlasticClass (org.apache.tapestry5.plastic.PlasticClass)6 PlasticMethod (org.apache.tapestry5.plastic.PlasticMethod)4 BeginRender (org.apache.tapestry5.annotations.BeginRender)3 Location (org.apache.tapestry5.commons.Location)3 Annotation (java.lang.annotation.Annotation)2 PersistenceContext (javax.persistence.PersistenceContext)2 SneakyThrows (lombok.SneakyThrows)2 ComponentResources (org.apache.tapestry5.ComponentResources)2 Import (org.apache.tapestry5.annotations.Import)2 InternalComponentResources (org.apache.tapestry5.internal.InternalComponentResources)2 JSONArray (org.apache.tapestry5.json.JSONArray)2 InstanceContext (org.apache.tapestry5.plastic.InstanceContext)2 MethodAdvice (org.apache.tapestry5.plastic.MethodAdvice)2 SessionTracker (com.flowlogix.web.mixins.SessionTracker)1