Skip to content

Commit

Permalink
Adjust tests to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
georg-schwarz committed Jan 17, 2024
1 parent a44a73c commit 492e876
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 110 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,24 @@ describe('Validation of CompositeBlocktypeDefinition', () => {
expect.any(Object),
);
});

it('should diagnose error on block without pipe', async () => {
const text = readJvTestAsset(
'composite-blocktype-definition/invalid-unconnected-block.jv',
);

await parseAndValidateBlocktype(text);

expect(validationAcceptorMock).toHaveBeenCalledTimes(2);
expect(validationAcceptorMock).toHaveBeenCalledWith(
'warning',
'A pipe should be connected to the input of this block',
expect.any(Object),
);
expect(validationAcceptorMock).toHaveBeenCalledWith(
'warning',
'A pipe should be connected to the output of this block',
expect.any(Object),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('Validation of PipelineDefinition', () => {

await parseAndValidatePipeline(text);

expect(validationAcceptorMock).toHaveBeenCalledTimes(1);
expect(validationAcceptorMock).toHaveBeenCalledTimes(2); // one warning for unused blocks
expect(validationAcceptorMock).toHaveBeenCalledWith(
'error',
`An extractor block is required for this pipeline`,
Expand Down Expand Up @@ -116,4 +116,17 @@ describe('Validation of PipelineDefinition', () => {
expect.any(Object),
);
});

it('should diagnose error on block without pipe', async () => {
const text = readJvTestAsset('pipeline-definition/invalid-missing-pipe.jv');

await parseAndValidatePipeline(text);

expect(validationAcceptorMock).toHaveBeenCalledTimes(2); // one error since missing extractor
expect(validationAcceptorMock).toHaveBeenCalledWith(
'warning',
'A pipe should be connected to the output of this block',
expect.any(Object),
);
});
});

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg
//
// SPDX-License-Identifier: AGPL-3.0-only

composite blocktype TestBlockType {
input inPort oftype Table;
output outPort oftype File;

block TestExtractor1 oftype TestFileExtractor { }
block TestExtractor2 oftype TestFileExtractor { }

inPort -> TestExtractor1 -> outPort;
}

builtin blocktype TestFileExtractor {
input inPort oftype Table;
output outPort oftype File;
}

0 comments on commit 492e876

Please sign in to comment.