Package org.springframework.context.support

Examples of org.springframework.context.support.FileSystemXmlApplicationContext


public class PropertyPlaceholderTest extends TestCase {

    public void test() throws Throwable {
        System.setProperty("port2", "3333");
       
        FileSystemXmlApplicationContext ctx = new FileSystemXmlApplicationContext(
                "src/test/resources/spring-config/config-property-placeholder.xml");

        DefaultFtpServer server = (DefaultFtpServer) ctx.getBean("server");

        assertEquals(2222, server.getListener("listener0").getPort());
        assertEquals(3333, server.getListener("listener1").getPort());
    }
View Full Code Here


   // FileSystemXmlApplicationContext appCtx =
     //   new FileSystemXmlApplicationContext("file:" + springFile.getAbsolutePath());
    //return (Collection<FacetHandler<?>>) appCtx.getBean("handlers");
   
    Set<Entry<Class<?>,Object>> entries = workArea.map.entrySet();
      FileSystemXmlApplicationContext appCtx = new FileSystemXmlApplicationContext();
      for (Entry<Class<?>,Object> entry : entries){
      Object obj = entry.getValue();
      if (obj instanceof ClassLoader){
        appCtx.setClassLoader((ClassLoader)obj);
          break;
      }
    }
   
      String absolutePath = file.getAbsolutePath();
      String partOne = absolutePath.substring(0, absolutePath.lastIndexOf("/"));
      String partTwo = URLEncoder.encode(absolutePath.substring(absolutePath.lastIndexOf("/") + 1), "UTF-8");
      absolutePath = partOne + "/" + partTwo;
     
      File springFile = new File(new File(absolutePath), SPRING_CONFIG);
      appCtx.setConfigLocation("file:" + springFile.getAbsolutePath());
      appCtx.refresh();
     
      return (Collection<FacetHandler<?>>) appCtx.getBean("handlers");

  }
View Full Code Here

    List<FacetHandler<?>> fConf=null;
   
    Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
    ApplicationContext appCtx=null;
    try{
      appCtx=new FileSystemXmlApplicationContext("file:"+fConfFile.getAbsolutePath());
      fConf =  (List<FacetHandler<?>>)appCtx.getBean("handlers");
    }
    catch(Exception e){
      throw new BuildException(e.getMessage(),e);
    }
View Full Code Here

    ApplicationContext context = null;
   
  public void setUp() throws Exception{
   
   
    context = new FileSystemXmlApplicationContext(TEST_APP_CONTEXT);
   
  }
View Full Code Here

     * DOCUMENT ME!
     *
     * @throws IOException DOCUMENT ME!
     */
    public void setUp() throws IOException {
        ac = new FileSystemXmlApplicationContext(
                "/net/fp/rp/search/ui/web/personalengine-servlet.xml");
    }
View Full Code Here

    //The application context used by this test
    ApplicationContext context = null;
   
  public void setUp() throws Exception{
   
    context = new FileSystemXmlApplicationContext(TEST_APP_CONTEXT);
  }
View Full Code Here

    ApplicationContext context = null;
   
  public void setUp() throws Exception{
   
   
    context = new FileSystemXmlApplicationContext(TEST_APP_CONTEXT);
   
  }
View Full Code Here

     * Get the (Test) Context from the file
     */
  public void setUp() throws Exception{
   
   
    context = new FileSystemXmlApplicationContext(TEST_APP_CONTEXT);
   
  }
View Full Code Here

    System.setProperty("rp.root","red-adaptive-search/tmp");
   
    File myFile = new File(".");
    log.debug(myFile.getAbsolutePath());
   
    ApplicationContext context = new FileSystemXmlApplicationContext(
        "red-adaptive-search/war/WEB-INF/simple/appContext.xml");

    // get the knowledgemanager
    knowledgeManager = (KnowledgeSphereManager) context
        .getBean(Config.KNOWLEDGEMANAGER_PLUGINNAME);

  }
View Full Code Here

import org.springframework.context.support.FileSystemXmlApplicationContext;

public class Demo {
    public static void main(String[] args) {
        ApplicationContext ctx =
            new FileSystemXmlApplicationContext(
                    "resources/applicationContext.xml");
        Evaluator e = null;
        boolean ok;
       
        for (int i = 0; i < 10; i++) {
            e = (Evaluator) ctx.getBean("groovyEvaluator");
            ok = e.approve(null);
            System.out.println(ok ? "approved" : "denied");
           
            try {
                Thread.sleep(1000);
View Full Code Here

TOP

Related Classes of org.springframework.context.support.FileSystemXmlApplicationContext

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.