Skip to content

Commit

Permalink
Merge pull request #15 from testainers/dev
Browse files Browse the repository at this point in the history
Version 0.1.1.
  • Loading branch information
edufolly committed Jun 1, 2024
2 parents 263abeb + 78661d4 commit 6bd8a4c
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 144 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
}

group = "com.testainers"
version = "0.1.0"
version = "0.1.1"

java {
sourceCompatibility = JavaVersion.VERSION_21
Expand Down
2 changes: 1 addition & 1 deletion coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

./gradlew cleanTest test
./gradlew clean test

/bin/cp -rf helpers/jacoco-report/* build/jacoco-report/.

Expand Down
55 changes: 44 additions & 11 deletions helpers/jacoco-report/jacoco-resources/prettify.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
/* Pretty printing styles. Used with prettify.js. */

.str { color: #ecc48d; }
.kwd { color: #f7768e; font-weight: bold; }
.com { color: #86c1b9; font-style: italic; }
.typ { color: #b8b8f3; font-weight: bold; }
.lit { color: #7b9df9; }
.pun { color: #f9a8d4; }
.pln { color: #d4d4d4; }
.tag { color: #008; font-weight: bold; }
.atn { color: #606; font-weight: bold; }
.atv { color: #080; }
.dec { color: #606; }
.str {
color: #80b3ff; /* Light blue for strings */
}

.kwd {
color: #ff80b3; /* Light pink for keywords */
font-weight: bold;
}

.com {
color: #b3d9ff; /* Light sky blue for comments */
}

.typ {
color: #c080ff; /* Light purple for types */
}

.lit {
color: #80ffd4; /* Light teal for literals */
}

.pun {
color: #ffd480; /* Light orange for punctuation */
}

.pln {
color: #e0e0e0; /* Light gray for plain text */
}

.tag {
color: #80ff80; /* Light green for tags */
}

.atn {
color: #ff80ff; /* Light magenta for attribute names */
}

.atv {
color: #80ffb3; /* Light green for attribute values */
}

.dec {
color: #ffb380; /* Light peach for decimal values */
}
130 changes: 62 additions & 68 deletions helpers/jacoco-report/jacoco-resources/report.css
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
body, td {
font-family: sans-serif;
font-size: 10pt;
color: #ffffff; /* cor do texto */
background-color: #222222; /* cor de fundo */
color: #e0e0e0;
background-color: #1e1e1e;
}

h1 {
font-weight: bold;
font-size: 18pt;
color: #ffffff; /* cor do título */
color: #ffffff;
}

a {
color: #80b3ff;
text-decoration: none;
}

a:hover, a:focus {
color: #ffcc80;
text-decoration: underline;
}

.breadcrumb {
border: #d6d3ce 1px solid;
padding: 2px 4px 2px 4px;
background-color: #333333; /* cor de fundo da breadcrumb */
color: #ffffff; /* cor do texto da breadcrumb */
border: #444 1px solid;
padding: 2px 4px;
background-color: #333;
color: #e0e0e0;
}

.breadcrumb .info {
float: right;
}

.breadcrumb .info a {
margin-left: 8px;
color: #ffffff; /* cor dos links da breadcrumb */
}

.el_report,
.el_group,
.el_bundle,
.el_package,
.el_class,
.el_source,
.el_method,
.el_session {
.el_report, .el_group, .el_bundle, .el_package, .el_class, .el_source, .el_method, .el_session {
padding-left: 18px;
background-position: left center;
background-repeat: no-repeat;
color: #ffffff; /* cor do texto */
}

.el_report {
Expand Down Expand Up @@ -70,28 +75,32 @@ h1 {
}

pre.source {
border: #d6d3ce 1px solid;
border: #444 1px solid;
font-family: monospace;
color: #ffffff; /* cor do texto */
background-color: #333333; /* cor de fundo */
background-color: #2e2e2e;
color: #c0c0c0;
}

pre.source ol {
margin: 0;
}

pre.source li {
border-left: 1px solid #d6d3ce;
color: #a0a0a0;
padding-left: 0px;
border-left: 1px solid #444;
color: #888;
padding-left: 0;
}

pre.source span.fc {
background-color: #224422; /* cor de fundo dos spans .fc */
background-color: #334d33;
}

pre.source span.nc {
background-color: #662222; /* cor de fundo dos spans .nc */
background-color: #4d3333;
}

pre.source span.pc {
background-color: #666622; /* cor de fundo dos spans .pc */
background-color: #4d4d33;
}

pre.source span.bfc {
Expand All @@ -101,7 +110,7 @@ pre.source span.bfc {
}

pre.source span.bfc:hover {
background-color: #228822; /* cor de fundo hover dos spans .bfc */
background-color: #267326;
}

pre.source span.bnc {
Expand All @@ -111,7 +120,7 @@ pre.source span.bnc {
}

pre.source span.bnc:hover {
background-color: #882222; /* cor de fundo hover dos spans .bnc */
background-color: #732626;
}

pre.source span.bpc {
Expand All @@ -121,20 +130,7 @@ pre.source span.bpc {
}

pre.source span.bpc:hover {
background-color: #888822; /* cor de fundo hover dos spans .bpc */
}

/* Java Code */

pre.source.lang-java.linenums {
background-color: #2f3032;
color: #d4d4d4;
padding: 10px;
font-family: monospace;
font-size: 12px;
line-height: 1.4;
overflow-x: auto;
border-radius: 4px;
background-color: #737326;
}

pre.source.lang-java.linenums code {
Expand All @@ -146,28 +142,26 @@ pre.source.lang-java.linenums code {
table.coverage {
empty-cells: show;
border-collapse: collapse;
color: #ffffff; /* cor do texto */
}

table.coverage thead {
background-color: #333333; /* cor de fundo do cabeçalho da tabela */
color: #ffffff; /* cor do texto do cabeçalho da tabela */
background-color: #444;
color: #e0e0e0;
}

table.coverage thead td {
white-space: nowrap;
padding: 12px 18px;
border-bottom: 1px solid #555555;
font-weight: bold;
padding: 2px 14px 0 6px;
border-bottom: #666 1px solid;
}

table.coverage thead td.bar {
border-left: #cccccc 1px solid;
border-left: #555 1px solid;
}

table.coverage thead td.ctr1 {
text-align: right;
border-left: #cccccc 1px solid;
border-left: #555 1px solid;
}

table.coverage thead td.ctr2 {
Expand All @@ -192,64 +186,64 @@ table.coverage thead td.down {

table.coverage tbody td {
white-space: nowrap;
padding: 12px 18px;
border-bottom: 1px solid #555555;
padding: 2px 6px;
border-bottom: #444 1px solid;
color: #e0e0e0;
}

table.coverage tbody tr:hover {
background: #444444; /* cor de fundo hover das linhas da tabela */
background: #333 !important;
}

table.coverage tbody td.bar {
border-left: #e8e8e8 1px solid;
border-left: #555 1px solid;
}

table.coverage tbody td.ctr1 {
text-align: right;
padding-right: 18px;
border-left: #e8e8e8 1px solid;
padding-right: 14px;
border-left: #555 1px solid;
}

table.coverage tbody td.ctr2 {
text-align: right;
padding-right: 18px;
padding-right: 14px;
padding-left: 2px;
}

table.coverage tfoot td {
white-space: nowrap;
padding: 12px 18px;
padding: 2px 6px;
}

table.coverage tfoot td.bar {
border-left: #e8e8e8 1px solid;
border-left: #555 1px solid;
}

table.coverage tfoot td.ctr1 {
text-align: right;
padding-right: 18px;
border-left: #e8e8e8 1px solid;
padding-right: 14px;
border-left: #555 1px solid;
}

table.coverage tfoot td.ctr2 {
text-align: right;
padding-right: 18px;
padding-right: 14px;
padding-left: 2px;
}

.footer {
margin-top: 20px;
border-top: #d6d3ce 1px solid;
border-top: #444 1px solid;
padding-top: 2px;
color: #a0a0a0;
font-size: 1.5em;
font-size: 8pt;
color: #888;
}

.footer a {
color: #a0a0a0;
color: #80b3ff;
}

.right {
display: none;
float: right;
}

16 changes: 5 additions & 11 deletions src/main/kotlin/com/testainers/DelayResource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,12 @@ class DelayResource(
val responseBody = ResponseBody(request, uriInfo, body)
var code = 200

if (delay < 0 || delay > 10) {
code = 400
responseBody.body = String.format("Invalid delay: %d", delay)
if (delay in 0..10) {
Thread.sleep(delay * 1000L)
responseBody.body = "Slept for $delay seconds."
} else {
try {
Thread.sleep(delay * 1000L)
responseBody.body =
String.format("Slept for %d seconds.", delay)
} catch (e: InterruptedException) {
code = 500
responseBody.body = String.format("Interrupted: %s", e.message)
}
code = 400
responseBody.body = "Invalid delay: $delay"
}

return Response.status(code).entity(responseBody).build()
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/testainers/LengthResource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class LengthResource {
Response
.status(500)
.header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN)
.entity(String.format("Invalid size: %d", size))
.entity("Invalid size: $size")
.build()
} else {
if (MediaType.APPLICATION_OCTET_STREAM == accept) {
Expand Down
Loading

0 comments on commit 6bd8a4c

Please sign in to comment.