Package com.google.appengine.tools.development

Examples of com.google.appengine.tools.development.ApiProxyLocal


    return this;
  }

  @Override
  public void setUp() {
    ApiProxyLocal proxy = LocalServiceTestHelper.getApiProxyLocal();
    proxy.setProperty(LocalBlobstoreService.NO_STORAGE_PROPERTY, noStorage.toString());
    if (backingStoreLocation != null) {
      proxy.setProperty(LocalBlobstoreService.BACKING_STORE_PROPERTY, backingStoreLocation);
    }
    getLocalBlobstoreService();
  }
View Full Code Here


public class PlayDevEnvironment implements Environment, LocalServerEnvironment {

    public static PlayDevEnvironment create() {
        PlayDevEnvironment instance = new PlayDevEnvironment();
        ApiProxyLocalFactory factory = new ApiProxyLocalFactory();
        ApiProxyLocal proxy = factory.create(instance);
        proxy.setProperty(
                LocalDatastoreService.BACKING_STORE_PROPERTY,
                Play.getFile("tmp/datastore").getAbsolutePath());
        ApiProxy.setDelegate(proxy);
        return instance;
    }
View Full Code Here

      DatastoreServiceFactory.getDatastoreService());

  @Override protected void setUp() throws Exception {
    super.setUp();
    helper.setUp();
    ApiProxyLocal proxy = (ApiProxyLocal) ApiProxy.getDelegate();
    // HACK(ohler): Work around "illegal blobKey" crash.
    proxy.setProperty(LocalBlobstoreService.NO_STORAGE_PROPERTY, "true");
  }
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    helper.setUp();
    taskQueue = LocalTaskQueueTestConfig.getLocalTaskQueue();
    ApiProxyLocal proxy = (ApiProxyLocal) ApiProxy.getDelegate();
    // Creating files is not allowed in some test execution environments, so don't.
    proxy.setProperty(LocalBlobstoreService.NO_STORAGE_PROPERTY, "true");
  }
View Full Code Here

    SystemProperty.version.set(new LocalVersionFactory(Collections.EMPTY_LIST).getVersion().getRelease());
   
    WebAppContext webappcontext = new WebAppContext();
      webappcontext.setContextPath("/");
      webappcontext.setWar(devEnvironment.getAppDir().getAbsolutePath());   
      ApiProxyLocal apriProxyLocal = (ApiProxyLocal) ApiProxy.getDelegate();
        webappcontext.setAttribute("com.google.appengine.devappserver.ApiProxyLocal", apriProxyLocal);
       
        //Mappings for servlets and jsps
        //classes are located in appengine-local-runtime-shared.jar -> packages org.apache.jsp.ah and com.google.apphosting.utils.servlet
        webappcontext.addServlet(DatastoreViewerServlet.class, "/_ah/admin");
View Full Code Here

public class PlayDevEnvironment implements Environment, LocalServerEnvironment {

    public static PlayDevEnvironment create() {
        PlayDevEnvironment instance = new PlayDevEnvironment();
        ApiProxyLocalFactory factory = new ApiProxyLocalFactory();
        ApiProxyLocal proxy = factory.create(instance);
    ApiProxy.setDelegate(proxy);

    proxy.setProperty(
            LocalDatastoreService.BACKING_STORE_PROPERTY,
            Play.getFile("tmp/datastore").getAbsolutePath());

        /* Commented this because using test configs poses problems in DEV mode

View Full Code Here

  public String hostName = "localhost";

  public void install()
  {
    final ApiProxyLocalFactory apiProxyLocalFactory = new ApiProxyLocalFactory();
    final ApiProxyLocal apiProxyLocal = apiProxyLocalFactory.create(this);
    ApiProxy.setDelegate(apiProxyLocal);
  }
View Full Code Here

        if (ApiProxy.getCurrentEnvironment() == null) {

            System.out
                    .println("No production App Engine environment found - starting local development environment");

            ApiProxyLocal proxy = factory.create(this);
            ApiProxy.setDelegate(proxy);


            // If we are in test mode we do not persist data to disk
            if (ninjaProperties.isTest()) {

                System.out
                        .println("In test mode - not saving Appengine data to disk");

                proxy.setProperty(LocalDatastoreService.NO_STORAGE_PROPERTY,
                        Boolean.toString(true));

            } else {
                // write to disk:

                /**
                 * Set the property in your profile. It should match the
                 * appengine's output dir. You can use both jetty:run and
                 * appengine:deverserver - and both use the same db.
                 *
                 */
                String appengineGeneratedDir = System
                        .getProperty("appengine.generated.dir");
                // in tests we output stuff to target:
                if (appengineGeneratedDir == null) {
                    appengineGeneratedDir = "target";
                }

                try {
                    Files.createParentDirs(new File(appengineGeneratedDir));
                } catch (IOException e) {
                    // something strange happened. Can not create parent dirs...
                    e.printStackTrace();
                }

                System.out.println("Local datastore at: "
                        + new File(appengineGeneratedDir + File.separator
                                + "local_db.bin").getAbsolutePath());

                proxy.setProperty(LocalDatastoreService.BACKING_STORE_PROPERTY,
                        new File(appengineGeneratedDir + File.separator
                                + "local_db.bin").getAbsolutePath());

            }

View Full Code Here

TOP

Related Classes of com.google.appengine.tools.development.ApiProxyLocal

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.