use of com.liferay.faces.bridge.tck.annotation.BridgeTest in project liferay-faces-bridge-impl by liferay.
the class TestsCDI1 method mutableRenderParamsAlternativeTest.
@BridgeTest(test = "mutableRenderParamsAlternativeTest")
public String mutableRenderParamsAlternativeTest(TestBean testBean) {
FacesContext facesContext = FacesContext.getCurrentInstance();
Bridge.PortletPhase portletPhase = BridgeUtil.getPortletRequestPhase(facesContext);
if (portletPhase == Bridge.PortletPhase.ACTION_PHASE) {
bridgeRequestScopedBean.setFoo(mutableRenderParams.getClass().getSimpleName());
return "multiRequestTestResultRenderCheck";
} else if (portletPhase == Bridge.PortletPhase.HEADER_PHASE) {
if ("MutableRenderParametersTCKImpl".equals(bridgeRequestScopedBean.getFoo())) {
testBean.setTestResult(true, "The bridge's alternative producer for MutableRenderParameters was properly invoked");
return Constants.TEST_SUCCESS;
} else {
testBean.setTestResult(false, "The bridge's alternative producer for MutableRenderParameters was not invoked");
return Constants.TEST_FAILED;
}
}
testBean.setTestResult(false, "Unexpected portletPhase=" + portletPhase);
return Constants.TEST_FAILED;
}
use of com.liferay.faces.bridge.tck.annotation.BridgeTest in project liferay-faces-bridge-impl by liferay.
the class TestsCDI1 method eventResponseAlternativeTest.
@BridgeTest(test = "eventResponseAlternativeTest")
public String eventResponseAlternativeTest(TestBean testBean) {
FacesContext facesContext = FacesContext.getCurrentInstance();
Bridge.PortletPhase portletPhase = BridgeUtil.getPortletRequestPhase(facesContext);
if (portletPhase == Bridge.PortletPhase.ACTION_PHASE) {
// Publish an event that gets handled by Ch7TestEventHandler.handleEvent(FacesContext,Event)
StateAwareResponse stateAwareResponse = (StateAwareResponse) facesContext.getExternalContext().getResponse();
stateAwareResponse.setEvent(new QName(Constants.EVENT_QNAME, Constants.EVENT_NAME), testBean.getTestName());
return "multiRequestTestResultRenderCheck";
} else if (portletPhase == Bridge.PortletPhase.EVENT_PHASE) {
ELContext elContext = facesContext.getELContext();
ELResolver elResolver = elContext.getELResolver();
EventBean eventBean = (EventBean) elResolver.getValue(elContext, null, "eventBean");
bridgeRequestScopedBean.setFoo(eventBean.getInjectedEventResponseFQCN());
return null;
} else if (portletPhase == Bridge.PortletPhase.HEADER_PHASE) {
String foo = bridgeRequestScopedBean.getFoo();
if ((foo != null) && foo.endsWith("EventResponseTCKImpl")) {
testBean.setTestResult(true, "The bridge's alternative producer for EventResponse was properly invoked");
return Constants.TEST_SUCCESS;
} else {
testBean.setTestResult(false, "The bridge's alternative producer for EventResponse was not invoked");
return Constants.TEST_FAILED;
}
}
testBean.setTestResult(false, "Unexpected portletPhase=" + portletPhase);
return Constants.TEST_FAILED;
}
use of com.liferay.faces.bridge.tck.annotation.BridgeTest in project liferay-faces-bridge-impl by liferay.
the class TestsCDI1 method clientDataRequestAlternativeTest.
@BridgeTest(test = "clientDataRequestAlternativeTest")
public String clientDataRequestAlternativeTest(TestBean testBean) {
FacesContext facesContext = FacesContext.getCurrentInstance();
Bridge.PortletPhase portletPhase = BridgeUtil.getPortletRequestPhase(facesContext);
if (portletPhase == Bridge.PortletPhase.ACTION_PHASE) {
bridgeRequestScopedBean.setFoo(clientDataRequest.getClass().getSimpleName());
return "multiRequestTestResultRenderCheck";
} else if (portletPhase == Bridge.PortletPhase.HEADER_PHASE) {
if ("ActionRequestTCKImpl".equals(bridgeRequestScopedBean.getFoo())) {
testBean.setTestResult(true, "The bridge's alternative producer for ClientDataRequest was properly invoked");
return Constants.TEST_SUCCESS;
} else {
testBean.setTestResult(false, "The bridge's alternative producer for ClientDataRequest was not invoked");
return Constants.TEST_FAILED;
}
}
testBean.setTestResult(false, "Unexpected portletPhase=" + portletPhase);
return Constants.TEST_FAILED;
}
use of com.liferay.faces.bridge.tck.annotation.BridgeTest in project liferay-faces-bridge-impl by liferay.
the class TestsCDI1 method actionResponseAlternativeTest.
@BridgeTest(test = "actionResponseAlternativeTest")
public String actionResponseAlternativeTest(TestBean testBean) {
FacesContext facesContext = FacesContext.getCurrentInstance();
Bridge.PortletPhase portletPhase = BridgeUtil.getPortletRequestPhase(facesContext);
if (portletPhase == Bridge.PortletPhase.ACTION_PHASE) {
bridgeRequestScopedBean.setFoo(actionResponse.getClass().getSimpleName());
return "multiRequestTestResultRenderCheck";
} else if (portletPhase == Bridge.PortletPhase.HEADER_PHASE) {
if ("ActionResponseTCKImpl".equals(bridgeRequestScopedBean.getFoo())) {
testBean.setTestResult(true, "The bridge's alternative producer for ActionResponse was properly invoked");
return Constants.TEST_SUCCESS;
} else {
testBean.setTestResult(false, "The bridge's alternative producer for ActionResponse was not invoked");
return Constants.TEST_FAILED;
}
}
testBean.setTestResult(false, "Unexpected portletPhase=" + portletPhase);
return Constants.TEST_FAILED;
}
use of com.liferay.faces.bridge.tck.annotation.BridgeTest in project liferay-faces-bridge-impl by liferay.
the class TestsCDI1 method eventRequestAlternativeTest.
@BridgeTest(test = "eventRequestAlternativeTest")
public String eventRequestAlternativeTest(TestBean testBean) {
FacesContext facesContext = FacesContext.getCurrentInstance();
Bridge.PortletPhase portletPhase = BridgeUtil.getPortletRequestPhase(facesContext);
if (portletPhase == Bridge.PortletPhase.ACTION_PHASE) {
// Publish an event that gets handled by Ch7TestEventHandler.handleEvent(FacesContext,Event)
StateAwareResponse stateAwareResponse = (StateAwareResponse) facesContext.getExternalContext().getResponse();
stateAwareResponse.setEvent(new QName(Constants.EVENT_QNAME, Constants.EVENT_NAME), testBean.getTestName());
return "multiRequestTestResultRenderCheck";
} else if (portletPhase == Bridge.PortletPhase.EVENT_PHASE) {
ELContext elContext = facesContext.getELContext();
ELResolver elResolver = elContext.getELResolver();
EventBean eventBean = (EventBean) elResolver.getValue(elContext, null, "eventBean");
bridgeRequestScopedBean.setFoo(eventBean.getInjectedEventRequestFQCN());
return null;
} else if (portletPhase == Bridge.PortletPhase.HEADER_PHASE) {
String foo = bridgeRequestScopedBean.getFoo();
if ((foo != null) && foo.endsWith("EventRequestTCKImpl")) {
testBean.setTestResult(true, "The bridge's alternative producer for EventRequest was properly invoked");
return Constants.TEST_SUCCESS;
} else {
testBean.setTestResult(false, "The bridge's alternative producer for EventRequest was not invoked");
return Constants.TEST_FAILED;
}
}
testBean.setTestResult(false, "Unexpected portletPhase=" + portletPhase);
return Constants.TEST_FAILED;
}
Aggregations