© 2014, Glarimy. All rights reserved. G l a r i m y.

Slides:



Advertisements
Similar presentations
Chapter 17: WEB COMPONENTS
Advertisements

Java Script Session1 INTRODUCTION.
© 2014 IBM Corporation Empowering the IBM ecosystem Introduction to Developing applications using node.js on Bluemix IBM Ecosystem Development Instructors.
Rendezvous – a DIY VPN (profiting from mobile access to the enterprise) Rendezvous Server ET bjecvalu O.
Exchange server Mail system Four components Mail user agent (MUA) to read and compose mail Mail transport agent (MTA) route messages Delivery agent.
Current Topics in Programming Languages Lecture 15_1 George Koutsogiannakis SUMMER
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Copyright 2003 CCNA 1 Chapter 7 TCP/IP Protocol Suite and IP Addressing By Your Name.
Understanding and Managing WebSphere V5
16.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 16: Examining Software Update.
UNIT-V The MVC architecture and Struts Framework.
Week #10 Objectives: Remote Access and Mobile Computing Configure Mobile Computer and Device Settings Configure Remote Desktop and Remote Assistance for.
Managing Client Access
October 10, 2014 Coding For UX : Part 1 localhost 45 Main St #220 BKLN / / hugeinc.com.
Course 201 – Administration, Content Inspection and SSL VPN
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Copyright © 2009 On The Edge Software Consulting Advanced Enterprise Java Instructional Plan Presentation Tier Design using an Event Driven Design Methodology.
Zero to Testing in JavaScript Basics of testing in JS.
Philly.NET Hands-on Labs JAVASCRIPT SERIES. July 9: JavaScript Syntax Visual Studio ◦Projects ◦Editors ◦Debugging ◦Script blocks ◦Minification and bundling.
1 CHAPTER 1 OVERVIEW of JDEVELOPER. 2 Overview of JDeveloper Oracle’s JDeveloper 10g (JDeveloper) is an integrated development environment for Java programming.
IBM Express Runtime Quick Start Workshop © 2007 IBM Corporation Install IBM Express Runtime Development Environment.
12 September 2015 CCENT ICND1 Exam Topics Review TCP/IP and OSI Networking Models.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Instant Messaging for the Workplace A pure collaborative communication tool that does not distract users from their normal activities.
Module 8 Configuring Mobile Computing and Remote Access in Windows® 7.
Krishna & Surekha Glarimy Technology Services. Agenda What is XML What is NOT XML Applications of XML XML Jargon XML Eco System.
Krishna Mohan Koyya Glarimy Technology Services
G l a r I m y Presentation on Apache Struts 2.3 Krishna Mohan Koyya Proprietor & Principle Consultant Glarimy Technology Services | Benguluru | Bharat.
Selenium and Selenium on Rails. Agenda  Overview of Selenium Simple Selenium Tests Selenium IDE  Overview of Selenium on Rails  Problems with Selenium.
Using oXygen 12 with XQuery Using oXygen to build and execute XQuery XQuery applications on eXist Date: April 2011 Dan McCreary President Dan McCreary.
General rules 1. Rule: 2. Rule: 3. Rule: 10. Rule: Ask questions ……………………. 11. Rule: I do not know your skill. If I tell you things you know, please stop.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Unit Testing in JavaScript with Mocha, Chai and Karma SoftUni Team Technical Trainers Software University
Alok Guha Unit Testing Framework for JavaScript.
JavaScript Unit Test by MinHo Kim (Dexter Developer Guide)
Don’t Duck Metadata March 2005 Introducing Setting Up a Clearinghouse Node Topic: Introduction to Setting Up a Clearinghouse Node Objective: By.
Presentation Title Subtitle DSpace UI Prototype 7 Spring, Angular.js, and the DSpace REST API.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 9: Dynamic Host Configuration Protocol (DHCP)
Hands-On Microsoft Windows Server 2008 Chapter 5 Configuring Windows Server 2008 Printing.
Selenium server By, Kartikeya Rastogi Mayur Sapre Mosheca. R
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
05 | Integrating JavaScript and MVC 4 Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
 Has computer technology knowledge and programming expertise  Understands business problems  Uses logical methods for solving problems  Has fundamental.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
