-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
590 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using utils.Test; | ||
using utils.ExpectValues; | ||
|
||
using com.industry.rx_epl.Subject; | ||
using com.industry.rx_epl.ISubject; | ||
using com.industry.rx_epl.Observable; | ||
using com.industry.rx_epl.IObservable; | ||
using com.industry.rx_epl.Subscriber; | ||
|
||
monitor TestObservable { | ||
Test test := Test("TestResult"); | ||
|
||
action onload() { | ||
ISubject s := Subject.create(); | ||
|
||
any discard := s.sample(Observable.interval(0.2)) | ||
.subscribe(ExpectValues.create([<any>1,3], test.complete, test.fail)); | ||
|
||
on wait(0.1) { | ||
s.next(0); | ||
} | ||
on wait(0.1999) { | ||
s.next(1); | ||
} | ||
on wait(0.2) { | ||
s.next(2); | ||
} | ||
on wait(0.3999) { | ||
s.next(3); | ||
s.complete(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" standalone="yes"?> | ||
<pysystest type="auto" state="runnable"> | ||
|
||
<description> | ||
<title>Sample Async</title> | ||
<purpose><![CDATA[Sample Async]]></purpose> | ||
</description> | ||
|
||
<classification> | ||
<groups> | ||
<group></group> | ||
</groups> | ||
</classification> | ||
|
||
<data> | ||
<class name="PySysTest" module="run"/> | ||
</data> | ||
|
||
<traceability> | ||
<requirements> | ||
<requirement id=""/> | ||
</requirements> | ||
</traceability> | ||
</pysystest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright (c) 2015-2018 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed 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. | ||
|
||
from pysys.constants import * | ||
from pysys.basetest import BaseTest | ||
from apama.correlator import CorrelatorHelper | ||
|
||
class PySysTest(BaseTest): | ||
|
||
def execute(self): | ||
correlator = CorrelatorHelper(self, name='correlator') | ||
correlator.start(logfile='correlator.log', config=os.path.join(PROJECT.TEST_SUBJECT_DIR, 'initialization.yaml')) | ||
|
||
correlator.flush() | ||
correlator.injectEPL(filenames='testUtils.mon', filedir=PROJECT.UTILS_DIR) | ||
|
||
# Set the log level to DEBUG so that we can see when the listeners are killed | ||
correlator.setApplicationLogLevel(verbosity='DEBUG') | ||
|
||
# Start test results receiver | ||
correlator.receive(filename='TestResult.evt', channels=['TestResult'], logChannels=True) | ||
|
||
# Inject test | ||
correlator.injectEPL(filenames=['test.mon']) | ||
|
||
# wait for all events to be processed | ||
correlator.flush() | ||
|
||
# wait for test to complete | ||
self.waitForSignal('TestResult.evt', expr="TestComplete", condition="==1", timeout=10) | ||
|
||
def validate(self): | ||
# check the main correlator log for Errors | ||
self.assertGrep('correlator.log', expr=' (ERROR|FATAL) ', contains=False) | ||
|
||
# Check that the test didn't fail | ||
self.assertGrep('TestResult.evt', expr='TestFailed', contains=False) | ||
|
||
# Check that the interval listener was killed | ||
self.assertLineCount('correlator.log', expr='Interval wait listener killed', condition='==1') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using utils.Test; | ||
using utils.ExpectValues; | ||
|
||
using com.industry.rx_epl.Observable; | ||
using com.industry.rx_epl.IObservable; | ||
using com.industry.rx_epl.Subscriber; | ||
|
||
monitor TestObservable { | ||
Test test := Test("TestResult"); | ||
|
||
action onload() { | ||
any discard := Observable.fromValues([<any>0,1,2,3]) | ||
.sample(Observable.interval(1.0)) | ||
.subscribe(ExpectValues.create([<any>3], test.complete, test.fail)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" standalone="yes"?> | ||
<pysystest type="auto" state="runnable"> | ||
|
||
<description> | ||
<title>Sample Sync</title> | ||
<purpose><![CDATA[Sample Sync]]></purpose> | ||
</description> | ||
|
||
<classification> | ||
<groups> | ||
<group></group> | ||
</groups> | ||
</classification> | ||
|
||
<data> | ||
<class name="PySysTest" module="run"/> | ||
</data> | ||
|
||
<traceability> | ||
<requirements> | ||
<requirement id=""/> | ||
</requirements> | ||
</traceability> | ||
</pysystest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Copyright (c) 2015-2018 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed 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. | ||
|
||
from pysys.constants import * | ||
from pysys.basetest import BaseTest | ||
from apama.correlator import CorrelatorHelper | ||
|
||
class PySysTest(BaseTest): | ||
|
||
def execute(self): | ||
correlator = CorrelatorHelper(self, name='correlator') | ||
correlator.start(logfile='correlator.log', config=os.path.join(PROJECT.TEST_SUBJECT_DIR, 'initialization.yaml')) | ||
|
||
correlator.flush() | ||
correlator.injectEPL(filenames='testUtils.mon', filedir=PROJECT.UTILS_DIR) | ||
|
||
# Set the log level to DEBUG so that we can see when the listeners are killed | ||
correlator.setApplicationLogLevel(verbosity='DEBUG') | ||
|
||
# Start test results receiver | ||
correlator.receive(filename='TestResult.evt', channels=['TestResult'], logChannels=True) | ||
|
||
# Inject test | ||
correlator.injectEPL(filenames=['test.mon']) | ||
|
||
# wait for all events to be processed | ||
correlator.flush() | ||
|
||
# wait for test to complete | ||
self.waitForSignal('TestResult.evt', expr="TestComplete", condition="==1", timeout=10) | ||
|
||
def validate(self): | ||
# check the main correlator log for Errors | ||
self.assertGrep('correlator.log', expr=' (ERROR|FATAL) ', contains=False) | ||
|
||
# Check that the test didn't fail | ||
self.assertGrep('TestResult.evt', expr='TestFailed', contains=False) | ||
|
||
# The listener should not be killed because it should not be created as the observable completes synchronously | ||
self.assertLineCount('correlator.log', expr='Interval wait listener killed', condition='==0') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using utils.Test; | ||
using utils.TestObservables; | ||
using utils.ExpectValues; | ||
|
||
using com.industry.rx_epl.Subscriber; | ||
|
||
monitor TestObservable { | ||
Test test := Test("TestResult"); | ||
|
||
action onload() { | ||
any discard := TestObservables.createAsync().take(6) | ||
.sampleCount(2) | ||
.subscribe(ExpectValues.create([<any>1.0,3.0,5.0], test.complete, test.fail)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" standalone="yes"?> | ||
<pysystest type="auto" state="runnable"> | ||
|
||
<description> | ||
<title>SampleCount Async</title> | ||
<purpose><![CDATA[SampleCount Async]]></purpose> | ||
</description> | ||
|
||
<classification> | ||
<groups> | ||
<group></group> | ||
</groups> | ||
</classification> | ||
|
||
<data> | ||
<class name="PySysTest" module="run"/> | ||
</data> | ||
|
||
<traceability> | ||
<requirements> | ||
<requirement id=""/> | ||
</requirements> | ||
</traceability> | ||
</pysystest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright (c) 2015-2018 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Licensed 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. | ||
|
||
from pysys.constants import * | ||
from pysys.basetest import BaseTest | ||
from apama.correlator import CorrelatorHelper | ||
|
||
class PySysTest(BaseTest): | ||
|
||
def execute(self): | ||
correlator = CorrelatorHelper(self, name='correlator') | ||
correlator.start(logfile='correlator.log', config=os.path.join(PROJECT.TEST_SUBJECT_DIR, 'initialization.yaml')) | ||
|
||
correlator.flush() | ||
correlator.injectEPL(filenames='testUtils.mon', filedir=PROJECT.UTILS_DIR) | ||
|
||
# Set the log level to DEBUG so that we can see when the listeners are killed | ||
correlator.setApplicationLogLevel(verbosity='DEBUG') | ||
|
||
# Start test results receiver | ||
correlator.receive(filename='TestResult.evt', channels=['TestResult'], logChannels=True) | ||
|
||
# Inject test | ||
correlator.injectEPL(filenames=['test.mon']) | ||
|
||
# wait for all events to be processed | ||
correlator.flush() | ||
|
||
# wait for test to complete | ||
self.waitForSignal('TestResult.evt', expr="TestComplete", condition="==1", timeout=10) | ||
|
||
def validate(self): | ||
# check the main correlator log for Errors | ||
self.assertGrep('correlator.log', expr=' (ERROR|FATAL) ', contains=False) | ||
|
||
# Check that the test didn't fail | ||
self.assertGrep('TestResult.evt', expr='TestFailed', contains=False) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using utils.Test; | ||
using utils.TestObservables; | ||
using utils.ExpectValues; | ||
|
||
using com.industry.rx_epl.Subscriber; | ||
|
||
monitor TestObservable { | ||
Test test := Test("TestResult"); | ||
|
||
action onload() { | ||
any discard := TestObservables.createSync().take(6) | ||
.sampleCount(2) | ||
.subscribe(ExpectValues.create([<any>1.0,3.0,5.0], test.complete, test.fail)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" standalone="yes"?> | ||
<pysystest type="auto" state="runnable"> | ||
|
||
<description> | ||
<title>SampleCount Sync</title> | ||
<purpose><![CDATA[SampleCount Sync]]></purpose> | ||
</description> | ||
|
||
<classification> | ||
<groups> | ||
<group></group> | ||
</groups> | ||
</classification> | ||
|
||
<data> | ||
<class name="PySysTest" module="run"/> | ||
</data> | ||
|
||
<traceability> | ||
<requirements> | ||
<requirement id=""/> | ||
</requirements> | ||
</traceability> | ||
</pysystest> |
Oops, something went wrong.