### Question:
NameBasedActionResolver extends AnnotatedClassActionResolver { @Override public String getUrlBinding(Class<? extends ActionBean> clazz) { String binding = super.getUrlBinding(clazz); if (binding == null && !Modifier.isAbstract(clazz.getModifiers())) { binding = getUrlBinding(clazz.getName()); } return binding; }  @Override void init(Configuration configuration); @Override String getUrlBinding(Class<? extends ActionBean> clazz); @Override String getHandledEvent(Method handler); static boolean isAsyncEventHandler(Method handler); @Override ActionBean getActionBean(ActionBeanContext context,
            String urlBinding); static final Set<String> BASE_PACKAGES; static final String DEFAULT_BINDING_SUFFIX; static final List<String> DEFAULT_ACTION_BEAN_SUFFIXES; }### Answer:
@Test(groups = "fast") public void generateBinding() { String binding = this.resolver.getUrlBinding("foo.bar.web.admin.ControlCenterActionBean"); Assert.assertEquals(binding, "/admin/ControlCenter.action"); }
@Test(groups = "fast") public void generateBindingForNonPackagedClass() { String binding = this.resolver.getUrlBinding("ControlCenterActionBean"); Assert.assertEquals(binding, "/ControlCenter.action"); }
@Test(groups = "fast") public void generateBindingForClassWithSingleBasePackage() { String binding = this.resolver.getUrlBinding("www.ControlCenterActionBean"); Assert.assertEquals(binding, "/ControlCenter.action"); }
@Test(groups = "fast") public void generateBindingWithMultipleBasePackages() { String binding = this.resolver.getUrlBinding("foo.web.stripes.bar.www.ControlCenterActionBean"); Assert.assertEquals(binding, "/ControlCenter.action"); }
@Test(groups = "fast") public void generateBindingWithMultipleBasePackages2() { String binding = this.resolver.getUrlBinding("foo.web.stripes.www.admin.ControlCenterActionBean"); Assert.assertEquals(binding, "/admin/ControlCenter.action"); }
@Test(groups = "fast") public void generateBindingWithoutSuffix() { String binding = this.resolver.getUrlBinding("foo.web.stripes.www.admin.ControlCenter"); Assert.assertEquals(binding, "/admin/ControlCenter.action"); }
@Test(groups = "fast") public void generateBindingWithDifferentSuffix() { String binding = this.resolver.getUrlBinding("foo.web.stripes.www.admin.ControlCenterBean"); Assert.assertEquals(binding, "/admin/ControlCenter.action"); }
@Test(groups = "fast") public void generateBindingWithDifferentSuffix2() { String binding = this.resolver.getUrlBinding("foo.web.stripes.www.admin.ControlCenterAction"); Assert.assertEquals(binding, "/admin/ControlCenter.action"); }
@Test(groups = "fast") public void testWithAnnotatedClass() { String name = net.sourceforge.stripes.test.TestActionBean.class.getName(); String binding = this.resolver.getUrlBinding(name); Assert.assertEquals(binding, "/test/Test.action"); binding = this.resolver.getUrlBinding(net.sourceforge.stripes.test.TestActionBean.class); Assert.assertEquals(binding, net.sourceforge.stripes.test.TestActionBean.class. getAnnotation(UrlBinding.class).value()); }