-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from RADAR-CNS/v0.4.2_release
V0.4.2 release
- Loading branch information
Showing
6 changed files
with
97 additions
and
7 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,5 @@ | ||
# These owners will be the default owners for everything in the repo. | ||
# Unless a later match takes precedence, they will be requested for review when someone | ||
# opens a pull request. | ||
* @blootsvoets | ||
testing/* @nivemaham @fnobilia |
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
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
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
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
53 changes: 53 additions & 0 deletions
53
src/test/java/org/radarcns/stream/StreamDefinitionTest.java
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,53 @@ | ||
package org.radarcns.stream; | ||
|
||
/* | ||
* Copyright 2017 King's College London and The Hyve | ||
* | ||
* 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. | ||
*/ | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import org.apache.kafka.common.errors.InvalidTopicException; | ||
import org.junit.Test; | ||
import org.radarcns.topic.KafkaTopic; | ||
|
||
public class StreamDefinitionTest { | ||
|
||
private static final String INPUT = "android_empatica_e4_blood_volume_pulse"; | ||
private static final String OUTPUT = INPUT + GeneralStreamGroup.OUTPUT_LABEL; | ||
|
||
@Test | ||
public void nameValidation() { | ||
KafkaTopic inputTopic = new KafkaTopic(INPUT); | ||
KafkaTopic outputTopic = new KafkaTopic(OUTPUT); | ||
|
||
StreamDefinition definition = new StreamDefinition(inputTopic, outputTopic); | ||
|
||
kafka.common.Topic.validate(definition.getStateStoreName()); | ||
|
||
assertEquals("From-" + "android_empatica_e4_blood_volume_pulse" + "-To-" + | ||
"android_empatica_e4_blood_volume_pulse" + "_output", | ||
definition.getStateStoreName()); | ||
} | ||
|
||
@Test(expected = InvalidTopicException.class) | ||
public void faultyNameValidation() { | ||
KafkaTopic inputTopic = new KafkaTopic(INPUT + "$"); | ||
KafkaTopic outputTopic = new KafkaTopic(OUTPUT); | ||
|
||
StreamDefinition definition = new StreamDefinition(inputTopic, outputTopic); | ||
|
||
kafka.common.Topic.validate(definition.getStateStoreName()); | ||
} | ||
} |