(Quick Reference)

create-unit-test

Purpose

The create-unit-test command creates a unit test for the given base name.

Examples

Propósito

El comando create-unit-test crea un test unitario para el nombre base dado.

Ejemplos

grails create-unit-test org.bookstore.book

Description

Creates a unit test for the given base name. For example for a base name org.bookstore.book an unit test called BookTests will be created in the test/unit/org/bookstore directory.

A unit test differs from an integration test in that the Grails environment is not loaded for each test execution and it is left up to you to perform the appropriate mocking using GroovyMock or a Mock library such as EasyMock

Refer to the section on Unit Testing of the user guide for information on unit vs. integration testing.

Note that this command is just for convenience and you can also create integration tests in your favourite text editor or IDE if you choose.

Usage:

Descripción

Crea un test unitario para el nombre base dado. Por ehemplo para el nombre base org.bookstore.book un test unitario llamado BookTests será creado un el directorio test/unit/org/bookstore.

Un test unitario difiere de un test de integración en que en el entorno Grails no se carga cada test en ejecución si no que se deja hasta que realice la correspondiente mocking usando GroovyMock o una librería Mock tal como EasyMock

Consulte la seccion de Unit Testing de la guía de usuario para más información de las pruebas unitarias y de integración.

Tenga en cuenta que este comando es simplemente para su conveniencia y puede también crear test de integración en su editor de texto favorito o IDE que elija.

Uso:

grails create-unit-test [name]

Fired Events:

  • CreatedFile - When the unit test is created

  • CreatedFile - cuando el test unitario es creado.