Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
automatic-test
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟涨钱
automatic-test
Commits
21e0250c
Commit
21e0250c
authored
Aug 23, 2021
by
朽木不可雕也
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
引入quartz框架
parent
5dd18c95
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
public/pom.xml
+8
-0
public/src/main/java/com/zhiweidata/automatictest/publics/BeanContainer.java
+19
-0
public/src/main/resources/quartz.properties
+19
-0
No files found.
public/pom.xml
View file @
21e0250c
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
<maven.compiler.target>
8
</maven.compiler.target>
<maven.compiler.target>
8
</maven.compiler.target>
<okhttp.version>
5.0.0-alpha.2
</okhttp.version>
<okhttp.version>
5.0.0-alpha.2
</okhttp.version>
<lo4j.version>
2.14.1
</lo4j.version>
<lo4j.version>
2.14.1
</lo4j.version>
<quartz.version>
2.3.2
</quartz.version>
</properties>
</properties>
<dependencies>
<dependencies>
...
@@ -31,6 +32,12 @@
...
@@ -31,6 +32,12 @@
<artifactId>
log4j-slf4j-impl
</artifactId>
<artifactId>
log4j-slf4j-impl
</artifactId>
<version>
${lo4j.version}
</version>
<version>
${lo4j.version}
</version>
</dependency>
</dependency>
<!-- https://mvnrepository.com/artifact/org.quartz-scheduler/quartz -->
<dependency>
<groupId>
org.quartz-scheduler
</groupId>
<artifactId>
quartz
</artifactId>
<version>
${quartz.version}
</version>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
public/src/main/java/com/zhiweidata/automatictest/publics/BeanContainer.java
View file @
21e0250c
package
com
.
zhiweidata
.
automatictest
.
publics
;
package
com
.
zhiweidata
.
automatictest
.
publics
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.OkHttpClient
;
import
okhttp3.OkHttpClient
;
import
org.quartz.Scheduler
;
import
org.quartz.SchedulerException
;
import
org.quartz.impl.StdSchedulerFactory
;
/**
/**
* Bean容器
* Bean容器
...
@@ -9,10 +13,25 @@ import okhttp3.OkHttpClient;
...
@@ -9,10 +13,25 @@ import okhttp3.OkHttpClient;
* @createTime 2021-08-23 16:06:42
* @createTime 2021-08-23 16:06:42
* @ide IntelliJ IDEA
* @ide IntelliJ IDEA
*/
*/
@Slf4j
@SuppressWarnings
(
"JavaDoc"
)
@SuppressWarnings
(
"JavaDoc"
)
public
class
BeanContainer
{
public
class
BeanContainer
{
/**
/**
* http 客户端
* http 客户端
*/
*/
public
static
final
OkHttpClient
OK_HTTP_CLIENT
=
new
OkHttpClient
();
public
static
final
OkHttpClient
OK_HTTP_CLIENT
=
new
OkHttpClient
();
/**
* 全局任务调度器
*/
public
static
final
Scheduler
SCHEDULER
;
static
{
Scheduler
scheduler
=
null
;
try
{
scheduler
=
StdSchedulerFactory
.
getDefaultScheduler
();
}
catch
(
SchedulerException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
SCHEDULER
=
scheduler
;
}
}
}
public/src/main/resources/quartz.properties
0 → 100644
View file @
21e0250c
# suppress inspection "SpellCheckingInspection" for whole file
# suppress inspection "UnusedProperty" for whole file
# 全局定时任务调度器配置
org.quartz.scheduler.instanceName
=
automatic-test
# 调度器实现类
org.quartz.scheduler.instanceIdGenerator.class
=
org.quartz.simpl.SimpleInstanceIdGenerator
# 线程池配置
org.quartz.threadPool.class
=
org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount
=
10
# 配置任务运行日志
# 日志插件
org.quartz.plugin.triggHistory.class
=
org.quartz.plugins.history.LoggingTriggerHistoryPlugin
# 任务启动日志
org.quartz.plugin.triggHistory.triggerFiredMessage
=
\
Trigger
\{
1
\}
.
\{
0
\}
fired job
\{
6
\}
.
\{
5
\}
at:
\{
4, date, yyyy-MM-dd HH:mm:ss.SSS}
# 任务结束日志
org.quartz.plugin.triggHistory.triggerCompleteMessage
=
\
Trigger
\{
1
\}
.
\{
0
\}
completed firing job
\{
6
\}
.
\{
5
\}
at
\{
4, date, yyyy-MM-dd HH:mm:ss.SSS
\}
.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment