本文整理汇总了Java中org.springframework.webflow.action.EventFactorySupport类的典型用法代码示例。如果您正苦于以下问题:Java EventFactorySupport类的具体用法?Java EventFactorySupport怎么用?Java EventFactorySupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventFactorySupport类属于org.springframework.webflow.action包,在下文中一共展示了EventFactorySupport类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ensureRemoteIpShouldBeChecked
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureRemoteIpShouldBeChecked() {
final BaseSpnegoKnownClientSystemsFilterAction action =
new BaseSpnegoKnownClientSystemsFilterAction("^192\\.158\\..+");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("192.158.5.781");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java
示例2: ensureRemoteIpShouldNotBeChecked
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureRemoteIpShouldNotBeChecked() {
final BaseSpnegoKnownClientSystemsFilterAction action =
new BaseSpnegoKnownClientSystemsFilterAction("^192\\.158\\..+");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("193.158.5.781");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertNotEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java
示例3: ensureAltRemoteIpHeaderShouldBeChecked
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureAltRemoteIpHeaderShouldBeChecked() {
final BaseSpnegoKnownClientSystemsFilterAction action =
new BaseSpnegoKnownClientSystemsFilterAction("^74\\.125\\..+", "alternateRemoteIp");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("555.555.555.555");
req.addHeader("alternateRemoteIp", "74.125.136.102");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:18,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java
示例4: ensureHostnameShouldDoSpnego
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureHostnameShouldDoSpnego() {
final HostNameSpnegoKnownClientSystemsFilterAction action =
new HostNameSpnegoKnownClientSystemsFilterAction("\\w+\\.\\w+\\.\\w+");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("74.125.136.102");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:18,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java
示例5: ensureHostnameAndIpShouldDoSpnego
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureHostnameAndIpShouldDoSpnego() {
final HostNameSpnegoKnownClientSystemsFilterAction action =
new HostNameSpnegoKnownClientSystemsFilterAction("\\w+\\.\\w+\\.\\w+");
action.setIpsToCheckPattern("74\\..+");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("74.125.136.102");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java
示例6: verifyIpMismatchWhenCheckingHostnameForSpnego
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void verifyIpMismatchWhenCheckingHostnameForSpnego() {
final HostNameSpnegoKnownClientSystemsFilterAction action =
new HostNameSpnegoKnownClientSystemsFilterAction("\\w+\\.\\w+\\.\\w+");
action.setIpsToCheckPattern("14\\..+");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("74.125.136.102");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().no(this).getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:AllSpnegoKnownClientSystemsFilterActionTest.java
示例7: ensureLdapAttributeShouldDoSpnego
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureLdapAttributeShouldDoSpnego() {
final LdapSpnegoKnownClientSystemsFilterAction action =
new LdapSpnegoKnownClientSystemsFilterAction(this.connectionFactory, this.searchRequest, "mail") {
@Override
protected String getRemoteHostName(final String remoteIp) {
if ("localhost".equalsIgnoreCase(remoteIp) || remoteIp.startsWith("127")) {
return remoteIp;
}
return super.getRemoteHostName(remoteIp);
}
};
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("localhost");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:24,代码来源:LdapSpnegoKnownClientSystemsFilterActionTests.java
示例8: ensureLdapAttributeShouldDoSpnego
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureLdapAttributeShouldDoSpnego() {
final LdapSpnegoKnownClientSystemsFilterAction action =
new LdapSpnegoKnownClientSystemsFilterAction(this.connectionFactory,
this.searchRequest, "mail");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("localhost");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:LdapSpnegoKnownClientSystemsFilterActionTests.java
示例9: doExecute
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
final RequestContext context = RequestContextHolder.getRequestContext();
final String uid = WebUtils.getAuthentication(context).getPrincipal().getId();
final String secretKey = repository.getSecret(uid);
if (StringUtils.isBlank(secretKey)) {
final OneTimeTokenAccount keyAccount = this.repository.create(uid);
final String keyUri = "otpauth://totp/" + this.label + ':' + uid + "?secret=" + keyAccount.getSecretKey() + "&issuer=" + this.issuer;
requestContext.getFlowScope().put("key", keyAccount);
requestContext.getFlowScope().put("keyUri", keyUri);
LOGGER.debug("Registration key URI is [{}]", keyUri);
return new EventFactorySupport().event(this, "register");
}
return success();
}
示例10: doExecute
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Override
protected Event doExecute(final RequestContext requestContext) throws Exception {
try {
final UsernamePasswordCredential c = (UsernamePasswordCredential) WebUtils.getCredential(requestContext);
final PasswordChangeBean bean = requestContext.getFlowScope()
.get(PasswordManagementWebflowConfigurer.FLOW_VAR_ID_PASSWORD, PasswordChangeBean.class);
if (passwordManagementService.change(c, bean)) {
return new EventFactorySupport().event(this, PASSWORD_UPDATE_SUCCESS);
}
} catch (final Exception e) {
LOGGER.error(e.getMessage(), e);
}
requestContext.getMessageContext().addMessage(new MessageBuilder().error().code("pm.updateFailure").
defaultText("Could not update the account password").build());
return error();
}
示例11: ensureRemoteIpShouldBeChecked
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureRemoteIpShouldBeChecked() {
final BaseSpnegoKnownClientSystemsFilterAction action =
new BaseSpnegoKnownClientSystemsFilterAction("^192\\.158\\..+", "", 0);
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("192.158.5.781");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
示例12: ensureRemoteIpShouldNotBeChecked
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureRemoteIpShouldNotBeChecked() {
final BaseSpnegoKnownClientSystemsFilterAction action =
new BaseSpnegoKnownClientSystemsFilterAction("^192\\.158\\..+", "", 0);
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("193.158.5.781");
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertNotEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
示例13: ensureAltRemoteIpHeaderShouldBeChecked
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureAltRemoteIpHeaderShouldBeChecked() {
final BaseSpnegoKnownClientSystemsFilterAction action =
new BaseSpnegoKnownClientSystemsFilterAction("^74\\.125\\..+", "alternateRemoteIp", 120);
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr("555.555.555.555");
req.addHeader("alternateRemoteIp", ALTERNATE_REMOTE_IP);
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
示例14: ensureHostnameShouldDoSpnego
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureHostnameShouldDoSpnego() {
final HostNameSpnegoKnownClientSystemsFilterAction action =
new HostNameSpnegoKnownClientSystemsFilterAction("", "", 0, "\\w+\\.\\w+\\.\\w+");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr(ALTERNATE_REMOTE_IP);
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}
示例15: ensureHostnameAndIpShouldDoSpnego
import org.springframework.webflow.action.EventFactorySupport; //导入依赖的package包/类
@Test
public void ensureHostnameAndIpShouldDoSpnego() {
final HostNameSpnegoKnownClientSystemsFilterAction action =
new HostNameSpnegoKnownClientSystemsFilterAction("74\\..+", "", 0, "\\w+\\.\\w+\\.\\w+");
final MockRequestContext ctx = new MockRequestContext();
final MockHttpServletRequest req = new MockHttpServletRequest();
req.setRemoteAddr(ALTERNATE_REMOTE_IP);
final ServletExternalContext extCtx = new ServletExternalContext(
new MockServletContext(), req,
new MockHttpServletResponse());
ctx.setExternalContext(extCtx);
final Event ev = action.doExecute(ctx);
assertEquals(ev.getId(), new EventFactorySupport().yes(this).getId());
}