Package org.soybeanMilk.web.config.parser

Examples of org.soybeanMilk.web.config.parser.WebConfigurationParser


  private DefaultWebExecutor webExecutor;
 
  @Before
  public void setUp() throws Exception
  {
    WebConfigurationParser parser=new WebConfigurationParser(null);
    parser.parse("org/soybeanMilk/test/unit/web/TestDefaultWebExecutor.xml");
   
    WebConfiguration webConfiguration= parser.getWebConfiguration();
   
    webExecutor=new DefaultWebExecutor(webConfiguration);
  }
View Full Code Here


    WebConfiguration webConfiguration=new WebConfiguration();
    webConfiguration.setResolverObjectFactory(rf);
   
    String configFileName=getInitParameter(WebConstants.ServletInitParams.SOYBEAN_MILK_CONFIG);
   
    WebConfigurationParser parser=new WebConfigurationParser(webConfiguration,getServletContext());
    parser.parse(configFileName);
   
    we=new DefaultWebExecutor(webConfiguration);
   
    return we;
  }
View Full Code Here

 
  @Test
  public void parse_targetHandler() throws Exception
  {
    {
      WebConfigurationParser parser=new WebConfigurationParser(null);
      parser.parse("org/soybeanMilk/test/unit/web/TestWebConfigurationParser-0.xml");
     
      WebConfiguration webConfiguration= parser.getWebConfiguration();
     
      Assert.assertEquals(DefaultTypeTargetHandler.class,
          webConfiguration.getTypeTargetHandler().getClass());
     
      Assert.assertEquals(JsonTargetHandler.class,
          webConfiguration.getTypeTargetHandler().getTargetHandler("json").getClass());
     
      Assert.assertEquals(JsonTargetHandler.class,
          webConfiguration.getTypeTargetHandler().getTargetHandler("forward").getClass());
     
      Assert.assertEquals(RedirectTargetHandler.class,
          webConfiguration.getTypeTargetHandler().getTargetHandler("redirect").getClass());
     
      TargetHandler multi= webConfiguration.getTypeTargetHandler().getTargetHandler("pdf");
      Assert.assertEquals(JsonTargetHandler.class, multi.getClass());
      Assert.assertTrue( multi ==  webConfiguration.getTypeTargetHandler().getTargetHandler("mp3"));
      Assert.assertTrue( multi ==  webConfiguration.getTypeTargetHandler().getTargetHandler("JPEG"));
    }
   
    {
      WebConfigurationParser parser=new WebConfigurationParser(null);
      parser.parse("org/soybeanMilk/test/unit/web/TestWebConfigurationParser-1.xml");
     
      WebConfiguration webConfiguration= parser.getWebConfiguration();
     
      Assert.assertEquals(MyTypeTargetHandler.class,
          webConfiguration.getTypeTargetHandler().getClass());
     
      Assert.assertEquals(JsonTargetHandler.class,
View Full Code Here

  }
 
  @Test
  public void parse_target() throws Exception
  {
    WebConfigurationParser parser=new WebConfigurationParser(null);
    parser.parse("org/soybeanMilk/test/unit/web/TestWebConfigurationParser-0.xml");
   
    WebConfiguration webConfiguration= parser.getWebConfiguration();
   
    {
      WebAction ac=(WebAction)webConfiguration.getExecutable("exe0");
      Assert.assertNull(ac.getTarget().getUrl());
      Assert.assertEquals(Target.FORWARD, ac.getTarget().getType());
View Full Code Here

  AbstractTargetHandler abstractTargetHandler;
 
  @Before
  public void setUp() throws Exception
  {
    WebConfigurationParser parser=new WebConfigurationParser(null);
    parser.parse("org/soybeanMilk/test/unit/web/TestAbstractTargetHandler.xml");
   
    webConfiguration= parser.getWebConfiguration();
   
    abstractTargetHandler=new MockAbstractTargetHandler();
  }
View Full Code Here

TOP

Related Classes of org.soybeanMilk.web.config.parser.WebConfigurationParser

Copyright © 2018 www.massapicom. 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.