Browse Source

Hexagon: improve template rendering (#2681)

* Update Hexagon benchmark

* Update Hexagon benchmark

* Remove features not used in tests

* Remove MySql storage

* Enable Resin test

* Upgrade Hexagon to v0.11

* Disable Resin

* Fix dependencies

* Improve template rendering

* Test in travis

* Fix build script

* Restore Travis script

* Restore Travis script
Juanjo Aguililla 8 years ago
parent
commit
78a9bead51

+ 1 - 1
frameworks/Kotlin/hexagon/build.gradle

@@ -27,7 +27,7 @@ war {
     archiveName = "ROOT.war"
 }
 
-install.dependsOn 'war'
+installDist.dependsOn 'war'
 
 dependencies {
     compile ("co.there4:hexagon:$hexagonVersion")

+ 2 - 2
frameworks/Kotlin/hexagon/gradle.properties

@@ -1,12 +1,12 @@
 
 description=Hexagon web framework's benchmark
 
-gradleScripts=https://raw.githubusercontent.com/jaguililla/hexagon/0.11.0/gradle
+gradleScripts=https://raw.githubusercontent.com/jaguililla/hexagon/0.11.1/gradle
 
 dokkaVersion=0.9.13
 kotlinVersion=1.1.1
 
-hexagonVersion=0.11.0
+hexagonVersion=0.11.1
 pebbleVersion=2.3.0
 jettyVersion=9.4.2.v20170220
 mongodbVersion=3.4.2

+ 1 - 0
frameworks/Kotlin/hexagon/src/main/kotlin/co/there4/hexagon/Benchmark.kt

@@ -48,6 +48,7 @@ private fun Exchange.getQueries() =
 // HANDLERS
 private fun Exchange.listFortunes(store: Repository) {
     val fortunes = store.findFortunes() + Fortune(0, "Additional fortune added at request time.")
+    response.contentType = "text/html; charset=utf-8"
     template("fortunes.html", "fortunes" to fortunes.sortedBy { it.message })
 }
 

+ 2 - 5
frameworks/Kotlin/hexagon/src/main/resources/logback.xml

@@ -4,14 +4,11 @@
 <configuration>
   <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
     <encoder>
-      <Pattern>
-%d{HH:mm:ss.SSS} %highlight(%-5p) %magenta([%-15.15thread]) %-30logger{30} %cyan(%X{jvmId}) | %m%n
-      </Pattern>
+      <Pattern>%d{HH:mm:ss.SSS} %highlight(%-5p) %magenta([%-18.18t]) %-30c{30} | %m%n</Pattern>
     </encoder>
   </appender>
 
-  <root>
-    <level value="off" />
+  <root level="off">
     <appender-ref ref="console" />
   </root>
 </configuration>