SlideShare a Scribd company logo
Testing Your Application on / for
       Google App Engine
                          Narinder Kumar
                       Inphina Technologies




                                       1
Agenda
   Problem Context
   App Engine Testing Framework
       Local DataStore Testing
       Authentication API Testing
       Memcache Testing
   Google Cloud Cover – An Overview



                                       2
Easy to build, Easy to Maintain,
         Easy to Scale




                                   3
Why Testing
   To verify correctness
    of the code
   To be assured of
    continued
    correctness of old
    code
   To avoid surprises
   To safely make large
    refactorings
I feel sad and naked without Good Test Coverage
                              Max Ross (Member of Google App Engine Team)   4
Do we need App Engine Specific
     Testing Strategies ?




                                 5
Our Goal
To be able to test in our local environment using
   Spring
   Maven
   JPA/JDO
   JUnit
   Continuous Integration



                                                6
Google Infrastructure Services
   DataStore
   Memcache
   TaskQueue
   Authentication
   ...




                                       7
App Engine Testing Framework
   LocalServiceTestHelper
       LocalDataStoreServiceTestConfig
       LocalMemCacheServiceTestConfig
       LocalTaskQueueTestConfig
       LocalUserServiceTestConfig
       ...




                                          8
Local Data Store Testing




                           9
Step 1 : Make RunTime Libraries
        Available Locally
 <dependency>
     <groupid>com.google.appengine</groupid>
     <artifactid>appengine-testing</artifactid>
     <version>1.3.4</version>
     <scope>test</scope>
 </dependency>
 <dependency>
     <groupid>com.google.appengine</groupid>
     <artifactid>appengine-api-labs</artifactid>
     <version>1.3.4</version>
     <scope>test</scope>
 </dependency>
 <dependency>
     <groupid>com.google.appengine</groupid>
     <artifactid>appengine-api-stubs</artifactid>
     <version>1.3.4</version>
     <scope>test</scope>
 </dependency>


 Some of these libraries are not available in Central Maven
                        Repositories                          10
