This document discusses writing functional test cases for Mule flows using JUnit and MUnit frameworks. When using JUnit, test cases directly connect to components like SAP and Salesforce, modifying real data. MUnit allows mocking these components to avoid this issue. The document provides examples of mocking Salesforce and database components in MUnit test cases using custom payloads. Benefits of MUnit include Java/flow based unit testing, endpoint mocking, assertions, and automated testing.
This document demonstrates how to perform basic math operations like addition, subtraction, multiplication, division, finding maximum and minimum values, rounding, and square root functions using DataWeave. It provides code examples for each operation, showing how to transform and output the results in JSON or XML format.
Concurrency and Thread-Safe Data Processing in Background TasksWO Community
This document discusses running long-running tasks asynchronously in background threads in Java and WebObjects. It covers:
- Using Runnable and Callable interfaces to define asynchronous tasks
- Executing tasks using the ExecutorService interface and submitting tasks to get Future objects
- The ERXExecutorService class, which provides a thread-safe ExecutorService for WebObjects
- Monitoring and controlling tasks using interfaces like ERXStatusInterface
- Passing EOF objects between threads safely using global IDs
- Customizing the results page using IERXPerformWOActionForResult
This presentation is the attempt to switch sides and show code management from the developer's point of view. It stays outside of various VCS solutions and focuses on hands-on approaches: activity control via system triggers, conditional compilation, synonym manipulation, utilization of Edition-Based Redefinition (EBR).
The objective of this tutorial is to demonstrate the workaround needed to invoke an Oracle Stored Procedure
from Mule ESB flow by passing Java arrays as parameters.
The use case for this tutorial is a simple one such as inserting student records from a CSV file into an Oracle
database table through a stored procedure where one of the parameters is an array holding the student’s marks.
This document discusses using Moo and the System::Image::Update module to manage firmware updates on embedded devices. It provides examples of using Moo to define classes, roles, attributes, and methods. It also demonstrates how System::Image::Update can be used to implement a self-sustaining daemon for handling firmware updates through a state machine. The document describes how middleware can intercept the update process and provide status information. It aims to provide real world examples of using Moo for object oriented programming in Perl.
This document provides instructions for setting up and running a bot project using the Bot Builder SDK v4. It discusses downloading necessary software, creating a project in Visual Studio, implementing a welcome message, and managing state using user profiles and state accessors. The document contains code samples for creating a SampleBot class that inherits from IBot and uses state accessors and user profiles to save and retrieve a user's handle name.
The document discusses parallel programming in .NET. It covers two main strategies for parallelism - data parallelism and task parallelism. For data parallelism, it describes using Parallel.For to partition work over collections. For task parallelism, it discusses using the Task Parallel Library to create and run independent tasks concurrently, allowing work to be distributed across multiple processors. It provides examples of creating tasks implicitly with Parallel.Invoke and explicitly by instantiating Task objects and passing delegates.
This document demonstrates how to perform basic math operations like addition, subtraction, multiplication, division, finding maximum and minimum values, rounding, and square root functions using DataWeave. It provides code examples for each operation, showing how to transform and output the results in JSON or XML format.
Concurrency and Thread-Safe Data Processing in Background TasksWO Community
This document discusses running long-running tasks asynchronously in background threads in Java and WebObjects. It covers:
- Using Runnable and Callable interfaces to define asynchronous tasks
- Executing tasks using the ExecutorService interface and submitting tasks to get Future objects
- The ERXExecutorService class, which provides a thread-safe ExecutorService for WebObjects
- Monitoring and controlling tasks using interfaces like ERXStatusInterface
- Passing EOF objects between threads safely using global IDs
- Customizing the results page using IERXPerformWOActionForResult
This presentation is the attempt to switch sides and show code management from the developer's point of view. It stays outside of various VCS solutions and focuses on hands-on approaches: activity control via system triggers, conditional compilation, synonym manipulation, utilization of Edition-Based Redefinition (EBR).
The objective of this tutorial is to demonstrate the workaround needed to invoke an Oracle Stored Procedure
from Mule ESB flow by passing Java arrays as parameters.
The use case for this tutorial is a simple one such as inserting student records from a CSV file into an Oracle
database table through a stored procedure where one of the parameters is an array holding the student’s marks.
This document discusses using Moo and the System::Image::Update module to manage firmware updates on embedded devices. It provides examples of using Moo to define classes, roles, attributes, and methods. It also demonstrates how System::Image::Update can be used to implement a self-sustaining daemon for handling firmware updates through a state machine. The document describes how middleware can intercept the update process and provide status information. It aims to provide real world examples of using Moo for object oriented programming in Perl.
This document provides instructions for setting up and running a bot project using the Bot Builder SDK v4. It discusses downloading necessary software, creating a project in Visual Studio, implementing a welcome message, and managing state using user profiles and state accessors. The document contains code samples for creating a SampleBot class that inherits from IBot and uses state accessors and user profiles to save and retrieve a user's handle name.
The document discusses parallel programming in .NET. It covers two main strategies for parallelism - data parallelism and task parallelism. For data parallelism, it describes using Parallel.For to partition work over collections. For task parallelism, it discusses using the Task Parallel Library to create and run independent tasks concurrently, allowing work to be distributed across multiple processors. It provides examples of creating tasks implicitly with Parallel.Invoke and explicitly by instantiating Task objects and passing delegates.
How to build to do app using vue composition api and vuex 4 with typescriptKaty Slemon
In this tutorial, we will build a to-do app using Vue Composition API & Vuex 4 with Typescript. We will learn and explore Composition API & Options API as well
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEHitesh Mohapatra
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS
CREATING AND MANAGING ACTIVE DIRECTORY OBJECTS
CONFIGURING NETWORK SETTINGS ON WINDOWS SERVER
CREATING A WEB SITE
SELECTING, SORTING, AND DISPLAYING DATA
FILTERING OBJECTS AND ENUMERATING OBJECTS
This document provides information on using EXPLAIN to troubleshoot MySQL performance issues. EXPLAIN shows how MySQL executes SQL queries, including which indexes and joins it uses. The output includes information on the query type, access method, filtered rows, and extra details to help identify inefficient queries or indexes.
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
At BASTA Austria (http://www.basta-austria.at) I did a workshop about WPF and Prism. This is my slide deck. It summarizes the most important take-aways from the workshop. Additionally it contains sample code snippets.
This document provides an overview of web application development and servlet technology. It discusses the history and evolution of web pages to dynamic web applications. It then defines web applications and the request-response model. Common Gateway Interface (CGI) is introduced as the first technique for dynamic content, along with its limitations which led to the creation of servlets. Key servlet concepts like the servlet interface, generic servlet, HTTP servlet, and servlet lifecycle methods are covered. The document also examines the HttpServletRequest and HttpServletResponse interfaces and their various methods. Finally, it discusses session tracking approaches including cookies and the session API.
This document discusses concurrency utilities introduced in Java 8 including parallel tasks, parallel streams, parallel array operations, CompletableFuture, ConcurrentHashMap, scalable updatable variables, and StampedLock. It provides examples and discusses when and how to properly use these utilities as well as potential performance issues. Resources for further reading on Java concurrency are also listed.
Introduction to Active Record at MySQL Conference 2007Rabble .
Active Record is an object-relational mapping pattern that allows mapping database tables to object classes. It uses the principle of "convention over configuration" to minimize configuration work. The Active Record pattern is implemented in Ruby on Rails through the ActiveRecord library, which provides methods for CRUD operations and associations between models. It aims to make working with databases and ORM intuitive for developers.
Jdbc example program with access and MySqlkamal kotecha
The document provides examples of using JDBC to connect to and interact with Microsoft Access and MySQL databases. It includes steps to create databases and tables in Access and MySQL, as well as code samples demonstrating how to connect to the databases using JDBC, execute queries using Statement and PreparedStatement, and retrieve and display result sets. Key aspects like loading the appropriate JDBC driver and connection strings for different databases are also explained.
This document discusses Java Database Connectivity (JDBC) and provides details on connecting to a database from a Java application. There are 4 types of JDBC drivers that enable connection. Connecting involves 5 steps - registering the driver class, creating a connection, creating a statement, executing queries, and closing the connection. Examples are provided for connecting to MySQL and MS Access databases.
This document discusses dependency injection in Spring Framework. It covers setter injection, constructor injection, and method injection using both XML and annotation-based configurations. Setter injection allows injecting dependencies into properties through setter methods. Constructor injection injects dependencies through a class's constructor. Method injection replaces or augments existing methods at runtime. Both setter and constructor injection can be used with XML's <property> and <constructor-arg> tags or with annotations like @Autowired on setter methods or constructors. Method injection replaces or augments methods using the <replaced-method> or <lookup-method> tags in XML.
This document discusses using JDBC to access databases from Java applications like JSP pages. It covers loading the appropriate JDBC driver, establishing a connection with the database using a connection URL, executing SQL statements using Statement objects to retrieve and process result sets, and closing the connection when done. The core steps are to load the driver, get a connection, create statements, execute queries/updates, process results, and close the connection.
MicroProfile: A Quest for a Lightweight and Modern Enterprise Java PlatformMike Croft
The Eclipse MicroProfile offers a development platform for users of Enterprise Java who want innovation and modern APIs.
This presentation covers some of the APIs available in the MicroProfile 1.2 specification as at November 2017
An autonomous transaction has its own COMMIT and ROLLBACK scope to ensure that its outcome does not effect the caller’s uncommitted changes. Additionally, the COMMITs and ROLLBACK in the calling transaction should not effect the changes that were finalized on the completion of autonomous transaction itself.
This document provides an overview of Java Server Pages (JSP) technology. It discusses how JSP pages combine HTML/XML markup with Java code to create dynamic web content. Key points include:
- JSP pages are converted into Java servlets by the JSP container/engine to generate HTML responses. This allows accessing Java APIs and databases.
- Common JSP elements like scriptlets, expressions, declarations, comments, and directives allow embedding Java code in JSP pages.
- The JSP lifecycle mirrors the servlet lifecycle with phases like initialization, execution, and destruction.
- Standard Tag Libraries (JSTL) provide commonly used tags to simplify tasks like iteration, conditionals,
The document discusses refreshing a Mule cache using Oracle Database Change Notification. It describes registering a SQL query with the database for change notifications, defining a listener class to handle notification events, and using the events to refresh the cache. A Java client application is implemented to receive notifications and send payload data to a Mule flow that processes the changes and refreshes the cache accordingly.
The math module provides functions for specialized mathematical operations such as ceil, floor, factorial, gcd, exp, log, pow, sqrt, trigonometric functions, and constants such as pi and e. The zlib module provides functions for compressing and decompressing data using the zlib library as well as computing checksums. The threading module allows creating and managing threads in Python. Key concepts include the Thread class for defining new threads, starting and joining threads, and synchronizing thread execution using locks.
This document provides an overview of Java servlets. It defines servlets as Java programs that extend the capabilities of servers and respond to web requests. It compares servlets to CGI scripts, noting that servlets have better performance since they use threads instead of processes to handle requests. The document outlines the servlet lifecycle and architecture, how to create a servlet class, and key interfaces in the servlet API like Servlet, GenericServlet, and HttpServlet.
Introduction to JDBC and database access in web applicationsFulvio Corno
Introduction to the JDBC standard and best practices for database access from Web Applications.
Materiale realizzato per il corso di Sistemi Informativi Aziendali del Politecnico di Torino - http://bit.ly/sistinfo
This document provides an overview of the Oracle Enterprise Manager Command Line Interface (EM CLI).
It discusses the different modes of EM CLI including standard, interactive, and scripting modes. It also covers EM CLI verbs, formatting output, fetching information from the EM repository, and provides examples of Bash and Python scripts using EM CLI.
Sample scripts demonstrated include clearing stateless alerts, changing database passwords, and promoting unmanaged databases to managed targets. Fundamentals of Python programming are also introduced for effective EM CLI scripting.
MUnit is a framework for writing functional test cases in Mule that allows mocking of components like SAP, Salesforce, and databases. When writing functional tests with JUnit, the tests interact directly with the actual components. MUnit allows mocking these components to return custom payloads and avoid modifying real data during tests. The document provides examples of mocking Salesforce and database components in MUnit tests.
MUnit is a framework for writing test cases in Mule that allows mocking of components like SAP, Salesforce, and databases. When writing functional tests for Mule flows with JUnit, the tests interact with the actual components. MUnit allows mocking these components to return custom payloads and avoid modifying real data. The document provides examples of mocking Salesforce and database components in MUnit tests.
MUnit is a framework for writing functional test cases in Mule that allows mocking of components like SAP, Salesforce, and databases. When writing functional tests with JUnit, the tests interact directly with the actual components. MUnit allows mocking these components to return custom payloads and avoid modifying real data during tests. The document provides examples of mocking Salesforce and database components in MUnit tests.
How to build to do app using vue composition api and vuex 4 with typescriptKaty Slemon
In this tutorial, we will build a to-do app using Vue Composition API & Vuex 4 with Typescript. We will learn and explore Composition API & Options API as well
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS : PowerShell ISEHitesh Mohapatra
WINDOWS ADMINISTRATION AND WORKING WITH OBJECTS
CREATING AND MANAGING ACTIVE DIRECTORY OBJECTS
CONFIGURING NETWORK SETTINGS ON WINDOWS SERVER
CREATING A WEB SITE
SELECTING, SORTING, AND DISPLAYING DATA
FILTERING OBJECTS AND ENUMERATING OBJECTS
This document provides information on using EXPLAIN to troubleshoot MySQL performance issues. EXPLAIN shows how MySQL executes SQL queries, including which indexes and joins it uses. The output includes information on the query type, access method, filtered rows, and extra details to help identify inefficient queries or indexes.
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
At BASTA Austria (http://www.basta-austria.at) I did a workshop about WPF and Prism. This is my slide deck. It summarizes the most important take-aways from the workshop. Additionally it contains sample code snippets.
This document provides an overview of web application development and servlet technology. It discusses the history and evolution of web pages to dynamic web applications. It then defines web applications and the request-response model. Common Gateway Interface (CGI) is introduced as the first technique for dynamic content, along with its limitations which led to the creation of servlets. Key servlet concepts like the servlet interface, generic servlet, HTTP servlet, and servlet lifecycle methods are covered. The document also examines the HttpServletRequest and HttpServletResponse interfaces and their various methods. Finally, it discusses session tracking approaches including cookies and the session API.
This document discusses concurrency utilities introduced in Java 8 including parallel tasks, parallel streams, parallel array operations, CompletableFuture, ConcurrentHashMap, scalable updatable variables, and StampedLock. It provides examples and discusses when and how to properly use these utilities as well as potential performance issues. Resources for further reading on Java concurrency are also listed.
Introduction to Active Record at MySQL Conference 2007Rabble .
Active Record is an object-relational mapping pattern that allows mapping database tables to object classes. It uses the principle of "convention over configuration" to minimize configuration work. The Active Record pattern is implemented in Ruby on Rails through the ActiveRecord library, which provides methods for CRUD operations and associations between models. It aims to make working with databases and ORM intuitive for developers.
Jdbc example program with access and MySqlkamal kotecha
The document provides examples of using JDBC to connect to and interact with Microsoft Access and MySQL databases. It includes steps to create databases and tables in Access and MySQL, as well as code samples demonstrating how to connect to the databases using JDBC, execute queries using Statement and PreparedStatement, and retrieve and display result sets. Key aspects like loading the appropriate JDBC driver and connection strings for different databases are also explained.
This document discusses Java Database Connectivity (JDBC) and provides details on connecting to a database from a Java application. There are 4 types of JDBC drivers that enable connection. Connecting involves 5 steps - registering the driver class, creating a connection, creating a statement, executing queries, and closing the connection. Examples are provided for connecting to MySQL and MS Access databases.
This document discusses dependency injection in Spring Framework. It covers setter injection, constructor injection, and method injection using both XML and annotation-based configurations. Setter injection allows injecting dependencies into properties through setter methods. Constructor injection injects dependencies through a class's constructor. Method injection replaces or augments existing methods at runtime. Both setter and constructor injection can be used with XML's <property> and <constructor-arg> tags or with annotations like @Autowired on setter methods or constructors. Method injection replaces or augments methods using the <replaced-method> or <lookup-method> tags in XML.
This document discusses using JDBC to access databases from Java applications like JSP pages. It covers loading the appropriate JDBC driver, establishing a connection with the database using a connection URL, executing SQL statements using Statement objects to retrieve and process result sets, and closing the connection when done. The core steps are to load the driver, get a connection, create statements, execute queries/updates, process results, and close the connection.
MicroProfile: A Quest for a Lightweight and Modern Enterprise Java PlatformMike Croft
The Eclipse MicroProfile offers a development platform for users of Enterprise Java who want innovation and modern APIs.
This presentation covers some of the APIs available in the MicroProfile 1.2 specification as at November 2017
An autonomous transaction has its own COMMIT and ROLLBACK scope to ensure that its outcome does not effect the caller’s uncommitted changes. Additionally, the COMMITs and ROLLBACK in the calling transaction should not effect the changes that were finalized on the completion of autonomous transaction itself.
This document provides an overview of Java Server Pages (JSP) technology. It discusses how JSP pages combine HTML/XML markup with Java code to create dynamic web content. Key points include:
- JSP pages are converted into Java servlets by the JSP container/engine to generate HTML responses. This allows accessing Java APIs and databases.
- Common JSP elements like scriptlets, expressions, declarations, comments, and directives allow embedding Java code in JSP pages.
- The JSP lifecycle mirrors the servlet lifecycle with phases like initialization, execution, and destruction.
- Standard Tag Libraries (JSTL) provide commonly used tags to simplify tasks like iteration, conditionals,
The document discusses refreshing a Mule cache using Oracle Database Change Notification. It describes registering a SQL query with the database for change notifications, defining a listener class to handle notification events, and using the events to refresh the cache. A Java client application is implemented to receive notifications and send payload data to a Mule flow that processes the changes and refreshes the cache accordingly.
The math module provides functions for specialized mathematical operations such as ceil, floor, factorial, gcd, exp, log, pow, sqrt, trigonometric functions, and constants such as pi and e. The zlib module provides functions for compressing and decompressing data using the zlib library as well as computing checksums. The threading module allows creating and managing threads in Python. Key concepts include the Thread class for defining new threads, starting and joining threads, and synchronizing thread execution using locks.
This document provides an overview of Java servlets. It defines servlets as Java programs that extend the capabilities of servers and respond to web requests. It compares servlets to CGI scripts, noting that servlets have better performance since they use threads instead of processes to handle requests. The document outlines the servlet lifecycle and architecture, how to create a servlet class, and key interfaces in the servlet API like Servlet, GenericServlet, and HttpServlet.
Introduction to JDBC and database access in web applicationsFulvio Corno
Introduction to the JDBC standard and best practices for database access from Web Applications.
Materiale realizzato per il corso di Sistemi Informativi Aziendali del Politecnico di Torino - http://bit.ly/sistinfo
This document provides an overview of the Oracle Enterprise Manager Command Line Interface (EM CLI).
It discusses the different modes of EM CLI including standard, interactive, and scripting modes. It also covers EM CLI verbs, formatting output, fetching information from the EM repository, and provides examples of Bash and Python scripts using EM CLI.
Sample scripts demonstrated include clearing stateless alerts, changing database passwords, and promoting unmanaged databases to managed targets. Fundamentals of Python programming are also introduced for effective EM CLI scripting.
MUnit is a framework for writing functional test cases in Mule that allows mocking of components like SAP, Salesforce, and databases. When writing functional tests with JUnit, the tests interact directly with the actual components. MUnit allows mocking these components to return custom payloads and avoid modifying real data during tests. The document provides examples of mocking Salesforce and database components in MUnit tests.
MUnit is a framework for writing test cases in Mule that allows mocking of components like SAP, Salesforce, and databases. When writing functional tests for Mule flows with JUnit, the tests interact with the actual components. MUnit allows mocking these components to return custom payloads and avoid modifying real data. The document provides examples of mocking Salesforce and database components in MUnit tests.
MUnit is a framework for writing functional test cases in Mule that allows mocking of components like SAP, Salesforce, and databases. When writing functional tests with JUnit, the tests interact directly with the actual components. MUnit allows mocking these components to return custom payloads and avoid modifying real data during tests. The document provides examples of mocking Salesforce and database components in MUnit tests.
MUnit is a framework for writing functional test cases in Mule that allows mocking of components like SAP, Salesforce, and databases. When writing functional tests with JUnit, the tests interact directly with the actual components. MUnit allows mocking these components to return custom payloads and avoid modifying real data during tests. The document provides examples of mocking Salesforce and database components in MUnit tests.
Mule Munit
1. Solution for JUnit Functional test cases By: Kiet Bui 22-Sep-2015
2. Abstract • The main motto of this white paper is what the issues to write test cases using JUnit are and how to overcome those issues.
3. Table of Contents • ABSTRACT 1. INTRODUCTION 2. PROBLEM STATEMENT 3. SOLUTION 4. BENEFITS 5. CONCLUSION 6. REFERENCES 7. ABOUT THE AUTHOR 8. ABOUT WHISHWORKS
4. Introduction • We have multiple unit test frameworks to write unit and functional test cases for our services. When we write functional test cases using JUnit we can’t mock mule components. To resolve this issues we have to use MUnit and I am going to explain what is the problem with JUnit and how to resolve using MUnit in the below.
5. Problem Statement • When we write functional test cases using JUnit, the test case will directly connect to original components like SAP, Salesforce etc. and insert/select the data. It is the issue in JUnit functional test case why because we are writing functional test cases to check whether entire functionality is working as expected or not without modifying the original components(SAP,Salesforce,Database) data, but in JUnit functional test cases it is directly connecting to original components and modifying the original data. • Examples: 1. SAP Connector • Mule flow:
This document discusses using MUnit instead of JUnit for writing functional test cases in Mule that involve mocking mule components. When using JUnit, test cases directly connect to original components like SAP and Salesforce, potentially modifying real data. MUnit allows mocking these components so they are not called directly. Examples show mocking Salesforce and database components in MUnit by returning custom payloads. The MUnit tests run flows and assert responses without calling the real components.
This document discusses writing functional test cases for Mule flows using JUnit and MUnit frameworks. With JUnit, test cases directly connect to original components like databases and APIs, modifying real data. MUnit allows mocking components to avoid this. The document provides examples of test cases using JUnit that connect directly to Salesforce and SAP, modifying real data. It then presents a solution using MUnit, showing how to mock the Salesforce component to return sample data without connecting to the real system. MUnit test cases are able to fully isolate tests by mocking components.
The document describes how to use MUnit to test a Mule flow that queries Salesforce for account data. It involves:
1. Generating mock account data to return from the mocked Salesforce connector.
2. Registering the mock data with MUnit so it is returned instead of calling Salesforce.
3. Running the Mule flow to process the mock data.
4. Generating assertion data to validate the output matches expectations.
5. Comparing the output to the assertion data to validate the flow works as expected with the mock Salesforce response.
This document provides an overview of Spring Batch, an open source framework for batch processing in Java. It describes key concepts in Spring Batch including jobs which contain steps, item readers which provide input, item writers which handle output, and tasklets which represent units of work. The document also discusses architectures, executions, repositories for metadata, and other services like job launchers and locators.
The document describes how to use the Batch component in Mule applications. The Batch component allows processing messages in batches by splitting messages into individual records, performing actions on each record, and reporting results. The document includes an example Mule flow that uses a Batch job to iterate over a list of maps and perform database updates on each item. It logs output showing the batch job processing the records and handling any errors.
When executing something synchronously, you wait for it to finish before moving on to another task. Asynchronously, you can move on before it finishes. Future methods, Queueable Apex, and Batch Apex allow asynchronous execution in Apex. Future methods are best for long-running methods or callouts. Queueable Apex allows job chaining and passing complex types. Batch Apex is best for large data volumes processed in batches. Continuations allow asynchronous callouts from Visualforce pages.
JavaScript basics
JavaScript event loop
Ajax and promises
DOM interaction
JavaScript object orientation
Web Workers
Useful Microframeworks
This presentation has been developed in the context of the Mobile Applications Development course, DISIM, University of L'Aquila (Italy), Spring 2014.
http://www.ivanomalavolta.com
The document provides information about performance testing with JMeter including example steps to write a JMeter script for a sample performance test scenario. The summary is:
The document discusses writing a JMeter script to simulate 30 concurrent users each sending 600 orders over 3 minutes to test the performance of an order processing system. It provides details on setting up thread groups, variables, CSV data configuration, HTTP requests, assertions and includes example XML payloads and JMeter script structure. Flexibility in JMeter is discussed including using BeanShell scripting and plugins to add custom functionality.
This document provides an introduction to JavaScript and the Document Object Model (DOM). It discusses what JavaScript is, how it can be implemented into web pages, its syntax, data types, functions, and how it interacts with the DOM. JavaScript allows dynamic behavior and interactivity on web pages by accessing and modifying elements and properties of the DOM tree.
- JavaScript code can be embedded in HTML files using <script> tags and is used to add dynamic and interactive behaviors to web pages. It is commonly used for form validation, dynamic HTML, and AJAX.
- Functions are commonly used in JavaScript to reuse code. Variables can be declared and used within functions and have limited scope. Operators, if/else statements, and loops allow for conditional logic.
- AJAX allows for asynchronous communication between the browser and server, improving interactivity. Cookies can be used to store small amounts of data on the client-side to remember information between requests.
Here are the key things you will do in the lab:
1. Build a business process that uses decision and parallel process steps to control flow and process messages concurrently.
2. Add exception handling using try/catch blocks and enrich exceptions with additional context.
3. Reference an external .NET assembly from within a code process step.
4. Access Neuron ESB APIs like the configuration, client context, and publish messages directly.
5. Debug the business process using breakpoints and inspecting variables at each step.
6. Store and retrieve custom properties and state at the message, instance, and global level.
The lab will reinforce how to design complex, dynamic processes that leverage Neuron
JavaScript allows for dynamic web pages and client-side form validation. It is embedded in HTML using <script> tags and can be stored in external .js files. Functions are commonly used in JavaScript. If/else statements and operators allow for conditional logic. AJAX enables asynchronous communication with servers. Cookies store small amounts of data in a user's browser.
Building React Applications with Redux
with Yuri Takhteyev
OVERVIEW
Since React is just a “view framework”, it leaves you with lots of options for how to architect the deeper parts of your stack. The best way to handle those deeper layers is by using Redux – a state container that allows you to write much of your application in the form of pure functions. Using Redux helps you write applications that are much easier to test and understand and to achieve more thorough separation between your views and your business logic. Redux also unlocks the possibility of using amazing tools.
OBJECTIVE
Introduce the audience to Redux, a state container that can be used together with React to achieve sanity deeper down in your stack.
TARGET AUDIENCE
Developers familiar with core React and looking for a better way to architect their applications.
ASSUMED AUDIENCE KNOWLEDGE
Core React knowledge is assumed. Familiarity with basic Flux concepts would help, but I’ll review those quickly.
FIVE THINGS AUDIENCE MEMBERS WILL LEARN
Why pure functions make your code easier to maintain.
How unidirectional data flows help you sleep better at night.
How Redux helps you manage state better via reducers.
How to use Redux together with React.
How to test Redux applications.
This document provides an overview of JavaScript concepts for a course on developing web applications. It discusses JavaScript basics like using <script> tags, .js file extensions, and functions. It also covers if statements, commenting code, and embedding JavaScript directly in HTML or externally in .js files. The document then reviews DOM manipulation using the document object, variables, operators, and if statements. It provides examples of using onclick events to dynamically change HTML. Finally, it briefly introduces AJAX, cookies, and scoping in JavaScript functions.
The document discusses using the VM component in Mule applications for intra-JVM communication. The VM transport allows communication between Mule flows using in-memory queues. An example flow is provided that demonstrates a request-response pattern between two flows using the VM outbound and inbound endpoints. Key features of the VM transport are that request-response uses direct in-thread delivery while one-way uses a queue for asynchronous, non-blocking delivery.
The document discusses the until-successful scope in Mule applications. The until-successful scope processes messages through its processors until the process succeeds. It runs asynchronously by default. An example Mule application configuration demonstrates using the until-successful scope to retry a database query up to 5 times if it initially fails. The scope will keep retrying until the database query succeeds or the maximum number of retries is reached.
This document discusses using message properties in Mule applications. It provides an example Mule flow that demonstrates setting message properties in different scopes and logging their values. The flow shows setting a property in the session scope and outbound scope in one flow, and accessing the same properties from the inbound scope in a second flow after being passed between the flows.
The document discusses using the ForEach component in Mule applications. It iterates over elements in a collection and processes them individually through embedded processors. The example shows querying a database table, storing the results in a payload, and then using ForEach to log each record. ForEach splits the payload collection and allows processing each element one by one through nested processors like Logger.
The document discusses using expression filters in Mule applications. It provides an example Mule flow that uses a message properties transformer to add a session property, an expression filter to check the property value, and calls a second flow via VM if the property value is not equal to "mule". The output shows the session property logged in both flows, demonstrating how expression filters can control flow execution based on message properties.
This document discusses using the Database component in Mule applications to connect to databases and perform SQL operations. It provides an example Mule flow that defines a JDBC connector to an MS SQL database, uses a select query configured with the Database outbound endpoint, and logs the results. The example connects to a database, executes a select statement, and prints the results.
Quartz is an open source job scheduling framework that allows scheduling tasks to run at predefined dates and times. It provides an example "hello world" flow that logs the message "--Hello world--" every 10 seconds. The benefits of Quartz include its ability to run embedded within applications, as a stand-alone program, or as a cluster for load balancing and failover of job execution.
The document describes how to use the choice component in Mule to conditionally route messages based on message properties. It provides an example XML configuration with two flows - flow1 sets a session property and flow2 uses a choice component to route the message based on checking the value of that session property, logging different messages depending on the result. When run, it demonstrates setting and accessing the session property across the two flows and the choice component routing the message to the appropriate logger based on the property value.
The document discusses the File connector in Mule, which allows applications to exchange files with the file system. It provides an example Mule flow that uses a file inbound endpoint to pick up a file from a source location and move it to a destination location, logging a message when complete. The flow polls the source folder every second to check for new files.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
Trusted Execution Environment for Decentralized Process MiningLucaBarbaro3
Presentation of the paper "Trusted Execution Environment for Decentralized Process Mining" given during the CAiSE 2024 Conference in Cyprus on June 7, 2024.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
A Comprehensive Guide to DeFi Development Services in 2024Intelisync
DeFi represents a paradigm shift in the financial industry. Instead of relying on traditional, centralized institutions like banks, DeFi leverages blockchain technology to create a decentralized network of financial services. This means that financial transactions can occur directly between parties, without intermediaries, using smart contracts on platforms like Ethereum.
In 2024, we are witnessing an explosion of new DeFi projects and protocols, each pushing the boundaries of what’s possible in finance.
In summary, DeFi in 2024 is not just a trend; it’s a revolution that democratizes finance, enhances security and transparency, and fosters continuous innovation. As we proceed through this presentation, we'll explore the various components and services of DeFi in detail, shedding light on how they are transforming the financial landscape.
At Intelisync, we specialize in providing comprehensive DeFi development services tailored to meet the unique needs of our clients. From smart contract development to dApp creation and security audits, we ensure that your DeFi project is built with innovation, security, and scalability in mind. Trust Intelisync to guide you through the intricate landscape of decentralized finance and unlock the full potential of blockchain technology.
Ready to take your DeFi project to the next level? Partner with Intelisync for expert DeFi development services today!
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Dandelion Hashtable: beyond billion requests per second on a commodity serverAntonios Katsarakis
This slide deck presents DLHT, a concurrent in-memory hashtable. Despite efforts to optimize hashtables, that go as far as sacrificing core functionality, state-of-the-art designs still incur multiple memory accesses per request and block request processing in three cases. First, most hashtables block while waiting for data to be retrieved from memory. Second, open-addressing designs, which represent the current state-of-the-art, either cannot free index slots on deletes or must block all requests to do so. Third, index resizes block every request until all objects are copied to the new index. Defying folklore wisdom, DLHT forgoes open-addressing and adopts a fully-featured and memory-aware closed-addressing design based on bounded cache-line-chaining. This design offers lock-free index operations and deletes that free slots instantly, (2) completes most requests with a single memory access, (3) utilizes software prefetching to hide memory latencies, and (4) employs a novel non-blocking and parallel resizing. In a commodity server and a memory-resident workload, DLHT surpasses 1.6B requests per second and provides 3.5x (12x) the throughput of the state-of-the-art closed-addressing (open-addressing) resizable hashtable on Gets (Deletes).
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframePrecisely
Inconsistent user experience and siloed data, high costs, and changing customer expectations – Citizens Bank was experiencing these challenges while it was attempting to deliver a superior digital banking experience for its clients. Its core banking applications run on the mainframe and Citizens was using legacy utilities to get the critical mainframe data to feed customer-facing channels, like call centers, web, and mobile. Ultimately, this led to higher operating costs (MIPS), delayed response times, and longer time to market.
Ever-changing customer expectations demand more modern digital experiences, and the bank needed to find a solution that could provide real-time data to its customer channels with low latency and operating costs. Join this session to learn how Citizens is leveraging Precisely to replicate mainframe data to its customer channels and deliver on their “modern digital bank” experiences.
2. Abstract
• The main motto of this white paper is what
the issues to write test cases using JUnit are
and how to overcome those issues.
3. Introduction
• We have multiple unit test frameworks to
write unit and functional test cases for our
services. When we write functional test cases
using JUnit we can’t mock mule components.
To resolve this issues we have to use MUnit
and I am going to explain what is the problem
with JUnit and how to resolve using MUnit in
the below.
4. Problem Statement
• When we write functional test cases using JUnit, the test case will
directly connect to original components like SAP, Salesforce etc. and
insert/select the data. It is the issue in JUnit functional test case
why because we are writing functional test cases to check whether
entire functionality is working as expected or not without modifying
the original components(SAP,Salesforce,Database) data, but in JUnit
functional test cases it is directly connecting to original components
and modifying the original data.
• Examples:
1. SAP Connector
• Mule flow:
5.
6. • Flow of execution
1. Trigger the service with xml request.
2. Receive the input request and process it.
3. Transform the processed request to SAP IDoc
and push it to SAP.
7. • Functional test case using JUnit:
• Public void functionalTest(){
•
• File fXmlFile = new File(request.xml);
• StringBuilder sb = new StringBuilder();
• BufferedReader br = new BufferedReader(new FileReader(fXmlFile));
•
• String sCurrentLine = new String();
• //Read the data from file and append to string
• while ((sCurrentLine = br.readLine()) != null) {
• sb.append(sCurrentLine);
• }
•
• DefaultHttpClient httpclient = new DefaultHttpClient();
•
• HttpPost httppost = new HttpPost(requrl);
•
• httppost.setEntity(new StringEntity(sb.toString(), "UTF-8"));
• //Trigger the service
• HttpResponse response = httpclient.execute(httppost);
•
• ----
• ----
• }
•
8. • Flow of execution
1. Read the input request from request.xml file.
2. Trigger the service with above request.
3. Process the input request.
4. Transform the processed request to SAP IDoc and
push it to SAP.
• Issue
• Here we are unable to mock the SAP component
so the test case is directly pushing the IDoc to
original SAP.
• NOTE: Not only pushing the IDoc to SAP, at the
time of receiving IDoc from SAP also we will face
same issue.
11. • Flow of execution
1. Trigger the service with xml request.
2. Processes the input request.
3. Create the processed request as customer in
Salesforce.
12. • Functional Test Case
• Public void functionalTest(){
•
• File fXmlFile = new File(request.xml);
• StringBuilder sb = new StringBuilder();
• BufferedReader br = new BufferedReader(new FileReader(fXmlFile));
•
• String sCurrentLine = new String();
• // Read the data from file and append to string
• while ((sCurrentLine = br.readLine()) != null) {
• sb.append(sCurrentLine);
• }
•
• DefaultHttpClient httpclient = new DefaultHttpClient();
•
• HttpPost httppost = new HttpPost(requrl);
•
• httppost.setEntity(new StringEntity(sb.toString(), "UTF-8"));
• //Trigger the service
• HttpResponse response = httpclient.execute(httppost);
•
• ----
• ----
• }
13. • Flow of Execution
1. First read the input request from request.xml file.
2. Trigger the service with above request.
3. Process the input request.
4. Create the customer in salesforce.
• Issue
• Here also we are unable to mock the Salesforce
component so it will connect to original
Salesforce connector and create the customer on
it.
14. Solution
• To resolve the above JUnit functional test case
issue we have a separate framework called
MUnit. MUnit is also one framework which is
used to write test cases as same as JUnit, but
here in MUnit we can mock all components
like SAP, Salesforce, Database etc. So to
overcome the above problem we can use
MUnit to write functional test cases.
15. • Example
• Mocking Salesforce test case using Munit
• .mflow
• <?xml version="1.0" encoding="UTF-8"?>
•
• <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:sfdc="http://www.mulesoft.org/schema/mule/sfdc" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" version="EE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/vm
http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
• http://www.mulesoft.org/schema/mule/sfdc http://www.mulesoft.org/schema/mule/sfdc/5.0/mule-sfdc.xsd
• http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
• http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">
• <vm:endpoint exchange-pattern="request-response" path="CREATE_CSTMR_VM" name="CREATE_CSTMR_VM" doc:name="VM"/>
• <vm:endpoint exchange-pattern="request-response" path="INSERT_PERSON_ACT_VM" name="INSERT_PERSON_ACT_VM" doc:name="VM"/>
• <flow name="CreateCustomerSFServiceTSFlow1" doc:name="CreateCustomerSFServiceTSFlow1">
• <vm:inbound-endpoint exchange-pattern="request-response" ref="CREATE_CSTMR_VM" doc:name="VM"/>
• <component class="com.vertu.services.ecom.maintaincustmr.processor.CreateCustomerProcessor" doc:name="CreateCustomerProcessor"/>
• </flow>
• <flow name="CreateCustomerSFServiceTSFlow2" doc:name="CreateCustomerSFServiceTSFlow2">
• <vm:inbound-endpoint exchange-pattern="request-response" ref="INSERT_PERSON_ACT_VM" doc:name="VM"/>
• <sfdc:create config-ref="ECOM_SALESFORCE_CONNECTOR" type="#[payload.Type]" doc:name="Salesforce">
• <sfdc:objects ref="#[payload.Object]"/>
• </sfdc:create>
• </flow>
• </mule>
• Here we have a Salesforce component to create the customer in Salesforce and return the customer-id as payload. So in functional test case we
should mock this component without connecting to original Salesforce.
16. • How to mock Salesforce component in MUnit functional test case
•
• To mock Salesforce component, first we should know
•
• Endpoint type.
• Name of the message processor and namespace of endpoint (from auto-generated XML).
• The type of payload the endpoint returns.
•
•
• Mocking above flow Salesforce component
•
• Create the salesforce response payload.
•
• List<Map<String,Object>> l1 = new ArrayList<Map<String,Object>>();
• Map<String,Object> m1 = new HashMap<Srtring,Object>>();
• m1.put(“custid”,”1234”);
• l1.add(m1);
•
• Mock the salesforce component and return the above created list as response payload.
•
• whenMessageProcessor("create").ofNamespace("sfdc").
• thenReturn( muleMessageWithPayload( l1) );
17. • MUnit functional test case for above flow
• public class MUnitSalesforceStubTest extends FunctionalMunitSuite {
• /**
• * The purpose of this method is to define the list of flow
• * files which will be loaded by Munit test case before executing
• * Munit test case. Specify multiple flow files as comma
• * separated XML files.
• */
• @Override
• protected String getConfigResources() {
• return "src/main/app/MUnitSFTest.xml";
• }
• /**
• *The purpose of this method is to define the list of
• flow name which will execute in Munit test case.
• */
• protected List<String> getFlowsExcludedOfInboundDisabling(){
• List<String> list = new ArrayList<String>();
• list.add("CreateCustomerSFServiceTSFlow2");
• return list;
• }
• /**
• * The purpose of this method is to flip between mock
• * and real time interfaces. Return false to Mock
• * all endpoints in your flow
• */
• @Override
• public boolean haveToMockMuleConnectors() {
• return true;
• }
18. • /**
• * Java based Munit test case. Contains mocking and
• * invocation of flows and assertions.
• */
• @Test
• public void validateEchoFlow() throws Exception {
•
• List<Map<String,Object>> l1 = new ArrayList<Map<String,Object>>();
• Map<String,Object> m1 = new HashMap<Srtring,Object>>();
• m1.put(“custid”,”1234”);
• l1.add(m1);
•
• // Mock SFDC outbound endpoint
• whenMessageProcessor("query").ofNamespace("sfdc").thenReturn( muleMessageWithPayload( l1)
);
•
• // Run the Munit test case by passing a test payload
• MuleEvent resultEvent = runFlow( " CreateCustomerSFServiceTSFlow1", testEvent(“request”));
• // The resultEvent contains response from the VM flow
• System.out.println( "The flow response is:: " + resultEvent.getMessage().getPayloadAsString() );
• // Do any assertion here using Assert.equals() for asserting response // payload
• }
• }
19. • Mocking Database component test case using MUnit
• .mflow
<flow name="CheckAcctIDFlow" doc:name="CheckAcctIDFlow">
<vm:inbound-endpoint exchange-pattern="request-response"
ref="FETCH_ACT_GUID_VM1" doc:name="FETCH_ACT_GUID_VM1"/>
<logger message="#[message.inboundProperties['ACCT_GUID']]"
level="INFO" doc:name="Logger"/>
<jdbc-ee:outbound-endpoint exchange-pattern="request-
response" queryKey="Get_ACC_ID" queryTimeout="-1" connector-
ref="CDMR_JDBC_CONNECTOR" doc:name="Get_ACCT_ID"/>
</flow>
• Here we have a database component used to select and return the
account-id from database. So we need to mock this component in
functional test case.
20. • Mocking above flow Database component
•
• Create the database response payload.
•
• List<Map<String,Object>> l1 = new
ArrayList<Map<String,Object>>();
• Map<String,Object> m1 = new HashMap<Srtring,Object>>();
• m1.put(“accountid”,”1234”);
• l1.add(m1);
•
• Mock the database component and return the above created list as
response payload.
•
• whenEndpointWithAddress( "jdbc://Get_ACC_ID"
).thenReturn(new DefaultMuleMessage(l1, muleContext ) );
21. • MUnit functional test case for above flow
• public class MUnitSalesforceStubTest extends FunctionalMunitSuite {
• /**
• * The purpose of this method is to define the list of flow
• * files which will be loaded by Munit test case before executing
• * Munit test case. Specify multiple flow files as comma
• * separated XML files.
• */
• @Override
• protected String getConfigResources() {
• return "src/main/app/MUnitSFTest.xml";
• }
•
• /**
• * The purpose of this method is to flip between mock
• * and real time interfaces. Return false to Mock
• * all endpoints in your flow
• */
• @Override
• public boolean haveToMockMuleConnectors() {
• return true;
• }
• /**
• * Java based Munit test case. Contains mocking and
• * invocation of flows and assertions.
• */
• @Test
• public void validateEchoFlow() throws Exception {
•
• List<Map<String,Object>> l1 = new ArrayList<Map<String,Object>>();
• Map<String,Object> m1 = new HashMap<Srtring,Object>>();
• m1.put(“accountid”,”1234”);
• l1.add(m1);
22. • // Mock Database outbound endpoint
• whenEndpointWithAddress( "jdbc://Get_ACC_ID"
).thenReturn(new DefaultMuleMessage(l1, muleContext ) );
•
• // Run the Munit test case by passing a test payload
• MuleEvent resultEvent = runFlow( " CheckAcctIDFlow ",
testEvent(“request”));
• // The resultEvent contains response from the VM flow
• System.out.println( "The flow response is:: " +
resultEvent.getMessage().getPayloadAsString() );
• // Do any assertion here using Assert.equals() for asserting
response // payload
• }
• }
23. Benefits
• Create Java based or Mule flow based unit test cases
• Mock endpoints (Salesforce, Database, or SAP etc.) to return
custom payloads for unit testing
• Dynamically flip/parameterize Munit test cases to Mock payloads or
use real time interfaces
• Support functional unit testing similar to Mule Functional test case
• Support Assertion through Spy processors and additionally verify
flows using Message verifiers (introspect payload at different flows
for flow navigation)
• Support Asynchronous flow processing and request-response
processors
• Mock without custom database or in memory database
• Automate test cases using Maven and generate HTML reports using
Surefire plugins