COMM 3050 – Online Project Update. Project Roles  Organizer Responsible for creating Zoom account technical aspects and posting recorded meeting to S:
Wednesday NI Vision Sessions
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
UNIT TESTING IN ANGULARJS Dhananjay
Microsoft Virtual Academy
© 2002, Cisco Systems, Inc. All rights reserved.
Chapter 8 Environments, Alternatives, and Decisions.
G l a r i m y G l a r I m y Presentation on Object Oriented Java Script Krishna Mohan Koyya Proprietor & Principle Consultant Glarimy Technology Services.
Unit Testing with Mocha
What's new in the world of SharePoint development and deployment
Extra Course
Techniques and Practices for Testing Angular
3 Things Everyone Knows About Node JS That You Don't
Software Engineering for Internet Applications
Training Institute Pune AngularJS Course. What is AngularJS ? AngularJS is a structural framework that is used in Single Page HTML for declaring dynamic.
MEAN stack L. Grewe.
Working with different JavaScript frameworks and libraries
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
12/9/2018 Desktop Virtualization Corey Hynes Kyle Rosenthal President Technical Lead HynesITe Inc Spider Consulting @windowspcguy.
Lightning Component Testing with Jasmine Jasmine is a behaviour-driven development framework - that is used for the purpose of testing Javascript code.
Cordova & Cordova Plugin Installation and Management
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Javascript Chapter 19 and 20 5/3/2019.
Company Profile
Microsoft Virtual Academy
Angular.
Presentation transcript:

© 2014, Glarimy. All rights reserved. G l a r i m y

The Classroom Protocol Few Administrative Formalities –Sign in the attendance sheet, if provided –Fill-in the feedback at the end of sessions, if provided Derive Maximum Value –Ask questions, any time –Participate in discussions and lab exercises –Avoid brining personal or office work to the class room –Stay away from internet while class in the session Lets Learn Together –Switch-off or mute personal phones –Leave/enter the class room without disturbing the class –Take phone calls outside the class room –Keep the class room clean and professional –No cross discussions Reference Material –Download from –No Print/CD. Protect Environment G l a r i m y © 2014, Glarimy. All rights reserved.

Glarimy Technology Services About Glarimy –Established in 2008 and Registered in 2010 –Based out of Benguluru, Bharat (Bangalore, India) – Business Interests –Technology Consulting Architectural Appreciation and Review Prototyping –Corporate Training Software Design, Architecture and Processes Web 2.0 Technologies Standard and Enterprise Technologies –Weekend Public Workshops One-day Executive Workshops on Saturdays Business Reach –Geographies: Banguluru, Chennai, Pune, Hyderabad, Kochi and etc., –Client Base: Sharp, GlobalDoc and LamResearch –Partner Clients: Robert Bosch, Samsung, Cisco, Vmware and etc., G l a r i m y © 2014, Glarimy. All rights reserved.

Krishna Mohan Koyya Career spanning across 17 years –9 Years into Software Engineering with Cisco Systems, Wipro/Lucent and HP –6 Years as Principle Consultant and Founder of Glarimy Technology Services –1 Year as CEO at Sudhari IT Solutions, Bangalore –1 Year as HoD at Sasi Institute of Technology and Engineering, Tadepalligudem, Andhra Pradesh Proven Delivery –Web 2.0: ExtJS, Dojo, Jquery Frameworks, AngularJS, HTML5, CSS3, XML –Enterprise Java: Spring, Hibernate, EJB, JSF, OSGi, Web Services, xUNIT family –Design Patterns, Architectural Patterns, TDD Technology Expertise –Distributed Systems and Network Management Systems –Object Oriented Systems Development –Infrastructure, Middleware and Web Layers with Java and Javascript Academics –M.Tech (Computer Science & Tech) from Andhra University, Visakhapatnam –BE (Electronics & Comm. Engg) from SRKR Engg. College, Bhimavaram G l a r i m y © 2014, Glarimy. All rights reserved.

