05.03 - Resources

This subsection introduces you to the Resources shipped with the commons-components basic plugin. The most nitpicking of you will notice that the File resource category ('file') is part of the core of Squash TA and need not the plugin to be available, nevertheless it is stated here for convenience.

Most of the resources here will start their careers as File resource, then will be converted to their type using converters. Some of them can also be produced as the result of a command (for instance result.sql).

Since most of the resources will be materialized as files in your test project, you might be wondering what file corresponds to complex resources, say, the 'conf.dbunit' for instance. You will NOT find that information here, because there are potentially unlimited ways to create that resource, not just one file format. In other words, one could imagine that a given resource could be constructed from other resources involving completely different material. A good example is the 'dataset.dbunit': this plugin provides three ways of creating one of these.

In fact, the question of how to obtain a resource, given another Resource, is typically the job of the Converters. This is the section to go if you're interested in what you should supply as inputs to the system in order to produce the resources you want. In the case of our example, the answer you look for is probably stated in the documentation of from 'file' to 'conf.dbunit'.

file

Category-name: file

What:
'file' is the category of a resource representing a plain file or a directory, no assumption made on the content of either of them. If you've read through the DSL tutorial you probably met it as File resource.

bundle

Category-name: bundle

What: 'bundle' is the category of a resource representing a set of files. Basically it is a directory containing more directories or files. The root directory is called the 'base'. However it also have additional attributes. Those attributes give clues on what is the relationships between the files it embbeds. The followig attributes are available :
  • "mainpath" : denotes which file is considered to be the main file, and the other files represent its dependencies. The mainpath is the path relative to the base of the bundle. When used, the context will decide what to do with that main file, typically when using commands.

csv

Category-name: csv

What: 'csv' is the category of a resource representing a file or a directory too, juste like for 'file'. The difference is that it is trusted to hold CSV-formatted data. 


directory

Category-name: directory

What:
'directory' is the category of a resource that represents a whole directory.


process

Category-name: process

@See : Since Squash TA 1.7.0, this resource moved to local process plugin

properties

Category-name: properties

What:
'properties' is the category of a resource that represents properties, in other words a set of pairs of <key - value >.

script.java

Category-name: script.java

What:
This resource encapsulates a java code bundle, including resources and compiled java classes.


xml

Category-name: xml

What:
'xml' is the category of a resource that represents a file or a folder, like 'file'. The difference is that the content is trusted to be of XML nature.