Loading a collection of entities from a set of XML files
You can load entities that are defined in XML by using the test driver createFileEntitySource (DataFormat format, String path) and loadEntities(Iterator<Entity> entities) methods.
About this task
You can convert data into entities from generic XML files. Each file is read and converted into an entity by using the entity definitions in your BOM project.
You can specify a name pattern to select the files that you want to be converted. When you create the EntitySource, you can specify a regular expression, such as .*entity, to select the files that you want from a directory. For more information about regular expressions, see the Java Tutorials Lesson: Regular Expressions.
You can also configure the EntitySource implementation to take a specific action when an entity type is not recognized. The skipUnrecognizedEntities flag defines the failure behavior. If you set it to true, then the files that are not recognized by the ModelFactory do not trigger an exception and continues loading the other entities. If set to false, then the file that is not recognized by the ModelFactory triggers an exception and stopping the loading of the rest of the entities.