Skip to content

Commit

Permalink
fix(#3325): Add a test to validate file stream adapter via compact API
Browse files Browse the repository at this point in the history
  • Loading branch information
tenthe committed Nov 11, 2024
1 parent 5b9449b commit 7227b51
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/cypress/fixtures/connect/compact/compactTest.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
timestamp;value;temperature
1000;1.0;0.1
40 changes: 40 additions & 0 deletions ui/cypress/fixtures/connect/compact/fileReplay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

id: sp:adapterdescription:IfmzfQ
name: File Stream Adapter Test
description: ''
appId: org.apache.streampipes.connect.iiot.protocol.stream.file
configuration:
- filePath: compactTest.csv
- replaceTimestamp:
- ''
- replayOnce: 'no'
- speed: keepOriginalTime
- delimiter: ;
format: CSV
header:
- Header
schema:
timestamp:
description: ''
propertyScope: HEADER_PROPERTY
semanticType: http://schema.org/DateTime
transform:
rename: {}
measurementUnit: {}
createOptions:
persist: true
start: true
16 changes: 16 additions & 0 deletions ui/cypress/tests/connect/compact/addCompactAdapter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import { ConnectUtils } from '../../../support/utils/connect/ConnectUtils';
import { CompactAdapterUtils } from '../../../support/utils/connect/CompactAdapterUtils';
import { PipelineUtils } from '../../../support/utils/pipeline/PipelineUtils';
import { FileManagementUtils } from '../../../support/utils/FileManagementUtils';

describe('Add Compact Adapters', () => {
beforeEach('Setup Test', () => {
Expand Down Expand Up @@ -96,4 +97,19 @@ describe('Add Compact Adapters', () => {
},
);
});

it('Add file stream adapter via the compact API. Start Adapter with Pipeline', () => {
FileManagementUtils.addFile('connect/compact/compactTest.csv');

cy.readFile('cypress/fixtures/connect/compact/fileReplay.yml').then(
ymlDescription => {
CompactAdapterUtils.storeCompactYmlAdapter(ymlDescription).then(
() => {
ConnectUtils.validateAdapterIsRunning();
PipelineUtils.checkAmountOfPipelinesPipeline(1);
},
);
},
);
});
});

0 comments on commit 7227b51

Please sign in to comment.