Skip to content

Commit e0cb325

Browse files
pmg1991Prakharnoear
authored
New framework: Solon (#7914)
* added solon Committer: pmg1991 * Adjust the code * Adjust the test code to the mvc style * Replace the json framework with my snack3 (it's very small) * docker file update Committer: pmg1991 --------- Co-authored-by: Prakhar <[email protected]> Co-authored-by: noear <[email protected]>
1 parent 4f46d7d commit e0cb325

File tree

9 files changed

+242
-0
lines changed

9 files changed

+242
-0
lines changed

frameworks/Java/solon/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# solon Benchmarking Test
2+
3+
4+
This is the solon portion of a [benchmarking test suite](../) comparing a variety of web development platforms.
5+
6+
### JSON Encoding Test
7+
* [JSON test source](src/main/java/pmg/Main.java)
8+
* [Plaintext test source](src/main/java/pmg/Main.java)
9+
10+
## Versions
11+
12+
* [Java OpenJDK 1.8](http://openjdk.java.net/)
13+
* [solon 2.0.0](https://github.com/noear/solon)
14+
15+
## Test URLs
16+
17+
### JSON Encoding Test
18+
19+
http://localhost:8080/json
20+
21+
### Plaintext Encoding Test
22+
23+
http://localhost:8080/plaintext
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"framework": "solon",
3+
"tests": [
4+
{
5+
"default": {
6+
"json_url": "/json",
7+
"plaintext_url": "/plaintext",
8+
"port": 8080,
9+
"approach": "Realistic",
10+
"classification": "Fullstack",
11+
"database": "None",
12+
"framework": "solon",
13+
"language": "Java",
14+
"flavor": "None",
15+
"orm": "Full",
16+
"platform": "solon",
17+
"webserver": "smarthttp",
18+
"os": "Linux",
19+
"database_os": "Linux",
20+
"display_name": "solon",
21+
"notes": "",
22+
"versus": "None"
23+
}
24+
}
25+
]
26+
}

frameworks/Java/solon/config.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[framework]
2+
name = "solon"
3+
4+
[main]
5+
urls.plaintext = "/plaintext"
6+
urls.json = "/json"
7+
approach = "Realistic"
8+
classification = "Platform"
9+
database = "None"
10+
database_os = "Linux"
11+
os = "Linux"
12+
orm = "Raw"
13+
platform = "solon"
14+
webserver = "smarthttp"
15+
versus = "None"

frameworks/Java/solon/pom.xml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>org.noear.solon</groupId>
6+
<artifactId>solon-benchmark</artifactId>
7+
<version>1.0</version>
8+
<packaging>jar</packaging>
9+
10+
<properties>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
<maven.compiler.source>11</maven.compiler.source>
13+
<maven.compiler.target>11</maven.compiler.target>
14+
<solon.version>2.0.0</solon.version>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.noear</groupId>
20+
<artifactId>solon.boot.smarthttp</artifactId>
21+
<version>${solon.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.noear</groupId>
25+
<artifactId>solon.serialization.snack3</artifactId>
26+
<version>${solon.version}</version>
27+
</dependency>
28+
</dependencies>
29+
30+
<repositories>
31+
<repository>
32+
<id>central</id>
33+
<name>Central Repository</name>
34+
<url>https://repo.maven.apache.org/maven2</url>
35+
</repository>
36+
<repository>
37+
<id>sonatype-nexus-snapshots</id>
38+
<name>Sonatype Nexus Snapshots</name>
39+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
40+
</repository>
41+
</repositories>
42+
43+
<pluginRepositories>
44+
<pluginRepository>
45+
<id>central</id>
46+
<name>Central Repository</name>
47+
<url>https://repo.maven.apache.org/maven2</url>
48+
</pluginRepository>
49+
<pluginRepository>
50+
<id>sonatype-nexus-snapshots</id>
51+
<name>Sonatype Nexus Snapshots</name>
52+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
53+
<releases>
54+
<enabled>false</enabled>
55+
</releases>
56+
<snapshots>
57+
<enabled>true</enabled>
58+
</snapshots>
59+
</pluginRepository>
60+
</pluginRepositories>
61+
62+
<build>
63+
<finalName>${project.artifactId}</finalName>
64+
65+
<plugins>
66+
<plugin>
67+
<groupId>org.apache.maven.plugins</groupId>
68+
<artifactId>maven-compiler-plugin</artifactId>
69+
<version>3.8.1</version>
70+
<configuration>
71+
<compilerArgument>-parameters</compilerArgument>
72+
<source>1.8</source>
73+
<target>1.8</target>
74+
<encoding>UTF-8</encoding>
75+
<debug>false</debug>
76+
</configuration>
77+
</plugin>
78+
79+
<plugin>
80+
<groupId>org.apache.maven.plugins</groupId>
81+
<artifactId>maven-assembly-plugin</artifactId>
82+
<version>3.3.0</version>
83+
<configuration>
84+
<descriptorRefs>
85+
<descriptorRef>jar-with-dependencies</descriptorRef>
86+
</descriptorRefs>
87+
<archive>
88+
<manifest>
89+
<mainClass>pmg.Main</mainClass>
90+
</manifest>
91+
</archive>
92+
</configuration>
93+
<executions>
94+
<execution>
95+
<id>make-assembly</id>
96+
<phase>package</phase>
97+
<goals>
98+
<goal>single</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
</plugin>
103+
</plugins>
104+
</build>
105+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM maven:3.6.1-jdk-11-slim as maven
2+
WORKDIR /solon
3+
COPY pom.xml pom.xml
4+
COPY src src
5+
RUN mvn compile assembly:single -q
6+
7+
FROM openjdk:11.0.3-jdk-slim
8+
WORKDIR /solon
9+
COPY --from=maven /solon/target/solon-benchmark-jar-with-dependencies.jar app.jar
10+
11+
EXPOSE 8080
12+
13+
CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-cp", "app.jar", "pmg.Main"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package pmg;
2+
3+
import org.noear.solon.Solon;
4+
5+
/**
6+
* @author pmg1991
7+
* @version V1.0
8+
*/
9+
public class Main {
10+
public static void main(String[] args) {
11+
Solon.start(Main.class, args);
12+
}
13+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package pmg.controller;
2+
3+
import org.noear.solon.annotation.Controller;
4+
import org.noear.solon.annotation.Get;
5+
import org.noear.solon.annotation.Mapping;
6+
import pmg.model.Message;
7+
8+
/**
9+
* @author noear
10+
* @version V1.0
11+
*/
12+
@Controller
13+
public class HelloController {
14+
@Get
15+
@Mapping("plaintext")
16+
public String plaintext() {
17+
return "Hello, World!";
18+
}
19+
20+
@Get
21+
@Mapping("json")
22+
public Message json() {
23+
return new Message("Hello, World!");
24+
}
25+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package pmg.model;
2+
3+
/**
4+
* @author pmg1991
5+
* @version V1.0
6+
*/
7+
public class Message {
8+
private String message;
9+
10+
public Message(String message) {
11+
this.message = message;
12+
}
13+
14+
public String getMessage() {
15+
return message;
16+
}
17+
18+
public void setMessage(String message) {
19+
this.message = message;
20+
}
21+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
server.http.ioBound=false

0 commit comments

Comments
 (0)