mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-26 07:47:13 -07:00
Develop (#12)
* Updated to latest Gradle plugin. * Updated for better alignment across hello templates * Updated to RIFE 1.5.2 * Updated to RIFE 1.5.4
This commit is contained in:
parent
ed1cfc66db
commit
1209879005
6 changed files with 14 additions and 14 deletions
|
@ -68,7 +68,7 @@ java -javaagent:[path-to]/rife2-[version]-agent.jar -jar $JETTY_HOME/start.jar
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./gradlew clean uberJar
|
./gradlew clean uberjar
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run it with:
|
Then run it with:
|
||||||
|
|
|
@ -4,7 +4,7 @@ import com.uwyn.rife2.gradle.TemplateType.*
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
application
|
application
|
||||||
id("com.uwyn.rife2") version "1.0.7"
|
id("com.uwyn.rife2") version "1.0.8"
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("org.graalvm.buildtools.native") version "0.9.20"
|
id("org.graalvm.buildtools.native") version "0.9.20"
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ version = 1.0
|
||||||
group = "com.example"
|
group = "com.example"
|
||||||
|
|
||||||
rife2 {
|
rife2 {
|
||||||
version.set("1.4.0")
|
version.set("1.5.4")
|
||||||
uberMainClass.set("hello.AppUber")
|
uberMainClass.set("hello.AppSiteUber")
|
||||||
useAgent.set(true)
|
useAgent.set(true)
|
||||||
precompiledTemplateTypes.add(HTML)
|
precompiledTemplateTypes.add(HTML)
|
||||||
}
|
}
|
||||||
|
@ -36,12 +36,12 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation("org.jsoup:jsoup:1.15.3")
|
testImplementation("org.jsoup:jsoup:1.15.4")
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
|
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClass.set("hello.App")
|
mainClass.set("hello.AppSite")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|
|
@ -2,7 +2,7 @@ package hello;
|
||||||
|
|
||||||
import rife.engine.*;
|
import rife.engine.*;
|
||||||
|
|
||||||
public class App extends Site {
|
public class AppSite extends Site {
|
||||||
public void setup() {
|
public void setup() {
|
||||||
var hello = get("/hello", c -> c.print(c.template("hello")));
|
var hello = get("/hello", c -> c.print(c.template("hello")));
|
||||||
get("/", c -> c.redirect(hello));
|
get("/", c -> c.redirect(hello));
|
||||||
|
@ -11,6 +11,6 @@ public class App extends Site {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new Server()
|
new Server()
|
||||||
.staticResourceBase("src/main/webapp")
|
.staticResourceBase("src/main/webapp")
|
||||||
.start(new App());
|
.start(new AppSite());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,10 +2,10 @@ package hello;
|
||||||
|
|
||||||
import rife.engine.Server;
|
import rife.engine.Server;
|
||||||
|
|
||||||
public class AppUber extends App {
|
public class AppSiteUber extends AppSite {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new Server()
|
new Server()
|
||||||
.staticUberJarResourceBase("webapp")
|
.staticUberJarResourceBase("webapp")
|
||||||
.start(new AppUber());
|
.start(new AppSiteUber());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,13 +11,13 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||||
public class AppTest {
|
public class AppTest {
|
||||||
@Test
|
@Test
|
||||||
void verifyRoot() {
|
void verifyRoot() {
|
||||||
var m = new MockConversation(new App());
|
var m = new MockConversation(new AppSite());
|
||||||
assertEquals(m.doRequest("/").getStatus(), 302);
|
assertEquals(m.doRequest("/").getStatus(), 302);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void verifyHello() {
|
void verifyHello() {
|
||||||
var m = new MockConversation(new App());
|
var m = new MockConversation(new AppSite());
|
||||||
assertEquals("Hello", m.doRequest("/hello")
|
assertEquals("Hello", m.doRequest("/hello")
|
||||||
.getTemplate().getValue("title"));
|
.getTemplate().getValue("title"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<filter-class>rife.servlet.RifeFilter</filter-class>
|
<filter-class>rife.servlet.RifeFilter</filter-class>
|
||||||
<init-param>
|
<init-param>
|
||||||
<param-name>rifeSiteClass</param-name>
|
<param-name>rifeSiteClass</param-name>
|
||||||
<param-value>hello.App</param-value>
|
<param-value>hello.AppSite</param-value>
|
||||||
</init-param>
|
</init-param>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue