Package org.apache.uima.simpleserver.servlet

Examples of org.apache.uima.simpleserver.servlet.SimpleServerServlet


    // Add servlets
    JettyUtils.addServletWithMapping(server, HelloServlet.class, "/hello");

    // Set up UIMA servlet
    SimpleServerServlet uimaServlet = new SimpleServerServlet(true);
    File descriptorFile = JUnitExtension.getFile("desc/simpleServerTestDescriptor.xml");
    assertTrue(descriptorFile.exists());
    File specFile = JUnitExtension.getFile("serverspec/spec1.xml");
    assertTrue(specFile.exists());
    try {
      uimaServlet.init(descriptorFile, specFile);
    } catch (ServletException e1) {
      e1.printStackTrace();
      assertTrue(false);
    }
    JettyUtils.addServletWithMapping(server, uimaServlet, "/uima");
   
    // Set up config-less UIMA servlet
    SimpleServerServlet uimaNoConfigServlet = new SimpleServerServlet(true);
    try {
      uimaNoConfigServlet.init(descriptorFile, null);
    } catch (ServletException e1) {
      e1.printStackTrace();
      assertTrue(false);
    }
    JettyUtils.addServletWithMapping(server, uimaNoConfigServlet, "/uima-no-config");
View Full Code Here


  public void uimaServiceNotInitialized() {
    Server server = JettyUtils.createServer();
    assertNotNull(server);
    String pathSpec = "/notinitialized";
    // Create a simple service but don't initialize it (should throw http error 500 when called)
    JettyUtils.addServletWithMapping(server, new SimpleServerServlet(true), pathSpec);
    try {
      server.start();
    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(false);
View Full Code Here

  public static final Server startJettyServer(String analysisEngineDescriptor, String mappingFile)
      throws Exception {
    // Create Jetty server
    Server server = createServer();
    // Set up UIMA servlet
    SimpleServerServlet uimaServlet = new SimpleServerServlet(true);
    File descriptorFile = new File(analysisEngineDescriptor);
    File specFile = new File(mappingFile);
    uimaServlet.init(descriptorFile, specFile);
    // Add UIMA servlet to jetty
    JettyUtils.addServletWithMapping(server, uimaServlet, uimaServletUrlFile);
    // Start the server
    server.start();
    return server;
View Full Code Here

    // Add servlets
    JettyUtils.addServletWithMapping(server, HelloServlet.class, "/hello");

    // Set up UIMA servlet
    SimpleServerServlet uimaServlet = new SimpleServerServlet(true);
    File descriptorFile = JUnitExtension.getFile("desc/simpleServerTestDescriptor.xml");
    assertTrue(descriptorFile.exists());
    File specFile = JUnitExtension.getFile("serverspec/spec01.xml");
    assertTrue(specFile.exists());
    try {
      uimaServlet.init(descriptorFile, specFile);
    } catch (ServletException e1) {
      e1.printStackTrace();
      assertTrue(false);
    }
    JettyUtils.addServletWithMapping(server, uimaServlet, "/uima");
   
    // Set up config-less UIMA servlet
    SimpleServerServlet uimaNoConfigServlet = new SimpleServerServlet(true);
    try {
      uimaNoConfigServlet.init(descriptorFile, null);
    } catch (ServletException e1) {
      e1.printStackTrace();
      assertTrue(false);
    }
    JettyUtils.addServletWithMapping(server, uimaNoConfigServlet, "/uima-no-config");
View Full Code Here

TOP

Related Classes of org.apache.uima.simpleserver.servlet.SimpleServerServlet

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.