The Environment Testing and AngularJS –AngularJS is built on the concepts of Dependency Injection and Single Responsibility –Naturally, this approach makes it testable Test Specifications with Jasmine –Jasmine is one of the popular test frameworks for JavaScript applications –Same can be used for AngularJS as well –Jasmine offers rich set of matchers (for assertions) and spies (for mocking) Running the tests using Karma –Karma is one of the popular test runners –Developed by Google and recommended for AngularJS –Can run the Jasmine test specifications –Can be integrated with many other eco-system frameworks of AngularJS –Distributed as a NodeJS package G l a r i m y © 2014, Glarimy. All rights reserved.

The Environment G l a r i m y © 2014, Glarimy. All rights reserved.

Setting-up the Environment Install NodeJS –Download it from –Run the installer (available for Windows and Mac) –Setup the distributes (on Ubuntu and etc.,) Install Node Package Manager (npm) –Comes with NodeJS, by default –Command line tool to manage dependencies –Accesses node registry to download and install packages Install Karma –npm install –g karma –Needs internet connection to access the registry Install Karma Command Line Interface –npm install –g karma-cli –Needs internet connection to access the registry G l a r i m y © 2014, Glarimy. All rights reserved.

Setting-up the Environment Generate the karma-configuration file –karma init glarimy.config.js Answer interactive questions Opt for jasmine as the test framework Choose your browser Provide an expression/s for matching the test files (like *.js, *.test.js and etc., ) Provide an expression/s for exclusions from the above Develop Jasmine Test Cases –The location of the test cases must match the file entries in the karma configuration file Run the test cases –karma start glarimy.config.js –The browser opens up automatically The status is available at Results are displayed on the terminal –Karma runs the tests whenever the file changes G l a r i m y © 2014, Glarimy. All rights reserved.

Testing using Jasmine Prepare a test suite –describe(“name”, function(){…}); –Add optional setup and teardown routines beforeEach(function(){…}); –Add any number of test specifications to the suite it(“name”, function(){…}); Set any number of expectations in the specifications –expect(actualValue).toBe(expectedValue); Use appropriate matchers –Employ spies for spying and mocking, if needed var spy = createSpy(object-ref, “method-name”); expect(spy).toHaveBeanCalled().and.returnValue(value); Run the test suite –You may use Karma for this purpose G l a r i m y © 2014, Glarimy. All rights reserved.

