Examples of SWITCH


Examples of org.springmodules.validation.util.Switch

        ValidationContextFilter filter = new ValidationContextFilter();
        filter.setValidationContextUrlMappings(mappings);

        filter.afterPropertiesSet();

        final Switch filterCallSwitch = new Switch();
        FilterChain filterChain = new FilterChain() {
            public void doFilter(ServletRequest req, ServletResponse res) {
                filterCallSwitch.turnOn();
                assertFalse(ValidationContextUtils.tokensSupportedByCurrentContext(new String[] { "ctx1", "ctx2" }));
                assertTrue(DefaultValidationContext.class.isInstance(ValidationContextHolder.getValidationContext()));
                DefaultValidationContext context = (DefaultValidationContext)ValidationContextHolder.getValidationContext();
                assertEquals(0, context.getTokens().length);
            }
        };

        MockHttpServletRequest request = new MockHttpServletRequest("GET", "/user/test.html");
        MockHttpServletResponse response = new MockHttpServletResponse();
        filter.doFilterInternal(request, response, filterChain);

        assertTrue(filterCallSwitch.isOn()); // making sure the filter was called
    }
View Full Code Here

Examples of org.uengine.smcp.twister.engine.priv.core.definition.Switch

*/
public class SwitchDeployer extends ActivityDeployer {


    protected void processSpecificElements(Element element, Activity activity) throws DeploymentException {
        Switch aSwitch = (Switch) activity;
        for (Iterator i = element.elementIterator("case"); i.hasNext();) {
            Element caseElement = (Element) i.next();
            String s = caseElement.valueOf("@condition");
            log.debug("<case " +s +">");
            Element activityElement = getActivityElement(caseElement);
            log.debug("<" + activityElement.getName() + ">");
            ActivityDeployer ad = ActivityDeployerFactory.getActivityDeployer(activityElement.getName());
            aSwitch.addCondition(s, ad.deploy(activityElement, aSwitch));
            log.debug("</" + activityElement.getName() + ">");
            log.debug("</case>");
        }
        log.debug("<otherwise>");
        Element otherwiseElement = element.element("otherwise");
        Element activityElement = getActivityElement(otherwiseElement);
        log.debug("<" + activityElement.getName() + ">");
        ActivityDeployer ad = ActivityDeployerFactory.getActivityDeployer(activityElement.getName());
        aSwitch.setOtherwise(ad.deploy(activityElement, aSwitch));
        log.debug("</" + activityElement.getName() + ">");
        log.debug("</otherwise>");
        processChildren = false;
    }
View Full Code Here

Examples of railo.transformer.bytecode.statement.Switch

    comments(data);

    if(!data.cfml.forwardIfCurrent('{'))
      throw new TemplateException(data.cfml,"switch statement must have a starting  [{]");

    Switch swit=new Switch(expr,line,null);
   
    //  cases
     //Node child=null;
     comments(data);
     while(caseStatement(data,swit)) {
       comments(data);
     }
     // default
      if(defaultStatement(data,swit)) {
      comments(data);
      }
     
      while(caseStatement(data,swit)) {
         comments(data);
       }
     
     
    // }
    if(!data.cfml.forwardIfCurrent('}'))
      throw new TemplateException(data.cfml,"invalid construct in switch statement");
    swit.setEnd(data.cfml.getPosition());
    return swit;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.