This document provides an overview of using Arquillian to test Java EE applications. It discusses creating test archives using ShrinkWrap or Maven, configuring Arquillian to run in managed or embedded mode, and including persistence functionality to generate test data from SQL scripts, XML/JSON, or manually in test code. The document contains code samples and dependencies needed to set up an Arquillian test.
A fresh look at Java Enterprise Application testing with ArquillianVineet Reynolds
This document discusses testing Java enterprise applications with Arquillian. It begins by describing some issues with traditional mocking approaches. It then demonstrates how Arquillian allows testing with real objects by running tests inside a container managed environment. Key aspects of Arquillian include using the @Deployment annotation to package classes and resources, dependency injection of test instances, and running tests without mocks by interacting with real objects. The document concludes by noting how Arquillian changes perspectives on testing and introduces the persistence extension for refining database integration tests.
Quality assurance and testing are very important in a life cycle of any application. Although, by far not all developers understand the significance of tests.
In this presentation, we cover the basic testing practices for developers. The following tools are discussed: JUnit, Mockito, Hamcrest, JsTestDriver, DBUnit, Arquillian, SoapUI, Selenium.
OrientDB - The 2nd generation of (multi-model) NoSQLRoberto Franchini
This document provides an overview of OrientDB, a multi-model database that combines features of document, graph, and other databases. It discusses data modeling and schema, querying and traversing graph data, full-text and spatial search, deployment scenarios, and APIs. Examples show creating classes and properties, inserting and querying graph data, and live reactive queries in OrientDB.
Java Deserialization Vulnerabilities - The Forgotten Bug Class (RuhrSec Edition)CODE WHITE GmbH
This document discusses Java deserialization vulnerabilities and provides an overview of how they work. It notes that many Java technologies rely on serialization which can enable remote code execution if not implemented securely. The document outlines the history of vulnerabilities found, how to find vulnerabilities, and techniques for exploiting them, using examples like the Javassist/Weld gadget. It also summarizes vulnerabilities the speaker's company Code White found, including in products from Symantec, Atlassian, Commvault, and Oracle.
Test-Driven Development and Android discusses TDD for Android applications. It describes integrating JUnit with Android and recommended test case classes for different testing needs such as activities, services, and content providers. It also covers running tests from the command line, setting up test fixtures with setUp() and tearDown(), grouping tests by size with annotations, and using Monkey to perform random stress testing. Functional testing of activities is possible using ActivityInstrumentationTestCase2.
This document discusses setting up a Selenium project with Maven and Jenkins for continuous integration. It describes installing and configuring Maven, creating a Maven project structure for Selenium, and setting up Jenkins to automatically run test cases and generate XSLT reports on the test results. Key steps include downloading and configuring Maven, creating a Maven project with dependencies in the pom.xml, and configuring Jenkins with the project details to enable continuous integration and reporting.
Java 9 introduces modules to the Java programming language and its runtime. Despite this feature being optional, due to the modularization of the standard library existing applications might behave differently when running on a version 9 JVM. Furthermore, because of changes in the runtime, existing libraries and frameworks might not yet correctly process your modularized code. As a result, updating to a Java 9 VM and taking Java 9 into brings its challanges.
This talk discusses the practical implications of module boundaries and analyzes new limitations Java 9 imposes on the reflection API. This talk explains how reflection is used in popular frameworks like Spring and Hibernate and explains why existing applications might break or change their behavior when facing modularized code. Finally, this talk showcases alternatives to now failing Java programming patterns and weights their robustness with regard to the Java releases 10 and upward.
The presenter is an active contributor to open source and helped to migrate many popular Java libraries to supporting Java 9. As a consequence, he as been working with Java 9 for almost two years.
The document discusses Glassfish Enterprise Server clustering. It covers installing a node agent on a second machine, creating a cluster with two instances running on different machines, deploying an application to the cluster, testing the clustered application, backing up and restoring the cluster. The key steps are installing node agents on two machines, creating a cluster with instances on each machine, deploying an application, and verifying it can be accessed from both machines. The cluster is then backed up and restored to demonstrate the process.
A fresh look at Java Enterprise Application testing with ArquillianVineet Reynolds
This document discusses testing Java enterprise applications with Arquillian. It begins by describing some issues with traditional mocking approaches. It then demonstrates how Arquillian allows testing with real objects by running tests inside a container managed environment. Key aspects of Arquillian include using the @Deployment annotation to package classes and resources, dependency injection of test instances, and running tests without mocks by interacting with real objects. The document concludes by noting how Arquillian changes perspectives on testing and introduces the persistence extension for refining database integration tests.
Quality assurance and testing are very important in a life cycle of any application. Although, by far not all developers understand the significance of tests.
In this presentation, we cover the basic testing practices for developers. The following tools are discussed: JUnit, Mockito, Hamcrest, JsTestDriver, DBUnit, Arquillian, SoapUI, Selenium.
OrientDB - The 2nd generation of (multi-model) NoSQLRoberto Franchini
This document provides an overview of OrientDB, a multi-model database that combines features of document, graph, and other databases. It discusses data modeling and schema, querying and traversing graph data, full-text and spatial search, deployment scenarios, and APIs. Examples show creating classes and properties, inserting and querying graph data, and live reactive queries in OrientDB.
Java Deserialization Vulnerabilities - The Forgotten Bug Class (RuhrSec Edition)CODE WHITE GmbH
This document discusses Java deserialization vulnerabilities and provides an overview of how they work. It notes that many Java technologies rely on serialization which can enable remote code execution if not implemented securely. The document outlines the history of vulnerabilities found, how to find vulnerabilities, and techniques for exploiting them, using examples like the Javassist/Weld gadget. It also summarizes vulnerabilities the speaker's company Code White found, including in products from Symantec, Atlassian, Commvault, and Oracle.
Test-Driven Development and Android discusses TDD for Android applications. It describes integrating JUnit with Android and recommended test case classes for different testing needs such as activities, services, and content providers. It also covers running tests from the command line, setting up test fixtures with setUp() and tearDown(), grouping tests by size with annotations, and using Monkey to perform random stress testing. Functional testing of activities is possible using ActivityInstrumentationTestCase2.
This document discusses setting up a Selenium project with Maven and Jenkins for continuous integration. It describes installing and configuring Maven, creating a Maven project structure for Selenium, and setting up Jenkins to automatically run test cases and generate XSLT reports on the test results. Key steps include downloading and configuring Maven, creating a Maven project with dependencies in the pom.xml, and configuring Jenkins with the project details to enable continuous integration and reporting.
Java 9 introduces modules to the Java programming language and its runtime. Despite this feature being optional, due to the modularization of the standard library existing applications might behave differently when running on a version 9 JVM. Furthermore, because of changes in the runtime, existing libraries and frameworks might not yet correctly process your modularized code. As a result, updating to a Java 9 VM and taking Java 9 into brings its challanges.
This talk discusses the practical implications of module boundaries and analyzes new limitations Java 9 imposes on the reflection API. This talk explains how reflection is used in popular frameworks like Spring and Hibernate and explains why existing applications might break or change their behavior when facing modularized code. Finally, this talk showcases alternatives to now failing Java programming patterns and weights their robustness with regard to the Java releases 10 and upward.
The presenter is an active contributor to open source and helped to migrate many popular Java libraries to supporting Java 9. As a consequence, he as been working with Java 9 for almost two years.
The document discusses Glassfish Enterprise Server clustering. It covers installing a node agent on a second machine, creating a cluster with two instances running on different machines, deploying an application to the cluster, testing the clustered application, backing up and restoring the cluster. The key steps are installing node agents on two machines, creating a cluster with instances on each machine, deploying an application, and verifying it can be accessed from both machines. The cluster is then backed up and restored to demonstrate the process.
Take Control of your Integration Testing with TestContainersNaresha K
Slides from my demonstration titled "Take Control of your Integration Testing with TestContainers". Demonstrates using TestContainers for RDBMS and test driving S3 API with localstack.
This document provides an overview of testing for Android applications. It discusses the fundamentals of testing including organizing code for testing, configuring the test environment, and writing different types of tests. Specifically, it covers unit testing Android applications with examples of writing unit tests for applications following the Clean Architecture pattern. It demonstrates how to test different layers including the domain layer with use cases, data layer with mappers and repositories, and remote data sources. The document emphasizes the importance of testing and provides guidance on test organization, environments, and coverage.
This document discusses developing Java applications in an agile way using SpringSource Tool Suite (STS) 2.3.2, Maven, Spring, and tcServer. It covers Spring Framework fundamentals and new features in Spring 3.0 like Java 5+ support and REST. It also summarizes STS, an Eclipse-based IDE for building Spring applications; tcServer, a lightweight application server; and Maven, a project management tool. Using these tools allows developers to focus on code instead of infrastructure and supports an agile development approach with quick iteration and hot deployment.
The document discusses unit testing and provides examples of writing unit tests in PHP using the PHPUnit framework. It explains what unit tests are, why they are useful for finding and preventing bugs, and different types of tests. It also demonstrates how to write tests for a "slugify" string method, use data providers to reduce duplicated code, and mock objects to test code in isolation without external dependencies like databases. The document advocates for test-driven development by writing tests before code. It also mentions how to integrate tests with version control using hooks and generate code coverage reports.
Gradle is a flexible, open source build automation tool that uses Groovy as a domain-specific language to define build logic and configuration. It is based on the principle of convention over configuration and provides a rich set of tasks and a directed acyclic graph (DAG) model to declaratively define and manipulate the execution of tasks. Gradle aims to provide a powerful yet user-friendly alternative to tools like Ant and Maven for compiling code, generating packages and archives, managing dependencies, and more.
An Overview of Deserialization Vulnerabilities in the Java Virtual Machine (J...joaomatosf_
- The document discusses Java object serialization vulnerabilities and remote code execution.
- It provides background on serialization/deserialization and how it can allow object injection and improper input validation.
- A key vulnerability discussed is CVE-2015-7501, which affected Apache Commons Collections and allowed remote code execution through a "gadget chain" triggered during deserialization.
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
This document discusses Maven plugins and testing with Maven. It provides information on running tests in parallel, skipping tests, including or excluding tests, and running single tests or methods. Instructions are given on installing plugins and adding dependencies to the local Maven repository. Common Maven concepts like unit testing, integration testing, Mojos, and plugins are also explained at a high level.
Eclipse Memory Analyzer Tool (MAT) helps visualize Java heap dumps to identify potential memory leaks and reduce memory consumption. It can quickly analyze heap dumps containing hundreds of millions of objects to calculate object retention sizes, check what is preventing garbage collection, and generate a leak suspects report. The documentation provides instructions on installing MAT and using it to analyze a heap dump created by adding -XX:+HeapDumpOnOutOfMemoryError when running a sample project designed to cause an OutOfMemoryError.
1. The document discusses Java concepts like serialization, reflection, JDBC, and distributed applications.
2. Serialization allows saving object state to a file by implementing the Serializable interface. Reflection obtains runtime information about classes.
3. JDBC is used to connect to databases and store data permanently. Distributed applications run across a network and allow for data sharing between clients.
JUG Summer Camp - Une nouvelle vision des tests avec ArquillianAlexis Hassler
La réalisation de tests unitaires est fondamentale pour développer des logiciels de qualité. Cependant, tout miser sur eux est illusoire, car il faudra à un moment ou un autre vérifier que les composants interagissent convenablement et que leur intégration dans l'environnement cible fonctionne comme prévu. De plus, si l'application fournit une interface graphique, il faut vérifier si les interactions avec celle-ce sont corrects.
Arquillian est une plateforme qui est en train de révolutionner la façon de développer les tests d'intégration et fonctionnels dans le monde Java. Et malgré des défauts de jeunesse, Arquillian permet de faire des tests automatisés de composants et d'applications Java, depuis la persistance jusqu'à l'interface graphique, en couvrant un périmètre qui dépasse largement son cadre initial qui était Java EE.
Lors de cette session, vous apprendrez comment Arquillian est capable de tester :
- l'intégration de composants Java EE, sur différents serveurs d'applications,
- le code de persistance avec l'extension APE,
- les interfaces Web, en facilitant l'utilisation de Selenium.
Présentation au JUG Summer Camp 2013 : http://www.jugsummercamp.com/edition/4/presentation/1073
Defending against Java Deserialization VulnerabilitiesLuca Carettoni
Java deserialization vulnerabilities have recently gained popularity due to a renewed interest from the security community. Despite being publicly discussed for several years, a significant number of Java based products are still affected. Whenever untrusted data is used within deserialization methods, an attacker can abuse this simple design anti-pattern to compromise your application. After a quick introduction of the problem, this talk will focus on discovering and defending against deserialization vulnerabilities. I will present a collection of techniques for mitigating attacks when turning off object serialization is not an option, and we will discuss practical recommendations that developers can use to help prevent these attacks.
Resting on your laurels will get you pownedDinis Cruz
Presentation delivered at BlackHat 2013. See these posts for more details on the Demos: http://blog.diniscruz.com/2013/08/using-xmldecoder-to-execute-server-side.html ., http://blog.diniscruz.com/2013/08/neo4j-csrf-payload-to-start-processes.html
This document provides an introduction to Spring Boot, including its objectives, key principles, and features. It discusses how Spring Boot enables building standalone, production-grade Spring applications with minimal configuration. It demonstrates creating a "Hello World" REST app with one Java class. It also covers auto-configuration, application configuration, testing, supported technologies, case studies, and other features like production readiness and remote shell access.
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...PROIDEA
SPRYTNIEJSZE TESTOWANIE KODU JAVA ZE SPOCK FRAMEWORK (ZAAWANSOWANE TECHNIKI)
Spock Framework jest coraz częściej wykorzystywany do pisania testów automatycznych dla kodu produkcyjnego napisanego w Javie. Dzięki zastosowaniu DSLa opartego o język Groovy umożliwia tworzenie bardziej zwartych konstrukcji charakteryzujących się dużą czytelnością. W czasie prezentacji pokażę szereg bardziej zaawansowanych i często mało znanych mechanizmów, których zastosowanie może jeszcze bardziej ułatwić i uprościć testowanie naszego kodu. Przedstawię również kilka nowych funkcji, które stały się dostępne wraz z wydaniem wersji 1.0. O podstawach Spocka mówić nie będę, ale dzięki jego naturalnej klarowności nawet osoby wcześniej go nieużywające na pewno nie będą miały trudności, aby się odnaleźć.
Here are the steps to implement a filter to redirect requests to a maintenance page:
1. Create a class that implements the Filter interface.
2. Add init(), doFilter() and destroy() methods.
3. In doFilter(), get the request URI and check if it is the home page URL.
4. If it is the home page, get the response and send a redirect to the maintenance page.
5. Else, pass the request and response to the filter chain.
6. Map the filter in web.xml, specifying the URL pattern as /* to apply to all requests.
7. Create the maintenance page that displays the message.
8. Deploy and test
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Peter Pilgrim
In this session, we introduce the Java developer to the Arquillian framework, Gradle and the Enterprise container technologies in Java EE 7. As a lucrative bonus we will cover building EJB and Java EE 7 tests applications with Gradle, the latest and greatest build framework for the Java platform, which improves on Apache Maven. The Java EE specification full contains three different containers, namely the Web, the EJB and the CDI containers. All of them can be reached using the Arquillian Framework, and this means there is now one general testing framework, which developers should learn as part of their professional duties. The session will cover writing meaningful tests for CDI, EJB and JAX-RS. Along the way, we will introduce new features of EJB 3.2, CDI 1.1 and RESTful Services. GlassFish Embedded Container 4.0 will be demonstrated.
The document discusses the role of humans ("the I") in artificial intelligence (AI). It argues that while AI can automate well-defined tasks, humans are still needed to interpret outcomes, discover new contexts, and determine what constitutes value. True intelligence is demonstrated through creative problem solving in unfamiliar situations. While AI can become more capable over time through advances in processing power, humans remain uniquely able to apply their judgment and understanding of purpose and usefulness.
Este documento ofrece una guía sobre los costos típicos de desarrollar una aplicación móvil. Explica que el precio depende de factores como el alcance de la funcionalidad, si es una app nativa o basada en web, si requiere conectividad con un servidor, el diseño, testing, soporte, marketing y más. Provee algunos rangos de precios como $1,500 para una app básica sin código, $10,000-$90,000 para una app mediana con testing y soporte, y $100,000-$300,000 para
Dr. John Parker: The Lentegeur Spring: recovery and hope in a psychiatric ins...SACAP
The purpose of the Lentegeur Spring Foundation is to bring alive this beautiful name, helping
the hospital to evolve into a place that gives birth to hope through re-connection in every
possible way!
La Unión Europea ha acordado un embargo petrolero contra Rusia en respuesta a la invasión de Ucrania. El embargo prohibirá las importaciones marítimas de petróleo ruso a la UE y pondrá fin a las entregas a través de oleoductos dentro de seis meses. Esta medida forma parte de un sexto paquete de sanciones de la UE destinadas a aumentar la presión económica sobre el gobierno de Putin.
Este documento presenta la información sobre un curso de Venezuela y su Política Exterior impartido en la Universidad Simón Bolívar. El curso analiza las políticas exteriores de los gobiernos de Luis Herrera Campins, Jaime Lusinchi y Carlos Andrés Pérez durante la década de 1980. Los objetivos son que los estudiantes conozcan los principales problemas y acciones de la política exterior venezolana a través del análisis de estas administraciones. El contenido incluye las diversas áreas de interés de la política exterior y las acciones
Take Control of your Integration Testing with TestContainersNaresha K
Slides from my demonstration titled "Take Control of your Integration Testing with TestContainers". Demonstrates using TestContainers for RDBMS and test driving S3 API with localstack.
This document provides an overview of testing for Android applications. It discusses the fundamentals of testing including organizing code for testing, configuring the test environment, and writing different types of tests. Specifically, it covers unit testing Android applications with examples of writing unit tests for applications following the Clean Architecture pattern. It demonstrates how to test different layers including the domain layer with use cases, data layer with mappers and repositories, and remote data sources. The document emphasizes the importance of testing and provides guidance on test organization, environments, and coverage.
This document discusses developing Java applications in an agile way using SpringSource Tool Suite (STS) 2.3.2, Maven, Spring, and tcServer. It covers Spring Framework fundamentals and new features in Spring 3.0 like Java 5+ support and REST. It also summarizes STS, an Eclipse-based IDE for building Spring applications; tcServer, a lightweight application server; and Maven, a project management tool. Using these tools allows developers to focus on code instead of infrastructure and supports an agile development approach with quick iteration and hot deployment.
The document discusses unit testing and provides examples of writing unit tests in PHP using the PHPUnit framework. It explains what unit tests are, why they are useful for finding and preventing bugs, and different types of tests. It also demonstrates how to write tests for a "slugify" string method, use data providers to reduce duplicated code, and mock objects to test code in isolation without external dependencies like databases. The document advocates for test-driven development by writing tests before code. It also mentions how to integrate tests with version control using hooks and generate code coverage reports.
Gradle is a flexible, open source build automation tool that uses Groovy as a domain-specific language to define build logic and configuration. It is based on the principle of convention over configuration and provides a rich set of tasks and a directed acyclic graph (DAG) model to declaratively define and manipulate the execution of tasks. Gradle aims to provide a powerful yet user-friendly alternative to tools like Ant and Maven for compiling code, generating packages and archives, managing dependencies, and more.
An Overview of Deserialization Vulnerabilities in the Java Virtual Machine (J...joaomatosf_
- The document discusses Java object serialization vulnerabilities and remote code execution.
- It provides background on serialization/deserialization and how it can allow object injection and improper input validation.
- A key vulnerability discussed is CVE-2015-7501, which affected Apache Commons Collections and allowed remote code execution through a "gadget chain" triggered during deserialization.
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
This document discusses Maven plugins and testing with Maven. It provides information on running tests in parallel, skipping tests, including or excluding tests, and running single tests or methods. Instructions are given on installing plugins and adding dependencies to the local Maven repository. Common Maven concepts like unit testing, integration testing, Mojos, and plugins are also explained at a high level.
Eclipse Memory Analyzer Tool (MAT) helps visualize Java heap dumps to identify potential memory leaks and reduce memory consumption. It can quickly analyze heap dumps containing hundreds of millions of objects to calculate object retention sizes, check what is preventing garbage collection, and generate a leak suspects report. The documentation provides instructions on installing MAT and using it to analyze a heap dump created by adding -XX:+HeapDumpOnOutOfMemoryError when running a sample project designed to cause an OutOfMemoryError.
1. The document discusses Java concepts like serialization, reflection, JDBC, and distributed applications.
2. Serialization allows saving object state to a file by implementing the Serializable interface. Reflection obtains runtime information about classes.
3. JDBC is used to connect to databases and store data permanently. Distributed applications run across a network and allow for data sharing between clients.
JUG Summer Camp - Une nouvelle vision des tests avec ArquillianAlexis Hassler
La réalisation de tests unitaires est fondamentale pour développer des logiciels de qualité. Cependant, tout miser sur eux est illusoire, car il faudra à un moment ou un autre vérifier que les composants interagissent convenablement et que leur intégration dans l'environnement cible fonctionne comme prévu. De plus, si l'application fournit une interface graphique, il faut vérifier si les interactions avec celle-ce sont corrects.
Arquillian est une plateforme qui est en train de révolutionner la façon de développer les tests d'intégration et fonctionnels dans le monde Java. Et malgré des défauts de jeunesse, Arquillian permet de faire des tests automatisés de composants et d'applications Java, depuis la persistance jusqu'à l'interface graphique, en couvrant un périmètre qui dépasse largement son cadre initial qui était Java EE.
Lors de cette session, vous apprendrez comment Arquillian est capable de tester :
- l'intégration de composants Java EE, sur différents serveurs d'applications,
- le code de persistance avec l'extension APE,
- les interfaces Web, en facilitant l'utilisation de Selenium.
Présentation au JUG Summer Camp 2013 : http://www.jugsummercamp.com/edition/4/presentation/1073
Defending against Java Deserialization VulnerabilitiesLuca Carettoni
Java deserialization vulnerabilities have recently gained popularity due to a renewed interest from the security community. Despite being publicly discussed for several years, a significant number of Java based products are still affected. Whenever untrusted data is used within deserialization methods, an attacker can abuse this simple design anti-pattern to compromise your application. After a quick introduction of the problem, this talk will focus on discovering and defending against deserialization vulnerabilities. I will present a collection of techniques for mitigating attacks when turning off object serialization is not an option, and we will discuss practical recommendations that developers can use to help prevent these attacks.
Resting on your laurels will get you pownedDinis Cruz
Presentation delivered at BlackHat 2013. See these posts for more details on the Demos: http://blog.diniscruz.com/2013/08/using-xmldecoder-to-execute-server-side.html ., http://blog.diniscruz.com/2013/08/neo4j-csrf-payload-to-start-processes.html
This document provides an introduction to Spring Boot, including its objectives, key principles, and features. It discusses how Spring Boot enables building standalone, production-grade Spring applications with minimal configuration. It demonstrates creating a "Hello World" REST app with one Java class. It also covers auto-configuration, application configuration, testing, supported technologies, case studies, and other features like production readiness and remote shell access.
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...PROIDEA
SPRYTNIEJSZE TESTOWANIE KODU JAVA ZE SPOCK FRAMEWORK (ZAAWANSOWANE TECHNIKI)
Spock Framework jest coraz częściej wykorzystywany do pisania testów automatycznych dla kodu produkcyjnego napisanego w Javie. Dzięki zastosowaniu DSLa opartego o język Groovy umożliwia tworzenie bardziej zwartych konstrukcji charakteryzujących się dużą czytelnością. W czasie prezentacji pokażę szereg bardziej zaawansowanych i często mało znanych mechanizmów, których zastosowanie może jeszcze bardziej ułatwić i uprościć testowanie naszego kodu. Przedstawię również kilka nowych funkcji, które stały się dostępne wraz z wydaniem wersji 1.0. O podstawach Spocka mówić nie będę, ale dzięki jego naturalnej klarowności nawet osoby wcześniej go nieużywające na pewno nie będą miały trudności, aby się odnaleźć.
Here are the steps to implement a filter to redirect requests to a maintenance page:
1. Create a class that implements the Filter interface.
2. Add init(), doFilter() and destroy() methods.
3. In doFilter(), get the request URI and check if it is the home page URL.
4. If it is the home page, get the response and send a redirect to the maintenance page.
5. Else, pass the request and response to the filter chain.
6. Map the filter in web.xml, specifying the URL pattern as /* to apply to all requests.
7. Create the maintenance page that displays the message.
8. Deploy and test
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Peter Pilgrim
In this session, we introduce the Java developer to the Arquillian framework, Gradle and the Enterprise container technologies in Java EE 7. As a lucrative bonus we will cover building EJB and Java EE 7 tests applications with Gradle, the latest and greatest build framework for the Java platform, which improves on Apache Maven. The Java EE specification full contains three different containers, namely the Web, the EJB and the CDI containers. All of them can be reached using the Arquillian Framework, and this means there is now one general testing framework, which developers should learn as part of their professional duties. The session will cover writing meaningful tests for CDI, EJB and JAX-RS. Along the way, we will introduce new features of EJB 3.2, CDI 1.1 and RESTful Services. GlassFish Embedded Container 4.0 will be demonstrated.
The document discusses the role of humans ("the I") in artificial intelligence (AI). It argues that while AI can automate well-defined tasks, humans are still needed to interpret outcomes, discover new contexts, and determine what constitutes value. True intelligence is demonstrated through creative problem solving in unfamiliar situations. While AI can become more capable over time through advances in processing power, humans remain uniquely able to apply their judgment and understanding of purpose and usefulness.
Este documento ofrece una guía sobre los costos típicos de desarrollar una aplicación móvil. Explica que el precio depende de factores como el alcance de la funcionalidad, si es una app nativa o basada en web, si requiere conectividad con un servidor, el diseño, testing, soporte, marketing y más. Provee algunos rangos de precios como $1,500 para una app básica sin código, $10,000-$90,000 para una app mediana con testing y soporte, y $100,000-$300,000 para
Dr. John Parker: The Lentegeur Spring: recovery and hope in a psychiatric ins...SACAP
The purpose of the Lentegeur Spring Foundation is to bring alive this beautiful name, helping
the hospital to evolve into a place that gives birth to hope through re-connection in every
possible way!
La Unión Europea ha acordado un embargo petrolero contra Rusia en respuesta a la invasión de Ucrania. El embargo prohibirá las importaciones marítimas de petróleo ruso a la UE y pondrá fin a las entregas a través de oleoductos dentro de seis meses. Esta medida forma parte de un sexto paquete de sanciones de la UE destinadas a aumentar la presión económica sobre el gobierno de Putin.
Este documento presenta la información sobre un curso de Venezuela y su Política Exterior impartido en la Universidad Simón Bolívar. El curso analiza las políticas exteriores de los gobiernos de Luis Herrera Campins, Jaime Lusinchi y Carlos Andrés Pérez durante la década de 1980. Los objetivos son que los estudiantes conozcan los principales problemas y acciones de la política exterior venezolana a través del análisis de estas administraciones. El contenido incluye las diversas áreas de interés de la política exterior y las acciones
http://bit.ly/PwCRA2014
PwC publie son rapport annuel mondial pour l'année fiscale 2014 : chiffres, performances, implantations… et l'interview du président Dennis Nally. A lire ici !
El documento resume un torneo de fútbol infantil que se llevará a cabo en Gaeta Huguet. El torneo contará con dos grupos de 4 equipos cada uno que jugarán la fase de clasificación el viernes y sábado por la mañana. El sábado por la tarde habrá semifinales y semifinales de consolación, y el domingo se jugarán los partidos por el tercer y cuarto puesto y el séptimo y octavo puesto.
Faire évoluer la maturité des process ICP (incidents changements et problè...SAID BELKAID
Bonjour à tous,
Je souhaite partager ce retour d’expérience qui a pour objectif d’apporter des réponses à 4 questions principales :
1. Comment faire évoluer la maturité des processus ITIL ?
2. Comment s’inscrire dans une démarche d’amélioration continue des processus/services ?
3. Comment améliorer les contrôles de 2ème niveau pour les équipes Risques Opérationnels/RSSI ?
4. Comment évaluer la maturité des processus ITIL de votre client ?
Bonne lecture
Cordialement
This document provides an overview of modern art, science, and society from 1815-1914. It summarizes key developments in several areas: Romanticism focused on nature and individual genius; Realism portrayed working class life realistically; Darwin proposed natural selection and ideas of social Darwinism emerged; modern physics advanced with discoveries like x-rays; Impressionism involved painting outdoor scenes; photography and film were invented; standards of living and leisure activities increased for many. Overall it describes major cultural, scientific, economic and social changes during this period.
1. A client application makes a loan quote request to a LoanBroker service, which creates a LoanQuoteRequest message.
2. The message is sent to various services via JMS to retrieve a credit profile, get lender recommendations, and request quotes from banks.
3. The responses from the banks are returned to the LoanBroker, which selects the lowest quote and returns it to the client.
The document discusses different ways to configure and use Arquillian for integration testing Java EE applications. It covers creating test archives, configuring Arquillian, and different approaches for setting up test data like using SQL scripts, manually creating data, or importing from JSON/XML files. The key points are creating test archives with Maven or ShrinkWrap, configuring the Arquillian XML file and Maven dependencies, and using annotations to apply SQL scripts or import test data sets before tests run.
Arquillian is an innovative and highly extensible testing platform for the JVM that enables developers to easily create automated integration, functional and acceptance tests for Java middleware, from Java EE and beyond.
For years we’ve been exploring how to layer and separate our code to test in isolation on the unit level. We’ve kept integration and functional testing as a big ball of mud; jumping straight from unit to full system testing. But can we apply some of the same lessons learned from unit to integration testing?
Speaker Bio:
Arquillian project lead, Aslak Knutsen, is a Senior Software Engineer at Red Hat where he is working on projects such as Arquillian and ShrinkWrap, one of the founders of the JBoss Testing initiative and a speaker at major industry conferences including JavaOne, Devoxx, Jazoon, JFokus, Geecon, JUDCon and JBoss World.
Testing the Enterprise Layers - the A, B, C's of Integration Testing - Aslak ...JAXLondon2014
The document summarizes Arquillian, a testing platform that allows tests to run inside containers. It provides three key points:
1. Arquillian Core allows tests to run portably across any supported container.
2. Tests can be run from IDEs and build tools.
3. Arquillian extends and integrates with test frameworks like JUnit and TestNG, and supports containers including WildFly, Tomcat, GlassFish and more.
The document discusses challenges with testing Java EE applications and introduces Arquillian as a framework that aims to make testing easier. It provides flexibility through pluggable components, allows testing directly from IDEs, and abstracts server lifecycles. Key features include bundling test dependencies without repackaging, injecting resources into tests, and supporting various containers and test frameworks.
how to write functional tests with Selenium. how to set up Selenium Testing On Grails Apps In Continuous
Integration Using two approaches: The long way – using Maven and/or Ant The fast way, using the grails-
selenium-rc plug-in - ( see
http://buildchimp.com/wordpress/?p=241 )
Jackrabbit is an open source content repository for Java that implements the JCR 2.0 specification. It provides a flexible, hierarchical content storage system with features like full text search, versioning, transactions, and observation. Jackrabbit entered the Apache incubator in 2004 and graduated in 2006. It provides APIs and implementations for embedding a content repository, accessing it remotely over RMI, or deploying it as a shared resource using a servlet container or J2EE application server. The document discusses Jackrabbit's architecture, configuration, indexing, data storage, content modeling, and common issues around content hierarchies and concurrent edits.
San Francisco Java User Group presents Chris Bedford who talks about:
- How to write functional tests with Selenium (including explaining its IDE, architecture, RC, and alternatives like Canoo WebTest)
- How to set up Selenium testing for web apps in continuous integration using Maven, Ant, Cargo, etc.
- How to use Hudson for build server (brief overview)
January 12, 2010 in San Francisco, CA
http://www.sfjava.org/calendar/11982857/
Hosted by SUPINFO International University
Sponsored by TEKsystems, Guidewire Software, Sun, O'Reilly, JetBrains, and Marakana.
Video by Max Walker
Organized by Marakana
This document provides instructions for running a JavaServer Page (JSP) program using the Apache Tomcat web server. It describes how to install Java and Apache Tomcat, create a simple "Hello World" JSP file, and access it by entering a URL in a web browser. Key steps include creating a JSP file called "first.jsp", adding it to a project folder, and accessing it at a URL like http://localhost:8080/projectfolder/first.jsp to run the program on the Tomcat server.
The document discusses best practices for developing jQuery plugins. It covers defining a private scope, using a template, understanding the plugin syntax, adding options through object literals, and iterating through matched elements using this.each(). The key steps are to make the plugin easy to use, use good naming conventions, define a closure, set default parameters, allow chaining by returning this, document the code, and thoroughly test the plugin.
Maven 2 is a powerful tool that promotes convention over configuration and you need to
integrate it into one of the popular integrated development environments (IDEs) called
eclipse to make your work easier, thus increasing your productivity and project quality. This
tutorial provides an example of how to make Maven and Eclipse collaborate. Also covers the
popular JSF Web framework.
- Hashtable is synchronized while HashMap is not, making HashMap better for non-threaded applications.
- Hashtable does not allow null keys or values, while HashMap allows one null key and any number of null values.
- The performance of HashMap is better than Hashtable as HashMap is unsynchronized.
Java Deserialization Vulnerabilities - The Forgotten Bug ClassCODE WHITE GmbH
This document discusses Java deserialization vulnerabilities. It provides an introduction to how Java serialization works and what the security issues are. Specifically, it describes how an attacker can exploit vulnerabilities to remotely execute code on a server by deserializing malicious objects. The document gives examples of past vulnerabilities found in various Java applications and frameworks. It also provides tips for finding vulnerabilities and generating payloads to demonstrate exploits.
Level Up Your Integration Testing With TestcontainersVMware Tanzu
The document discusses Testcontainers, a Java library that makes it easy to create lightweight, disposable Docker containers to support integration testing. Testcontainers allows developers to start containers for databases, browsers, and other services via simple annotations and eliminates the need to manage complex Docker configurations and container lifecycles manually. It integrates with JUnit and handles starting a new container before each test and cleaning it up afterwards, improving testing fidelity by mimicking production environments.
This document summarizes 10 upcoming features in JDK 7:
1. Switch statements can now use Strings as case values.
2. Automatic Resource Management (ARM) simplifies try-with-resources statements.
3. Dynamic method invocation allows calling methods only known at runtime.
4. ThreadLocalRandom provides thread-safe random number generation.
5. java.util.Objects contains utility methods for null checks and hashCode/equals.
6. Deep equals allows deep comparison of objects and arrays.
7. Exceptions can be caught by multiple exception types.
8. Static methods can now be overridden in interfaces.
9. The new File API improves file I/O exceptions and performance.
The document discusses how to use Embedded GlassFish to boost productivity by running GlassFish within a Java application using APIs to start, deploy to, and manage GlassFish. It provides an overview of the Embedded GlassFish APIs, distributions, and Maven plugin as well as use cases and the current state of Embedded GlassFish. The Embedded GlassFish APIs allow developers to programmatically start an embedded GlassFish instance, deploy applications to it, and access services like the web container.
The document discusses implementing quality on Java projects. It provides five tips for ensuring quality: (1) maintaining API stability by avoiding deprecations and changes to public interfaces, (2) preventing "JAR hell" by avoiding duplicate dependencies and version conflicts, (3) enforcing high test coverage using tools like Jacoco, (4) improving stability of functional tests by filtering false positives in CI builds, and (5) dedicating time regularly for fixing bugs through a "Bug Fixing Day".
The document discusses Docker, including what it is, its benefits and architecture. Docker provides an abstraction layer that allows applications to be packaged into lightweight containers that can run on any infrastructure. The key components of Docker include images, which are templates used to create containers that run applications in isolated environments. The document then provides instructions on installing Docker and using basic commands like running containers from images and pulling new images from registries.
The document discusses the relationships between various concepts related to data analysis including big data, machine learning, business intelligence, and knowledge discovery in databases (KDD). It states that KDD refers to the overall process of discovering useful knowledge from data and focuses on how data is stored, accessed, and analyzed. Data mining is a part of the KDD process that uses techniques from artificial intelligence, statistics, and machine learning to extract and transform information from datasets. Machine learning develops the algorithms used in data mining to learn from data. Big data refers to analyzing huge, unstructured data using distributed computing and new tools. Business intelligence uses analytical techniques to present actionable information for business decision making.
This document provides information about OPC connectivity using Java. It discusses what OPC is, why it was developed, and provides examples of companies using OPC like Bosch and ABB. It then describes a case study of implementing an OPC client in Java using the Utgard library and connecting to a Matrikon OPC server for simulation. It outlines the steps to configure DCOM and Eclipse, and includes code examples for reading and writing tags.
This document provides an introduction to machine learning, including definitions, applications, and types of problems. It discusses how machine learning can be applied to data from sensors in industrial settings for tasks like risk prevention in real-time, searching historical data for patterns related to failures, estimating machine lifespan and product quality, and enabling more automated intelligent systems. Large amounts of data are generated every day from various sources, making it impossible for humans to analyze, but machine learning can find hidden patterns in this data.
This document discusses Java EE architecture and patterns. It provides an overview of the latest Java EE technologies, including the Entity, Control, and Boundary (ECB) pattern. It also covers concepts like convention over configuration, annotations, dependency injection, bean validation, and interceptors/aspect-oriented programming in Java EE. The document includes examples and labs/exercises for attendees to implement these techniques in Java EE applications.
This document discusses Industry 4.0 and what it means for the partnership between Tekniker/ES and Brockhaus Group. It defines Industry 4.0 as the fourth industrial revolution focused on software and information processing. It describes how Industry 4.0 will enable decentralized production through smart objects, autonomous products, and real-time decision making. For the partnership, Industry 4.0 means opportunities to improve production quality through data analysis, optimize maintenance through equipment prognostics, and enable new ways of interacting with equipment via mobile devices and augmented reality. Example reference projects are described that apply predictive maintenance, anomaly detection, and big data analysis to wind turbines, machine tools, and automotive production lines.
10.000 ft. overview about the options of storing values of 250.000 sensors from a paint shop in automotive sector; presentation for the management of one of our customers.
The document discusses the architectural process that a software architect undertakes. It begins with gathering information such as reviewing existing solutions and patterns. The architect then develops an initial idea of the system, identifies important drivers and boundaries, and risks. Key aspects of quality are defined using scenarios. The architect then develops strategies to address the identified risks and quality aspects.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
What to do when you have a perfect model for your software but you are constrained by an imperfect business model?
This talk explores the challenges of bringing modelling rigour to the business and strategy levels, and talking to your non-technical counterparts in the process.
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
Boost Your Savings with These Money Management AppsJhone kinadey
A money management app can transform your financial life by tracking expenses, creating budgets, and setting financial goals. These apps offer features like real-time expense tracking, bill reminders, and personalized insights to help you save and manage money effectively. With a user-friendly interface, they simplify financial planning, making it easier to stay on top of your finances and achieve long-term financial stability.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Manyata Tech Park Bangalore_ Infrastructure, Facilities and Morenarinav14
Located in the bustling city of Bangalore, Manyata Tech Park stands as one of India’s largest and most prominent tech parks, playing a pivotal role in shaping the city’s reputation as the Silicon Valley of India. Established to cater to the burgeoning IT and technology sectors
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...kalichargn70th171
In today's fiercely competitive mobile app market, the role of the QA team is pivotal for continuous improvement and sustained success. Effective testing strategies are essential to navigate the challenges confidently and precisely. Ensuring the perfection of mobile apps before they reach end-users requires thoughtful decisions in the testing plan.
Orca: Nocode Graphical Editor for Container OrchestrationPedro J. Molina
Tool demo on CEDI/SISTEDES/JISBD2024 at A Coruña, Spain. 2024.06.18
"Orca: Nocode Graphical Editor for Container Orchestration"
by Pedro J. Molina PhD. from Metadev
Nashik's top web development company, Upturn India Technologies, crafts innovative digital solutions for your success. Partner with us and achieve your goals
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
Superpower Your Apache Kafka Applications Development with Complementary Open...Paul Brebner
Kafka Summit talk (Bangalore, India, May 2, 2024, https://events.bizzabo.com/573863/agenda/session/1300469 )
Many Apache Kafka use cases take advantage of Kafka’s ability to integrate multiple heterogeneous systems for stream processing and real-time machine learning scenarios. But Kafka also exists in a rich ecosystem of related but complementary stream processing technologies and tools, particularly from the open-source community. In this talk, we’ll take you on a tour of a selection of complementary tools that can make Kafka even more powerful. We’ll focus on tools for stream processing and querying, streaming machine learning, stream visibility and observation, stream meta-data, stream visualisation, stream development including testing and the use of Generative AI and LLMs, and stream performance and scalability. By the end you will have a good idea of the types of Kafka “superhero” tools that exist, which are my favourites (and what superpowers they have), and how they combine to save your Kafka applications development universe from swamploads of data stagnation monsters!
Odoo releases a new update every year. The latest version, Odoo 17, came out in October 2023. It brought many improvements to the user interface and user experience, along with new features in modules like accounting, marketing, manufacturing, websites, and more.
The Odoo 17 update has been a hot topic among startups, mid-sized businesses, large enterprises, and Odoo developers aiming to grow their businesses. Since it is now already the first quarter of 2024, you must have a clear idea of what Odoo 17 entails and what it can offer your business if you are still not aware of it.
This blog covers the features and functionalities. Explore the entire blog and get in touch with expert Odoo ERP consultants to leverage Odoo 17 and its features for your business too.
An Overview of Odoo ERP
Odoo ERP was first released as OpenERP software in February 2005. It is a suite of business applications used for ERP, CRM, eCommerce, websites, and project management. Ten years ago, the Odoo Enterprise edition was launched to help fund the Odoo Community version.
When you compare Odoo Community and Enterprise, the Enterprise edition offers exclusive features like mobile app access, Odoo Studio customisation, Odoo hosting, and unlimited functional support.
Today, Odoo is a well-known name used by companies of all sizes across various industries, including manufacturing, retail, accounting, marketing, healthcare, IT consulting, and R&D.
The latest version, Odoo 17, has been available since October 2023. Key highlights of this update include:
Enhanced user experience with improvements to the command bar, faster backend page loading, and multiple dashboard views.
Instant report generation, credit limit alerts for sales and invoices, separate OCR settings for invoice creation, and an auto-complete feature for forms in the accounting module.
Improved image handling and global attribute changes for mailing lists in email marketing.
A default auto-signature option and a refuse-to-sign option in HR modules.
Options to divide and merge manufacturing orders, track the status of manufacturing orders, and more in the MRP module.
Dark mode in Odoo 17.
Now that the Odoo 17 announcement is official, let’s look at what’s new in Odoo 17!
What is Odoo ERP 17?
Odoo 17 is the latest version of one of the world’s leading open-source enterprise ERPs. This version has come up with significant improvements explained here in this blog. Also, this new version aims to introduce features that enhance time-saving, efficiency, and productivity for users across various organisations.
Odoo 17, released at the Odoo Experience 2023, brought notable improvements to the user interface and added new functionalities with enhancements in performance, accessibility, data analysis, and management, further expanding its reach in the market.
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Paul Brebner
Closing talk for the Performance Engineering track at Community Over Code EU (Bratislava, Slovakia, June 5 2024) https://eu.communityovercode.org/sessions/2024/why-apache-kafka-clusters-are-like-galaxies-and-other-cosmic-kafka-quandaries-explored/ Instaclustr (now part of NetApp) manages 100s of Apache Kafka clusters of many different sizes, for a variety of use cases and customers. For the last 7 years I’ve been focused outwardly on exploring Kafka application development challenges, but recently I decided to look inward and see what I could discover about the performance, scalability and resource characteristics of the Kafka clusters themselves. Using a suite of Performance Engineering techniques, I will reveal some surprising discoveries about cosmic Kafka mysteries in our data centres, related to: cluster sizes and distribution (using Zipf’s Law), horizontal vs. vertical scalability, and predicting Kafka performance using metrics, modelling and regression techniques. These insights are relevant to Kafka developers and operators.
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Arquillian in a nutshell
1. Arquillian in a nutshell
Copyright and all intellectual property belongs to Brockhaus Group 1
2. Preface
Targeted audience
Get the code
Why Arquillian?
The first test
Creating the archive
Create the archive using ShrinkWrap
Create the archive using maven
Configuring Arquillian
Configuring the runtime modes of arquillian
Managed container config
Embedded container config
Including persistency (extension)
Creating test data manually using a pre-filled database
Creating test data manually
Creating test data by SQL script
Creating test data by means of JSON/XML (or YML)
Some kind of round trip
Copyright and all intellectual property belongs to Brockhaus Group 2
3. Preface
This is a paper provided by Brockhaus Group for free. All
content was checked and all code was tested carefully; in
case of questions of suggestions to improve we will be happy
to receive you email at:
getKnowledge@brockhaus-group.com
Targeted audience
People interested in using Arquillian with a sound knowledge in Java EE technologies, this paper won’t
explain the details of the Java EE platform. The examples have been tested using JBoss EAP 6.1.1 and
the H2 database.
Get the code
All code used for this examples can be found here (zipped Maven project):
ftp: www.brockhaus-gruppe.de
directory: /getKnowledge/arquillian
user: ftpguest
pwd: ftpguest789
Download, unpack, you’re done
Copyright and all intellectual property belongs to Brockhaus Group 3
4. Why Arquillian?
Testing of complex. multi-layered Java EE applications still is pretty difficult as in many cases the
services offered by the container needs to be in place. Just think of CDI, various annotations,
datasources and so on. One might say, that mocking might replace these concerns and partially this is
correct but still there is a gap between what is provided and what is expected. Arquillian tries to close
this gap by:
● maintaining the life-cycle of of a container (and despite the fact Arquillian is a JBoss project
there are more containers supported than just JBoss )1
● combining all resources to a deployable artifact and providing some facilities to deploy these
Several plugins are available:
● Drone (includes Selenium to test the UI as well)
● Persistence (to create test data out of various formats like XML and JSON)
● Jacoco (to get some metrics about code coverage)
The first test
At first sight an arquillian test doesn’t differ much from a regular unit test:
@RunWith(Arquillian.class)
publicclassCalculatorArquillianTest{
//mustbe@EJB,can'tbe@Inject!Ifyoudon'tbelieve,youcantry...
@EJB
privateCalculatorcalc;
//theoneyouneedunderanycircumstance
@Deployment
publicstaticArchive<?>createTestArchive(){
//checkthehelperfordetailsofhowtogetthethingspackaged
Archive<?>archive=ArchiveHelper.getArchive();
returnarchive;
}
@Test
publicvoidtestAddNumbers(){
floatresult=calc.add(1,2);
Assert.assertEquals(3,result,0);
}
}
The only remarkable things are the @RunWith(Arquillian.class)and the @Deploymentannotations.
Regarding the @RunWithannotation we should not spent too many words, The @Deploymentannotation
looks much more interesting as it seems as if some groundwork is laid in there.
1
This paper will cover JBoss EAP 6.1.1 only
Copyright and all intellectual property belongs to Brockhaus Group 4
5. Creating the archive
One of the main purposes of the method annotated with @Deploymentis to provide the artifact to be
tested.
//theoneyouneedunderanycircumstance
@Deployment
publicstaticArchive<?>createTestArchive(){
//checkthehelperfordetailsofhowtogetthethingspackaged
Archive<?>archive=ArchiveHelper.getArchive();
returnarchive;
}
We have made use of some kind of helper to create the archive as there are two options which will be
explained in more detail.
Create the archive using ShrinkWrap
Using this handy tool, any JavaEE deployable artifact can be created on the fly.
/**doingitthehardway...guessyouwon'tlikeitasEVERYclassplusrelatedstuffneedstobe
specified*/
privatestaticArchive<?>getArchiveManually(){
//creatingarchivemanually
JavaArchiveartifact=
ShrinkWrap.create(JavaArchive.class,ARCHIVE_NAME)
.addPackage(Calculator.class.getPackage())
.addPackage(CalculatorService.class.getPackage())
.addPackage(FooServiceBean.class.getPackage())
.addPackage(Foo.class.getPackage())
.addPackage(FooService.class.getPackage())
.addAsResource("META-INF/persistence.xml")
.addAsResource("META-INF/beans.xml");
//sowemightwriteitforfurtherinspection
if(WRITE_ARCHIVE){
artifact.as(ZipExporter.class)
.exportTo(newFile("D:/Projekte/ffz/tmp/"+ARCHIVE_NAME),
true);
}
returnartifact;
}
As you can see easily, every class, deployment descriptor and so on is added on the fly. For your
convenience the code to write the created archive to the file system is included. This was proven
helpful just to check, whether everything is included properly.
IMHO the only disadvantage might be the vast amount of classes in an average project so we were
pretty confident there must be another way of getting the archive.
Create the archive using maven
One of the de-facto standards in build tools is maven, so why not making use of the famous mvnclean
Copyright and all intellectual property belongs to Brockhaus Group 5
6. packageto get the things done? The following snippet describes how to get the archive loaded into
arquillian.
/**mavendiditforus..wejusthavetoreadthefile*/
privatestaticArchive<?>getArchiveFromFile(){
JavaArchiveartifact=ShrinkWrap
.create(ZipImporter.class,ARCHIVE_NAME)
.importFrom(ARCHIVE_FILE)
.as(JavaArchive.class);
returnartifact;
}
Configuring Arquillian
The initial thing we should tell Arquillian is where to find JBoss,
therefore a small xml file named arquillian.xmlneeds to put aside of
your application.
<?xmlversion="1.0"?>
<arquillianxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<defaultProtocoltype="Servlet3.0"/>
<!--
foradditionalinfosee:
https://docs.jboss.org/author/display/ARQ/Container+configuration
-->
<containerqualifier="jboss"default="true">
<configuration>
<!--thispointstoanexistinginstallation,takecarefor
everythingtobesetupproperly,esp.thedatasources-->
<property
name="jbossHome">D:abcxyzjboss-eap-6.1</property>
</configuration>
</container>
</arquillian>
Be aware of JBoss configured according to your needs, no topic or queue, no data source means no
topic or queue or data source available at testing time. The runtime selection is explained in more
detail here.
Copyright and all intellectual property belongs to Brockhaus Group 6
7. As we suppose you’re making use of maven, here are the dependencies you will need to make the test
run:
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>3.0.2.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.1.2.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<version>1.1.2.Final</version>
<scope>test</scope>
</dependency>
<!--ifnotusinganyprofile-->
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<version>7.2.0.Final</version>
</dependency>
Yu might want to check the poms included in the zip files ...
Copyright and all intellectual property belongs to Brockhaus Group 7
8. Now you are almost ready to run your first Arquillian test (mvncleantest/ or using eclipse).
Configuring the runtime modes of arquillian
In the very beginning we should have made the decision of how to use Arquillian as several modes are
supported:
● Remote container Will run in a separate VM, probably on a remote machine.
● Managed container Arquillian starts and stops the container (which must be
installed locally).
● Embedded container Will run in the same VM, Arquillian will manager the container.
Using JBoss, all modes need a JBoss to be installed and localized by arquillian.xml.
We suggest the following approach:
Make use of maven to build your archives and include the necessary dependencies within the POM.
Whatever mode you might choose, put the relevant configuration into a decent profile. We have tested
the managed and embedded option only.
Managed container config
… within <profiles> </profiles> tags obviously:
<profile>
<id>arqillian-jbossas-managed</id>
<dependencies>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<version>7.2.0.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
Copyright and all intellectual property belongs to Brockhaus Group 8
10. If you want to make an embedded test run from eclipse you have to add a system property or
configure properly within the POM:
Copyright and all intellectual property belongs to Brockhaus Group 10
11. Copyright and all intellectual property belongs to Brockhaus Group 11
12. Including persistency(extension)
The full monty of integration testing is provided using persistency. In the field of testing, persistency
first of all means generating test data for later use or testing the creation of data (which is almost
synonymous).
There are several options to get this task done, namely:
● create test data manually using SQL scripts and a pre-filled database.
● create/delete test data manually within the @Before annotated method
● create/delete test data by SQL script
● create/delete test data by means of XML / JSON
Creating test data manually using a pre-filled database
An easy task, just make use of the following:
INSERTINTOFOO(ID,CREATIONTIME,DESCRIPTION)VALUES(998,'2014-02-1812:37:06.73','FooBarOne');
INSERTINTOFOO(ID,CREATIONTIME,DESCRIPTION)VALUES(999,'2014-02-1812:37:06.73','FooBarTwo');
Creating test data manually
The most obvious way of creating (and deleting) test data during a test is doing so within the setUp()
and tearDown() methods of a test :2
@RunWith(Arquillian.class)
publicclassFooServiceArquillianTest{
@EJB
privateFooServicefooService;
privateFoofoo=newFoo();
@Deployment
publicstaticArchive<?>createTestArchive(){
Archive<?>archive=ArchiveHelper.getArchive();
returnarchive;
}
@Before
publicvoidsetUp(){
foo.setCreationTime(newDate(System.currentTimeMillis()));
foo.setDescription("FooBar");
foo.setCreationTime(newDate(System.currentTimeMillis()));
foo=fooService.createFoo(foo);
}
@Test
publicvoidtestFindAll(){
List<Foo>hits=fooService.findAllFoos();
Assert.assertTrue(hits.size()>0);
}
2
more precisely: the methods annotated by @BeforeXxx and @AfterXxx
Copyright and all intellectual property belongs to Brockhaus Group 12
13. @Test
publicvoidtestFindFoosEarlierThan(){
Datefuture=newDate(System.currentTimeMillis()+100000);
List<Foo>hits=fooService.findFoosEarlierThan(future);
Assert.assertTrue(hits.size()>0);
}
@After
publicvoidtearDown(){
List<Foo>hits=fooService.findAllFoos();
for(Foofoo:hits){
fooService.deleteFoo(foo);
}
}
}
Obviously this approach only works well for not-so-complicated objects and associations.
Creating test data by SQL script
Maybe your individual preferences are with SQL and so you want to get the things done by a
customized SQL script. Arquillian supports in doing so by annotations like @ApplyScriptBeforeand
@CreateSchema. We will focus on the first one as we have left schema creation to JPA/Hibernate.
WARNING:
At the time of writing this paper, we have the Alpha6 release of the
framework mentioned, there are several changes even in the names of
the annotations which might drive you crazy. Even the Arquillian book
available is not up to date.
Don’t forget to include the extensions into your POM:
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-api</artifactId>
<version>1.0.0.Alpha6</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-impl</artifactId>
<version>1.0.0.Alpha6</version>
</dependency>
Presume we have the following script:
INSERTINTOFOO(ID,CREATIONTIME,DESCRIPTION)VALUES(998,'2014-02-1812:37:06.73',
'FooBarOne');
INSERTINTOFOO(ID,CREATIONTIME,DESCRIPTION)VALUES(999,'2014-02-1812:37:06.73',
'FooBarTwo');
Put the script into the /src/test/resources/scriptsfolder of your maven project and annotate the
class accordingly:
Copyright and all intellectual property belongs to Brockhaus Group 13