Karma Test Configuration Can be placed anywhere, typically in the workspace To be named as.js file module.exports = function(config) { config.set({ basePath: ‘D:\Glarimy\Workspace\AngualrJS\', frameworks: ['jasmine'], files: ['*.js', 'tests/*.js’], exclude: [], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Firefox'], singleRun: false }); }; G l a r i m y © 2014, Glarimy. All rights reserved.

Testing using Jasmine Source Code: glarimy-calculator.js function GlarimyCountingCalculator() { var count = 0; this.add = function(a, b){ count++; return a+b; }; this.subtract = function(a, b){ count++; return a-b; }; this.getCount = function(){ return count; } G l a r i m y © 2014, Glarimy. All rights reserved.

Testing using Jasmine Jasmine Test Suite: glarimy-calculator-test.js describe("GlarimyCountingCalculator", function() { beforeEach(function(){ this.calc = new GlarimyCountingCalculator(); }); afterEach(function(){}); it("to add correctly", function() { expect(this.calc.add(10,20)).toBe(30); }); it("to subtract correctly", function() { expect(this.calc.subtract(10,20)).toBe(-10); }); it("to count correctly", function() { expect(this.calc.getCount()).toBe(0); }); G l a r i m y © 2014, Glarimy. All rights reserved.

Jasmine Matchers For booleans –toBeTruthy, toBeFalsy For numbers –Not, toBe, toEqual, –toBeLessThan, toBeGreaterThan, –toBeCloseTo For objects –toBeDefined, toBeUndefined, toBeNull For strings –toMatch For Arrays –toContain And –toThrow G l a r i m y © 2014, Glarimy. All rights reserved.

Jasmine Custom Matchers Custom Matchers added in beforeEach –Customer Matchers may override existing matchers describe("GlarimyCountingCalculator", function() { beforeEach(function(){ this.calc = new GlarimyCountingCalculator(); this.addMatchers({ toBeEven: function(){ var actual = this.actual; this.message = function(){ return actual + ' is not an even number'; } return (actual % 2 == 0)?true:false; } }); it("to add correctly", function() { var sum = this.calc.add(10,20); expect(sum*2).toBeEven(); }); G l a r i m y © 2014, Glarimy. All rights reserved.

Jasmine Spies Spies on calls to functions –By adding a proxy to intercept the calls function GlarimyDAO() { this.get = function(isbn){ return "Title: Java " + isbn; }; } function GlarimyLibrary(dao){ var _dao = dao; this.find = function(isbn){ if(isbn > 0) return _dao.get(isbn); } G l a r i m y © 2014, Glarimy. All rights reserved.

Jasmine Spies Spies on calls to functions describe("GlarimyLibrary", function(){ beforeEach(function(){ this.dao = new GlarimyDAO(); this.library = new GlarimyLibrary(this.dao); spyOn(this.dao, 'get'); }); it('to find correctly', function(){ this.library.find(1234); expect(this.dao.get).toHaveBeenCalled(); }); it('to find correctly', function(){ this.library.find(-1234); expect(this.dao.get).not.toHaveBeenCalled(); }); }) G l a r i m y © 2014, Glarimy. All rights reserved.

Testing Angular Use Angular Mock Objects –npm install angular-mocks Test Development –Create application modules in the suites –Inject the $rootscope, $controller and required services describe('suite name', function(){ var scope, controller; beforeEach(module('module-name')); beforeEach(inject( function($rootScope, $controller){ scope = $rootScope.$new(); controller = $controller; controller('controller-name', {'$scope': scope}); })); it('spec-name', function(){ expect(scope.scope-variable).toBe(value); }); G l a r i m y © 2014, Glarimy. All rights reserved.

Testing Angular describe('GlarimyDirectoryController-6', function(){ var scope, controller, GlarimyDirectoryService, httpBackend; beforeEach(module('GlarimyDirectory-6')); beforeEach(inject( function($rootScope, $controller, _GlarimyDirectoryService_, $httpBackend){ httpBackend = $httpBackend; httpBackend.when('GET', 'contacts.json').respond({ "list":[{ "id": 1, "name": "Krishna", "phoneNumber": }] }); GlarimyDirectoryService = _GlarimyDirectoryService_; scope = $rootScope.$new(); controller = $controller; controller('GlarimyDirectoryController', {'$scope': scope, 'GlarimyDirectoryService': GlarimyDirectoryService}); })); // to be continued in the next slide G l a r i m y © 2014, Glarimy. All rights reserved.

Testing Angular //Continued from previous slide it('should have variable contacts"', function(){ httpBackend.flush(); expect(scope.contacts).not.toBeNull(); expect(scope.contacts[0]).toEqual({ "id": 1, "name": "Krishna", "phoneNumber": }); expect(GlarimyDirectoryService.list().length).toBe(1 ); }); G l a r i m y © 2014, Glarimy. All rights reserved.

Thank You Glarimy Technology Services Consulting, Corporate Training & Weekend Executive Workshops | G l a r i m y © 2014, Glarimy. All rights reserved.

G l a r i m y © 2014, Glarimy. All rights reserved. Glarimy Technology Services

G l a r i m y © 2014, Glarimy. All rights reserved.