public String getInvalidXmlResourceMessage(final String resourceName, final boolean useSchema) {
        return taskContextFactory.contextResult("XMLValidator", taskContext1 ->
                pipelineScopeRunnable.scopeResult(() -> {
                    // Only validate if something is provided
                    if (resourceName != null && !resourceName.isEmpty()) {
                        try {
                            // Buffer the stream.
                            final InputStream inputStream = new BufferedInputStream(
                                    StroomPipelineTestFileUtil.getInputStream(resourceName));

                            // Setup the error receiver.
                            errorReceiverProvider.get().setErrorReceiver(new LoggingErrorReceiver());

                            // Create the pipeline.
                            final DocRef pipelineRef =
                                    PipelineTestUtil.createTestPipeline(pipelineStore,
                                    StroomPipelineTestFileUtil.getString("F2XTestUtil/validation.Pipeline.data.xml"));
                            final PipelineDoc pipelineDoc = pipelineStore.readDocument(pipelineRef);
                            final PipelineData pipelineData = pipelineDoc.getPipelineData();

                            // final ElementType schemaFilterElementType = new ElementType(
                            // "SchemaFilter");
                            // final PropertyType schemaValidationPropertyType = new
                            // PropertyType(
                            // schemaFilterElementType, "schemaValidation", "Boolean",
                            // false);
                            pipelineData.addProperty(PipelineDataUtil.createProperty("schemaFilter",
                                    "schemaValidation",
                                    false));
                            // final PropertyType schemaGroupPropertyType = new
                            // PropertyType(
                            // schemaFilterElementType, "schemaGroup", "String", false);
                            pipelineData
                                    .addProperty(PipelineDataUtil.createProperty("schemaFilter",
                                            "schemaGroup",
                                            "DATA_SPLITTER"));
                            pipelineStore.writeDocument(pipelineDoc);

                            final Pipeline pipeline = pipelineFactoryProvider.get().create(pipelineData, taskContext1);
                            pipeline.process(inputStream);

                            return errorReceiverProvider.get().toString();

                        } catch (final RuntimeException e) {
                            return e.getMessage();
                        }
                    }

                    return NO_RESOURCE_PROVIDED;
                })).get();
    }
Pull back the error message regarding this XML based resource.

@param resourceName to check
@param useSchema    Set to true if you wish to validate against a schema. False
                    will just validate XML is well formed.
@return message
stroom-app/src/test/java/stroom/pipeline/xml/XMLValidator.java