Skip to content

Commit

Permalink
Merge pull request #551 from smeup/feature/LS24002987/printer-file-mo…
Browse files Browse the repository at this point in the history
…ckup

Feature/ls24002987/printer file mockup
  • Loading branch information
lanarimarco authored Jun 25, 2024
2 parents d5e1d0f + 389c2a2 commit 0d69f8e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ data class Prefix(internal val prefix: String, private val numCharsReplaced: Int
}

enum class FileType(val keyword: String?) {
DB(null), VIDEO("C");
DB(null), VIDEO("C"), PRINTER("O");

companion object {
fun getByKeyword(keyword: String): FileType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ private fun FileDefinition.loadMetadata(): FileMetadata {
error("Not found metadata for $this", error)
}.getOrNull() ?: error("Not found metadata for $this")
}
fileType == FileType.PRINTER -> {
FileMetadata(
name = this.name,
tableName = this.name,
recordFormat = this.internalFormatName ?: this.name,
fields = emptyList(),
accessFields = emptyList()
)
}
else -> error("Unhandled file type $fileType")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,14 @@ open class MULANGT50FileAccess1Test : MULANGTTest() {
val expected = listOf("TSSYST(IBMI) TSLIBR() TSFILE() TATIPO(3) TBPROG(MULANGT12) AAAAAA(A03) BBBBBB(P01) CCCCCC()")
assertEquals(expected, "smeup/MU500901".outputOf(configuration = smeupConfig))
}

/**
* Printer file with O-specs
* @see #LS24002987
*/
@Test
fun executeMUDRNRAPU00219() {
val expected = listOf("ok")
assertEquals(expected, "smeup/MUDRNRAPU00219".outputOf(configuration = smeupConfig))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
D £DBG_Str S 2
D STR132 S 132
FPRT132 O F 132 PRINTER OFLIND(*INOG) USROPN
OPRT132 E RIGA 1
O STR132
C EVAL £DBG_Str='ok'
C £DBG_Str DSPLY

0 comments on commit 0d69f8e

Please sign in to comment.