This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static List<Request> loadRequest() throws IOException { | |
InputStream inputStream = Main.class.getClassLoader().getResourceAsStream("seeds.properties"); | |
final Reader in = new InputStreamReader(inputStream, "UTF-8"); | |
LineNumberReader rd = new LineNumberReader(in); | |
String line = null; | |
while((line=rd.readLine())!=null){ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.test.context.ContextConfiguration; | |
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | |
import static org.junit.Assert.assertNotNull; | |
@RunWith(SpringJUnit4ClassRunner.class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd | |
<task:annotation-driven /> <!-- 定时器开关--> | |
<bean id="myTask" class="com.pkg.SomeTask"> | |
<property name="xx" value="xx"/> | |
</bean> | |
<task:scheduled-tasks> | |
<task:scheduled ref="myTask" method="jobMethod" cron="* */25 * * * ?"/> | |
</task:scheduled-tasks> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>groovy.test</groupId> | |
<artifactId>mytest</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import thread.SystemConfig; | |
import javax.management.MBeanServer; | |
import javax.management.ObjectName; | |
import java.lang.management.ManagementFactory; | |
/** | |
* Created by cxu on 2015/4/7. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create database if not exists `diamond`; | |
grant all on diamond.* to zh@'%' identified by 'abc'; | |
use `diamond`; | |
create table config_info ( | |
`id` bigint(64) unsigned NOT NULL auto_increment, | |
`data_id` varchar(255) NOT NULL DEFAULT '', | |
`group_id` varchar(128) NOT NULL DEFAULT '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.eclipse.jetty.server.Server; | |
/** The simplest possible Jetty server. | |
*/ | |
public class Main | |
{ | |
public static void main(String[] args) throws Exception | |
{ | |
Server server = new Server(8080); | |
server.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Set name="tempDirectory"><Property name="jetty.home" default="." />/work</Set> |