Skip to content

Commit

Permalink
添加gradle支持(进行中)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdyangyu committed Sep 15, 2014
1 parent 0e7203b commit 28777b0
Show file tree
Hide file tree
Showing 14 changed files with 386 additions and 73 deletions.
42 changes: 42 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
allprojects {
apply plugin: 'java'
}

subprojects {
repositories {
mavenLocal()
mavenCentral()

// Dayatang Repo
maven { url 'http://nexus.dayatang.org/content/groups/public-release' }

}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3'
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.5'
}
}

project(':dddlib-utils') {

dependencies {
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2', transitive: true
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.2'
testCompile group: 'org.slf4j', name: 'org.slf4j-log4j12', version: '1.7.2'
testCompile group: 'com.mchange', name: 'c3p0', version: '0.9.2.1'
testCompile group: 'org.slf4j', name: 'org.slf4j-log4j12', version: '1.7.2'
testCompile group: 'org.slf4j', name: 'org.slf4j-log4j12', version: '1.7.2'
}
}

project(':dddlib-configuration') {

dependencies {
compile(project(":dddlib-utils"))
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2', transitive: true
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.2'
testCompile group: 'org.slf4j', name: 'org.slf4j-log4j12', version: '1.7.2'
}
}
1 change: 1 addition & 0 deletions dddlib-cache/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include 'dddlib-cache-api', 'dddlib-cache-memcached', 'dddlib-cache-ehcache', 'dddlib-cache-redis'
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@ public interface EventStore {

/**
* 获取指定时间范围发生的历史事件的集合,时间范围包含occurredFrom,不包含occurredTo。
*
* @param occurredFrom 事件发生时间的下限
* @param occurredTo 事件发生时间的上限
* @param occurredTo 事件发生时间的上限
* @return 指定时间范围发生的事件的集合,按发生时间升序排序。
*/
public List<StoredEvent> allStoredEventsBetween(Date occurredFrom, Date occurredTo);
public List<StoredEvent> findStoredEventsBetween(Date occurredFrom, Date occurredTo);

/**
* 获取指定时间及其之后发生的历史事件的集合。
*
* @param occurredFrom 事件发生时间的下限
* @return 指定时间及其之后发生的事件的集合,按发生时间升序排序。
*/
public List<StoredEvent> allStoredEventsSince(Date occurredFrom);
public List<StoredEvent> findStoredEventsSince(Date occurredFrom);

/**
* 向事件存储中插入一个新的领域事件
*
* @param domainEvent 一个领域事件
* @return 代表领域事件的存储的事件
*/
Expand All @@ -38,6 +41,7 @@ public interface EventStore {

/**
* 统计存储的事件的数量
*
* @return 已存储的事件的数量
*/
public long countStoredEvents();
Expand Down
2 changes: 2 additions & 0 deletions dddlib-examples/dddlib-examples-organisation/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include 'organisation-domain', 'organisation-application', 'organisation-facade',
'organisation-facade-impl', 'organisation-webapp'
1 change: 1 addition & 0 deletions dddlib-examples/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include 'dddlib-examples-organisation'
1 change: 1 addition & 0 deletions dddlib-image/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include 'dddlib-image-api', 'dddlib-image-cache', 'dddlib-image-file'
1 change: 1 addition & 0 deletions dddlib-ioc/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include 'dddlib-ioc-spring', 'dddlib-ioc-guice', 'dddlib-ioc-tapestry', 'dddlib-ioc-test'
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public class HibernateEventStore implements EventStore {
private EntityRepositoryHibernate repository;

@Override
public List<StoredEvent> allStoredEventsBetween(Date occurredFrom, Date occurredTo) {
public List<StoredEvent> findStoredEventsBetween(Date occurredFrom, Date occurredTo) {
return null;
}

@Override
public List<StoredEvent> allStoredEventsSince(Date occurredFrom) {
public List<StoredEvent> findStoredEventsSince(Date occurredFrom) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,68 +15,67 @@
*/
package org.dayatang.event.hibernate;

import java.util.Date;
import java.util.List;
import org.dayatang.domain.event.DomainEvent;
import org.dayatang.domain.event.StoredEvent;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.*;

import java.util.Date;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

/**
*
* @author yyang
*/
public class HibernateEventStoreTest {



public HibernateEventStoreTest() {
}

@BeforeClass
public static void setUpClass() {
}

@AfterClass
public static void tearDownClass() {
}

@Before
public void setUp() {
}

@After
public void tearDown() {
}

/**
* Test of allStoredEventsBetween method, of class HibernateEventStore.
* Test of findStoredEventsBetween method, of class HibernateEventStore.
*/
@Test
public void testAllStoredEventsBetween() {
System.out.println("allStoredEventsBetween");
public void testFindStoredEventsBetween() {
System.out.println("findStoredEventsBetween");
Date occurredFrom = null;
Date occurredTo = null;
HibernateEventStore instance = new HibernateEventStore();
List<StoredEvent> expResult = null;
List<StoredEvent> result = instance.allStoredEventsBetween(occurredFrom, occurredTo);
List<StoredEvent> result = instance.findStoredEventsBetween(occurredFrom, occurredTo);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}

/**
* Test of allStoredEventsSince method, of class HibernateEventStore.
* Test of findStoredEventsSince method, of class HibernateEventStore.
*/
@Test
public void testAllStoredEventsSince() {
System.out.println("allStoredEventsSince");
public void testFindStoredEventsSince() {
System.out.println("findStoredEventsSince");
Date occurredFrom = null;
HibernateEventStore instance = new HibernateEventStore();
List<StoredEvent> expResult = null;
List<StoredEvent> result = instance.allStoredEventsSince(occurredFrom);
List<StoredEvent> result = instance.findStoredEventsSince(occurredFrom);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
Expand Down Expand Up @@ -122,5 +121,5 @@ public void testCountStoredEvents() {
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}

}
1 change: 1 addition & 0 deletions dddlib-persistence/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include 'dddlib-persistence-hibernate', 'dddlib-persistence-jpa', 'dddlib-persistence-test'
92 changes: 47 additions & 45 deletions dddlib-utils/pom.xml
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.dayatang.dddlib</groupId>
<artifactId>dddlib-project</artifactId>
<version>4.3.1-SNAPSHOT</version>
</parent>
<artifactId>dddlib-utils</artifactId>
<packaging>jar</packaging>
<name>DDDLib Utils</name>
<description>DDDLib工具类库,其中最重要的工具是断
言Assert和日志Slf4jLogger</description>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.dayatang.dddlib</groupId>
<artifactId>dddlib-project</artifactId>
<version>4.3.1-SNAPSHOT</version>
</parent>
<artifactId>dddlib-utils</artifactId>
<packaging>jar</packaging>
<name>DDDLib Utils</name>
<description>DDDLib工具类库,其中最重要的工具是断
言Assert和日志Slf4jLogger
</description>

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
Expand Down
Loading

0 comments on commit 28777b0

Please sign in to comment.