Skip to content

Commit 34a42e2

Browse files
committed
test index
1 parent 87b0cea commit 34a42e2

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

src/test/kotlin/SCTest.kt

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,50 +35,50 @@ class SCTest {
3535
}
3636

3737
@Test
38-
fun `terminal verification`() {
38+
fun `1 - terminal verification`() {
3939
"echo $extensionName".runCommand { command, result ->
4040
assert(command.contains(result.removeNewLines()))
4141
}
4242
}
4343

4444
@Test
45-
fun `gradlew signingReport`() {
45+
fun `2 - gradlew signingReport`() {
4646
signingReportTask.runCommand { _, report ->
4747
assert(report.contains("SHA1") && report.contains("BUILD SUCCESSFUL"))
4848
}
4949
}
5050

5151
@Test
52-
fun `fingerprint extraction`() {
52+
fun `3 - fingerprint extraction`() {
5353
signingReportTask.runCommand { _, report ->
5454
assert(report.extractFingerprint().split(":").size == 20)
5555
}
5656
}
5757

5858
@Test
59-
fun `locate string files for default configuration`() {
59+
fun `4 - locate string files for default configuration`() {
6060
prepareTask.runCommand { _, _ ->
6161
assert(locateFiles(projectName, defaultConfig()).isNotEmpty())
6262
}
6363
}
6464

6565
@Test
66-
fun `backup string files`() {
66+
fun `5 - backup string files`() {
6767
prepareTask.runCommand { _, _ ->
6868
assert(backupFiles(projectName, defaultConfig()).isNotEmpty())
6969
}
7070
}
7171

7272
@Test
73-
fun `restore string files`() {
73+
fun `6 - restore string files`() {
7474
prepareTask.runCommand { _, _ ->
7575
assert(backupFiles(projectName, defaultConfig()).isNotEmpty())
7676
assert(restoreFiles(projectName).isNotEmpty())
7777
}
7878
}
7979

8080
@Test
81-
fun `xml parsing`() {
81+
fun `7 - xml parsing`() {
8282
prepareTask.runCommand { _, _ ->
8383
val files = backupFiles(projectName, defaultConfig())
8484
files.forEach {
@@ -89,7 +89,7 @@ class SCTest {
8989

9090

9191
@Test
92-
fun `obfuscate string files`() {
92+
fun `8 - obfuscate string values`() {
9393
signingReportTask.runCommand { _, report ->
9494
val files = backupFiles(projectName, defaultConfig())
9595
files.forEach { file ->
@@ -98,13 +98,33 @@ class SCTest {
9898
val obfuscated = obfuscate(
9999
"$projectName${File.separator}$mainModuleTest",
100100
report.extractFingerprint(),
101-
entity)
101+
entity
102+
)
103+
assert(obfuscated.value != entity.value)
104+
}
105+
}
106+
}
107+
}
108+
109+
@Test
110+
fun `9 - obfuscate and reveal string values`() {
111+
signingReportTask.runCommand { _, report ->
112+
val files = backupFiles(projectName, defaultConfig())
113+
files.forEach { file ->
114+
val entities = parseXML(file, mainModuleTest, true)
115+
entities.forEach { entity ->
116+
val obfuscated = obfuscate(
117+
"$projectName${File.separator}$mainModuleTest",
118+
report.extractFingerprint(),
119+
entity
120+
)
102121
assert(obfuscated.value != entity.value)
103122

104123
val original = reveal(
105124
"$projectName${File.separator}$mainModuleTest",
106125
report.extractFingerprint(),
107-
obfuscated)
126+
obfuscated
127+
)
108128

109129
assert(original.value == entity.value)
110130

0 commit comments

Comments
 (0)