File tree Expand file tree Collapse file tree 4 files changed +27
-11
lines changed
frameworks/Java/tio-http-server
java/com/litongjava/tio/http/server
test/java/com/litongjava/tio/http/server Expand file tree Collapse file tree 4 files changed +27
-11
lines changed Original file line number Diff line number Diff line change 2727 <version >${jfinal-plugins.version} </version >
2828 </dependency >
2929
30+ <dependency >
31+ <groupId >junit</groupId >
32+ <artifactId >junit</artifactId >
33+ <version >4.12</version >
34+ <scope >test</scope >
35+ </dependency >
36+
37+
3038 <!-- https://mvnrepository.com/artifact/com.jfinal/activerecord -->
3139 <!--
3240 <dependency>
Original file line number Diff line number Diff line change 11package com .litongjava .tio .http .server ;
22
3- import org .slf4j .Logger ;
4- import org .slf4j .LoggerFactory ;
5-
63import com .litongjava .tio .http .common .HttpConfig ;
74import com .litongjava .tio .http .common .handler .ITioHttpRequestHandler ;
85import com .litongjava .tio .http .server .config .EhCachePluginConfig ;
2017public class MainApp {
2118
2219 public static void main (String [] args ) {
23- Logger log = LoggerFactory .getLogger (MainApp .class );
2420 long start = System .currentTimeMillis ();
2521 EnvUtils .load ();
2622 // add route
@@ -55,14 +51,10 @@ public static void main(String[] args) {
5551 serverTioConfig .statOn = false ;
5652 // start server
5753 try {
54+ new MysqlDbConfig ().init ();
55+ new EnjoyEngineConfig ().engine ();
56+ new EhCachePluginConfig ().ehCachePlugin ();
5857 httpServerStarter .start ();
59- if (EnvUtils .getBoolean ("native" , false )) {
60- new MysqlDbConfig ().init ();
61- new EnjoyEngineConfig ().engine ();
62- new EhCachePluginConfig ().ehCachePlugin ();
63- } else {
64- log .info ("native mode,only start server" );
65- }
6658 long end = System .currentTimeMillis ();
6759 System .out .println ((end - start ) + "ms" );
6860 } catch (Exception e ) {
Original file line number Diff line number Diff line change 11http.response.addServerHead =true
2+ http.response.header.showServer =true
23
34# JDBC_URL=jdbc:mysql://192.168.1.2/hello_world?useSSL=false&allowPublicKeyRetrieval=true
45# JDBC_USER=root
Original file line number Diff line number Diff line change 1+ package com .litongjava .tio .http .server ;
2+
3+ import org .junit .Test ;
4+
5+ import com .litongjava .tio .utils .environment .EnvUtils ;
6+
7+ public class MainAppTest {
8+
9+ @ Test
10+ public void test () {
11+ boolean boolean1 = EnvUtils .getBoolean ("native" , false );
12+ System .out .println (boolean1 );
13+ }
14+
15+ }
You can’t perform that action at this time.
0 commit comments