Step 2 : Enhance Domain Classes
 <plugin>
            <groupid>org.datanucleus</groupid>
            <artifactid>maven-datanucleus-plugin</artifactid>
            <version>1.1.4</version>
            <configuration>
            <mappingincludes>**/domain/*.class</mappingincludes>
                 <verbose>true</verbose>
                 <enhancername>ASM</enhancername>
                 <api>JPA</api>
            </configuration>
            <executions>
                 <execution>
                      <phase>compile</phase>
                      <goals>
                          <goal>enhance</goal>
                      </goals>
                 </execution>
            </executions>
 ......
 <plugin>
                                                                   11
Prepare Run-Time Environment
        and Dependencies
@RunWith(SpringJUnit4ClassRunner.class)
@TestExecutionListeners( { DependencyInjectionTestExecutionListener.class })
@ContextConfiguration(locations = { "classpath:test-applicationContext.xml",
"classpath:test-applicationContext-dao.xml"})
public class LocalDatastoreSpringTestCase extends TestCase {

  private final LocalServiceTestHelper helper =
     new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());

  @Before
  public void setUp() {
    helper.setUp();
  }

  @After
  public void tearDown() {
    helper.tearDown();
  }


                                                                               12
Write Specific Tests
public class EmployeeDaoSpringTest extends LocalDatastoreSpringTestCase {

    @Autowired
    private EmployeeDao employeeDao;

    @Test
    public void testShouldPersistEmployee() {
         Employee employee = new Employee();
         employee.setFirstName("Scott");
         employee.setLastName("Adams");
         employee.setHireDate(new Date());

        employeeDao.createEmployee(employee);

        Collection<employee> list = employeeDao.list();

        Assert.assertEquals(1, list.size());
    }


                                                                            13
Authentication API Testing
public class AuthenticationTest {

    private final LocalServiceTestHelper helper =
       new LocalServiceTestHelper(new LocalUserServiceTestConfig())
         .setEnvIsAdmin(true).setEnvIsLoggedIn(true);

    @Test
    public void testIsAdmin() {
      UserService userService = UserServiceFactory.getUserService();
      assertTrue(userService.isUserAdmin());
    }

    @Before
    public void setUp() {
      helper.setUp();
    }

    @After
    public void tearDown() {
      helper.tearDown();
    }
}
                                                                       14
Memcache Testing
public class LocalMemcacheTest {

       private final LocalServiceTestHelper helper =
          new LocalServiceTestHelper(new LocalMemcacheServiceTestConfig());

       @Test
       private void testInsert() {
          MemcacheService ms = MemcacheServiceFactory.getMemcacheService();
          assertFalse(ms.contains("yar"));
          ms.put("yar", "foo");
          assertTrue(ms.contains("yar"));
       }}

....
       // SetUp and Tear Down




                                                                              15
Google Cloud Cover – An Overview




                                   16
Key Features
   Provides ability to run your tests in Cloud
   Designed to run Existing Test Suites
   Tests Execute in Parallel
       Creates one Task Queue per Test
       Number of workers determined by Queue Config
   Allows to Run Large Test Suites faster : Acts as
    a Test Grid


                                                       17
How to Set it up
   Create a Standard GAE/J web application with
    all Production Code & Test Code and
    dependencies
   Add Cloud Cover Dependencies to WAR
   Create a TestRunner Config around your Test
    Suite
   Add Cloud Cover Servlet
      http://<your_app_id>/cloudcover.html

                                                  18
Google Cloud Cover in Action




                               19
Different from Normal Testing
   Each Test must complete in 30 seconds

   Application Code and Test Code must obey

    Sandbox restrictions

   Need to invoke Tests via HTTP



                                               20
Conclusions
   Local RunTime Environment very helpful

    during Development Phase

   Google Cloud Cover can be a good aid in

    certain areas but need more refinement



                                              21
nkumar@inphina.com

      www.inphina.com
http://thoughts.inphina.com


                              22
References
   http://code.google.com/appengine/docs/java/tools/localunittesting.html

   http://code.google.com/p/cloudcover/

   http://thoughts.inphina.com/2010/06/28/unit-testing-maven-based-jpa-application-on-gae/

   http://objectuser.wordpress.com/category/software-development/google-app-engine/

   http://code.google.com/events/io/2010/sessions.html#App%20Engine




                                                                                        23

More Related Content

What's hot

Hyper-pragmatic Pure FP testing with distage-testkit
Hyper-pragmatic Pure FP testing with distage-testkitHyper-pragmatic Pure FP testing with distage-testkit
Hyper-pragmatic Pure FP testing with distage-testkit
7mind
 
Release With Maven
Release With MavenRelease With Maven
Release With Maveneugenn
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Julian Robichaux
 
Integration Testing With ScalaTest and MongoDB
Integration Testing With ScalaTest and MongoDBIntegration Testing With ScalaTest and MongoDB
Integration Testing With ScalaTest and MongoDB
Michal Bigos
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
Chiew Carol
 
Managed Beans: When, Why and How
Managed Beans: When, Why and HowManaged Beans: When, Why and How
Managed Beans: When, Why and How
Russell Maher
 
Chef for beginners module 2
Chef for beginners   module 2Chef for beginners   module 2
Chef for beginners module 2
Chef
 
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
7mind
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
chrisb206 chrisb206
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: Gradle
Skills Matter
 
Jdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsJdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsMert Çalışkan
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
 
Springboot2 postgresql-jpa-hibernate-crud-example with test
Springboot2 postgresql-jpa-hibernate-crud-example with testSpringboot2 postgresql-jpa-hibernate-crud-example with test
Springboot2 postgresql-jpa-hibernate-crud-example with test
HyukSun Kwon
 
Chef for beginners module 1
Chef for beginners   module 1Chef for beginners   module 1
Chef for beginners module 1
Chef
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
SFI
 
Chef for beginners module 5
Chef for beginners   module 5Chef for beginners   module 5
Chef for beginners module 5
Chef
 
Maven plugin guide using Modello Framework
Maven plugin guide using Modello FrameworkMaven plugin guide using Modello Framework
Maven plugin guide using Modello Framework
fulvio russo
 
Maven basics
Maven basicsMaven basics
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
Andres Almiray
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
haruki ueno
 

What's hot (20)

Hyper-pragmatic Pure FP testing with distage-testkit
Hyper-pragmatic Pure FP testing with distage-testkitHyper-pragmatic Pure FP testing with distage-testkit
Hyper-pragmatic Pure FP testing with distage-testkit
 
Release With Maven
Release With MavenRelease With Maven
Release With Maven
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
 
Integration Testing With ScalaTest and MongoDB
Integration Testing With ScalaTest and MongoDBIntegration Testing With ScalaTest and MongoDB
Integration Testing With ScalaTest and MongoDB
 
AngularJS Unit Test
AngularJS Unit TestAngularJS Unit Test
AngularJS Unit Test
 
Managed Beans: When, Why and How
Managed Beans: When, Why and HowManaged Beans: When, Why and How
Managed Beans: When, Why and How
 
Chef for beginners module 2
Chef for beginners   module 2Chef for beginners   module 2
Chef for beginners module 2
 
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
distage: Purely Functional Staged Dependency Injection; bonus: Faking Kind Po...
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: Gradle
 
Jdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsJdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent Projects
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Springboot2 postgresql-jpa-hibernate-crud-example with test
Springboot2 postgresql-jpa-hibernate-crud-example with testSpringboot2 postgresql-jpa-hibernate-crud-example with test
Springboot2 postgresql-jpa-hibernate-crud-example with test
 
Chef for beginners module 1
Chef for beginners   module 1Chef for beginners   module 1
Chef for beginners module 1
 
JPQL/ JPA Activity 1
JPQL/ JPA Activity 1JPQL/ JPA Activity 1
JPQL/ JPA Activity 1
 
Chef for beginners module 5
Chef for beginners   module 5Chef for beginners   module 5
Chef for beginners module 5
 
Maven plugin guide using Modello Framework
Maven plugin guide using Modello FrameworkMaven plugin guide using Modello Framework
Maven plugin guide using Modello Framework
 
Maven basics
Maven basicsMaven basics
Maven basics
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
 

Similar to Testing your application on Google App Engine

Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
Francesco Marchitelli
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
Luke Maung
 
Resume_sindhu
Resume_sindhu Resume_sindhu
Resume_sindhu Sindhu B
 
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
Tobias Schneck
 
Junit_.pptx
Junit_.pptxJunit_.pptx
Junit_.pptx
Suman Sourav
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
Javan Rasokat
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
shadabgilani
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
Jitendra Bafna
 
Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016
Yves Hoppe
 
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic
 
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfDevfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
KAI CHU CHUNG
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdf
Red Hat
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers Make
Mark Meyer
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018
Ortus Solutions, Corp
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
davejohnson
 
Firebase analytics event_201607
Firebase analytics event_201607Firebase analytics event_201607
Firebase analytics event_201607
PRADA Hsiung
 
JBCN_Testing_With_Containers
JBCN_Testing_With_ContainersJBCN_Testing_With_Containers
JBCN_Testing_With_Containers
Grace Jansen
 
Unit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSUnit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJS
Knoldus Inc.
 

Similar to Testing your application on Google App Engine (20)

Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
 
Android UI Testing with Appium
Android UI Testing with AppiumAndroid UI Testing with Appium
Android UI Testing with Appium
 
Resume_sindhu
Resume_sindhu Resume_sindhu
Resume_sindhu
 
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
UI Testing - Selenium? Rich-Clients? Containers? (SwanseaCon 2018)
 
Junit_.pptx
Junit_.pptxJunit_.pptx
Junit_.pptx
 
Pyramid deployment
Pyramid deploymentPyramid deployment
Pyramid deployment
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Protractor framework architecture with example
Protractor framework architecture with exampleProtractor framework architecture with example
Protractor framework architecture with example
 
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
MuleSoft Nashik Virtual Meetup#4 - Implementing CI/CD pipeline for deploying ...
 
Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016Joomla! Testing - J!DD Germany 2016
Joomla! Testing - J!DD Germany 2016
 
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
 
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdfDevfest 2023 - Service Weaver Introduction - Taipei.pdf
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdf
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers Make
 
Codeception
CodeceptionCodeception
Codeception
 
Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018Testing for fun in production Into The Box 2018
Testing for fun in production Into The Box 2018
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
Firebase analytics event_201607
Firebase analytics event_201607Firebase analytics event_201607
Firebase analytics event_201607
 
JBCN_Testing_With_Containers
JBCN_Testing_With_ContainersJBCN_Testing_With_Containers
JBCN_Testing_With_Containers
 
Unit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSUnit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJS
 

More from Inphina Technologies

Scala test
Scala testScala test
Easy ORMness with Objectify-Appengine
Easy ORMness with Objectify-AppengineEasy ORMness with Objectify-Appengine
Easy ORMness with Objectify-Appengine
Inphina Technologies
 
Cloud Foundry Impressions
Cloud Foundry Impressions Cloud Foundry Impressions
Cloud Foundry Impressions
Inphina Technologies
 
Cloud slam2011 multi-tenancy
Cloud slam2011 multi-tenancyCloud slam2011 multi-tenancy
Cloud slam2011 multi-tenancy
Inphina Technologies
 
Google appenginemigrationcasestudy
Google appenginemigrationcasestudyGoogle appenginemigrationcasestudy
Google appenginemigrationcasestudyInphina Technologies
 
Inphina at a glance
Inphina at a glanceInphina at a glance
Inphina at a glance
Inphina Technologies
 
Inphina cloud
Inphina cloudInphina cloud
Inphina cloud
Inphina Technologies
 
Multi-tenancy in the cloud
Multi-tenancy in the cloudMulti-tenancy in the cloud
Multi-tenancy in the cloud
Inphina Technologies
 
Preparing your data for the cloud
Preparing your data for the cloudPreparing your data for the cloud
Preparing your data for the cloud
Inphina Technologies
 
Getting started with jClouds
Getting started with jCloudsGetting started with jClouds
Getting started with jClouds
Inphina Technologies
 

More from Inphina Technologies (13)

Scala collections
Scala collectionsScala collections
Scala collections
 
Scala test
Scala testScala test
Scala test
 
Easy ORMness with Objectify-Appengine
Easy ORMness with Objectify-AppengineEasy ORMness with Objectify-Appengine
Easy ORMness with Objectify-Appengine
 
Cloud Foundry Impressions
Cloud Foundry Impressions Cloud Foundry Impressions
Cloud Foundry Impressions
 
Cloud slam2011 multi-tenancy
Cloud slam2011 multi-tenancyCloud slam2011 multi-tenancy
Cloud slam2011 multi-tenancy
 
Google appenginemigrationcasestudy
Google appenginemigrationcasestudyGoogle appenginemigrationcasestudy
Google appenginemigrationcasestudy
 
Preparing yourdataforcloud
Preparing yourdataforcloudPreparing yourdataforcloud
Preparing yourdataforcloud
 
Multi-Tenancy in the Cloud
Multi-Tenancy in the CloudMulti-Tenancy in the Cloud
Multi-Tenancy in the Cloud
 
Inphina at a glance
Inphina at a glanceInphina at a glance
Inphina at a glance
 
Inphina cloud
Inphina cloudInphina cloud
Inphina cloud
 
Multi-tenancy in the cloud
Multi-tenancy in the cloudMulti-tenancy in the cloud
Multi-tenancy in the cloud
 
Preparing your data for the cloud
Preparing your data for the cloudPreparing your data for the cloud
Preparing your data for the cloud
 
Getting started with jClouds
Getting started with jCloudsGetting started with jClouds
Getting started with jClouds
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

Testing your application on Google App Engine

  • 1. Testing Your Application on / for Google App Engine Narinder Kumar Inphina Technologies 1
  • 2. Agenda  Problem Context  App Engine Testing Framework  Local DataStore Testing  Authentication API Testing  Memcache Testing  Google Cloud Cover – An Overview 2
  • 3. Easy to build, Easy to Maintain, Easy to Scale 3
  • 4. Why Testing  To verify correctness of the code  To be assured of continued correctness of old code  To avoid surprises  To safely make large refactorings I feel sad and naked without Good Test Coverage Max Ross (Member of Google App Engine Team) 4
  • 5. Do we need App Engine Specific Testing Strategies ? 5
  • 6. Our Goal To be able to test in our local environment using  Spring  Maven  JPA/JDO  JUnit  Continuous Integration 6
  • 7. Google Infrastructure Services  DataStore  Memcache  TaskQueue  Authentication  ... 7
  • 8. App Engine Testing Framework  LocalServiceTestHelper  LocalDataStoreServiceTestConfig  LocalMemCacheServiceTestConfig  LocalTaskQueueTestConfig  LocalUserServiceTestConfig  ... 8
  • 9. Local Data Store Testing 9
  • 10. Step 1 : Make RunTime Libraries Available Locally <dependency> <groupid>com.google.appengine</groupid> <artifactid>appengine-testing</artifactid> <version>1.3.4</version> <scope>test</scope> </dependency> <dependency> <groupid>com.google.appengine</groupid> <artifactid>appengine-api-labs</artifactid> <version>1.3.4</version> <scope>test</scope> </dependency> <dependency> <groupid>com.google.appengine</groupid> <artifactid>appengine-api-stubs</artifactid> <version>1.3.4</version> <scope>test</scope> </dependency> Some of these libraries are not available in Central Maven Repositories 10
  • 11. Step 2 : Enhance Domain Classes <plugin> <groupid>org.datanucleus</groupid> <artifactid>maven-datanucleus-plugin</artifactid> <version>1.1.4</version> <configuration> <mappingincludes>**/domain/*.class</mappingincludes> <verbose>true</verbose> <enhancername>ASM</enhancername> <api>JPA</api> </configuration> <executions> <execution> <phase>compile</phase> <goals> <goal>enhance</goal> </goals> </execution> </executions> ...... <plugin> 11
  • 12. Prepare Run-Time Environment and Dependencies @RunWith(SpringJUnit4ClassRunner.class) @TestExecutionListeners( { DependencyInjectionTestExecutionListener.class }) @ContextConfiguration(locations = { "classpath:test-applicationContext.xml", "classpath:test-applicationContext-dao.xml"}) public class LocalDatastoreSpringTestCase extends TestCase { private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig()); @Before public void setUp() { helper.setUp(); } @After public void tearDown() { helper.tearDown(); } 12
  • 13. Write Specific Tests public class EmployeeDaoSpringTest extends LocalDatastoreSpringTestCase { @Autowired private EmployeeDao employeeDao; @Test public void testShouldPersistEmployee() { Employee employee = new Employee(); employee.setFirstName("Scott"); employee.setLastName("Adams"); employee.setHireDate(new Date()); employeeDao.createEmployee(employee); Collection<employee> list = employeeDao.list(); Assert.assertEquals(1, list.size()); } 13
  • 14. Authentication API Testing public class AuthenticationTest { private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalUserServiceTestConfig()) .setEnvIsAdmin(true).setEnvIsLoggedIn(true); @Test public void testIsAdmin() { UserService userService = UserServiceFactory.getUserService(); assertTrue(userService.isUserAdmin()); } @Before public void setUp() { helper.setUp(); } @After public void tearDown() { helper.tearDown(); } } 14
  • 15. Memcache Testing public class LocalMemcacheTest { private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalMemcacheServiceTestConfig()); @Test private void testInsert() { MemcacheService ms = MemcacheServiceFactory.getMemcacheService(); assertFalse(ms.contains("yar")); ms.put("yar", "foo"); assertTrue(ms.contains("yar")); }} .... // SetUp and Tear Down 15
  • 16. Google Cloud Cover – An Overview 16
  • 17. Key Features  Provides ability to run your tests in Cloud  Designed to run Existing Test Suites  Tests Execute in Parallel  Creates one Task Queue per Test  Number of workers determined by Queue Config  Allows to Run Large Test Suites faster : Acts as a Test Grid 17
  • 18. How to Set it up  Create a Standard GAE/J web application with all Production Code & Test Code and dependencies  Add Cloud Cover Dependencies to WAR  Create a TestRunner Config around your Test Suite  Add Cloud Cover Servlet http://<your_app_id>/cloudcover.html 18
  • 19. Google Cloud Cover in Action 19
  • 20. Different from Normal Testing  Each Test must complete in 30 seconds  Application Code and Test Code must obey Sandbox restrictions  Need to invoke Tests via HTTP 20
  • 21. Conclusions  Local RunTime Environment very helpful during Development Phase  Google Cloud Cover can be a good aid in certain areas but need more refinement 21
  • 22. nkumar@inphina.com www.inphina.com http://thoughts.inphina.com 22
  • 23. References  http://code.google.com/appengine/docs/java/tools/localunittesting.html  http://code.google.com/p/cloudcover/  http://thoughts.inphina.com/2010/06/28/unit-testing-maven-based-jpa-application-on-gae/  http://objectuser.wordpress.com/category/software-development/google-app-engine/  http://code.google.com/events/io/2010/sessions.html#App%20Engine 23