Skip to content

Commit 881d865

Browse files
committed
Add DTDEncoder tests.
1 parent d40fe24 commit 881d865

7 files changed

Lines changed: 81 additions & 8 deletions

File tree

.idea/compiler.xml

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
rootProject.name = 'Sierra'
22

3-
include 'sierra', 'sierra-previewer', 'sierra-test', 'sierra-tools:dtd-encoder'
3+
include 'sierra', 'sierra-test', 'sierra-tools:dtd-encoder', 'sierra-tools:previewer'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sierra.dtd

sierra-tools/dtd-encoder/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ plugins {
1818

1919
dependencies {
2020
implementation project(':sierra')
21+
implementation 'com.fifesoft:rsyntaxtextarea:3.6.0'
2122

22-
implementation "com.formdev:flatlaf:${flatLafVersion}"
23-
implementation "com.formdev:flatlaf-extras:${flatLafVersion}"
23+
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
24+
25+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
26+
}
27+
28+
tasks.named('test', Test) {
29+
useJUnitPlatform()
2430
}
2531

2632
application {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
package org.httprpc.sierra.tools;
16+
17+
import org.junit.jupiter.api.Test;
18+
19+
import static org.junit.jupiter.api.Assertions.*;
20+
21+
public class DTDEncoderTest {
22+
@Test
23+
public void testCustomBinding() throws Exception {
24+
DTDEncoder.main(new String[] {"syntax-text-area=org.fife.ui.rsyntaxtextarea.RSyntaxTextArea"});
25+
}
26+
27+
@Test
28+
public void testInvalidBinding() {
29+
assertThrows(IllegalArgumentException.class, () -> DTDEncoder.main(new String[] {"xyz"}));
30+
}
31+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
plugins {
16+
id 'application'
17+
}
18+
19+
dependencies {
20+
implementation project(':sierra')
21+
implementation "com.formdev:flatlaf:${flatLafVersion}"
22+
implementation "com.formdev:flatlaf-extras:${flatLafVersion}"
23+
implementation 'com.fifesoft:rsyntaxtextarea:3.6.0'
24+
implementation 'com.fifesoft:autocomplete:3.3.2'
25+
26+
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
27+
testImplementation 'org.mockito:mockito-core:5.9.0'
28+
29+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
30+
}
31+
32+
tasks.named('test', Test) {
33+
useJUnitPlatform()
34+
}
35+
36+
application {
37+
mainClass = 'org.httprpc.sierra.previewer.SierraPreviewerApp'
38+
}

0 commit comments

Comments
 (0)