@@ -16,6 +16,9 @@ plugins {
|
|||||||
id 'org.unbroken-dome.test-sets' version '1.4.5'
|
id 'org.unbroken-dome.test-sets' version '1.4.5'
|
||||||
id 'war'
|
id 'war'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: 'org.springframework.boot'
|
||||||
|
|
||||||
description = 'Pandamonium Theorem Prover'
|
description = 'Pandamonium Theorem Prover'
|
||||||
|
|
||||||
group 'edu.msudenver.tsp'
|
group 'edu.msudenver.tsp'
|
||||||
@@ -38,10 +41,42 @@ allprojects {
|
|||||||
apply plugin: 'jacoco'
|
apply plugin: 'jacoco'
|
||||||
apply plugin: 'org.unbroken-dome.test-sets'
|
apply plugin: 'org.unbroken-dome.test-sets'
|
||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
apply plugin: 'org.springframework.boot'
|
|
||||||
apply plugin: 'io.spring.dependency-management'
|
apply plugin: 'io.spring.dependency-management'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subprojects {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile 'org.apache.commons:commons-lang3:3.5'
|
||||||
|
// The production code uses the SLF4J logging API at compile time
|
||||||
|
compile 'org.slf4j:slf4j-api:1.7.21'
|
||||||
|
compile "joda-time:joda-time:2.2"
|
||||||
|
compile('org.springframework:spring-context:5.0.9.RELEASE')
|
||||||
|
|
||||||
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
|
testCompile('org.mockito:mockito-core:1.10.19') {exclude(group: 'org.hamcrest')}
|
||||||
|
|
||||||
|
compileOnly 'org.projectlombok:lombok:1.18.4'
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
|
if (System.properties['test.profile'] != 'integrationTest') {
|
||||||
|
exclude '**/*integrationTest*'
|
||||||
|
} else {
|
||||||
|
exclude '**/*edu/*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
testSets {
|
||||||
|
unitTest
|
||||||
|
integrationTest
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bootJar {
|
bootJar {
|
||||||
baseName = 'gs-spring-boot'
|
baseName = 'gs-spring-boot'
|
||||||
version = '0.1.0'
|
version = '0.1.0'
|
||||||
@@ -65,7 +100,7 @@ dependencies {
|
|||||||
|
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
testCompile("org.springframework.boot:spring-boot-starter-test")
|
testCompile "org.springframework:spring-test:5.0.9.RELEASE"
|
||||||
testCompile('org.mockito:mockito-core:1.10.19') {exclude(group: 'org.hamcrest')}
|
testCompile('org.mockito:mockito-core:1.10.19') {exclude(group: 'org.hamcrest')}
|
||||||
|
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.4'
|
compileOnly 'org.projectlombok:lombok:1.18.4'
|
||||||
|
|||||||
Binary file not shown.
@@ -4,4 +4,3 @@ lombok.accessors.fluent = false
|
|||||||
lombok.addLombokGeneratedAnnotation = true
|
lombok.addLombokGeneratedAnnotation = true
|
||||||
lombok.log.fieldName = LOG
|
lombok.log.fieldName = LOG
|
||||||
lombok.toString.includeFieldNames = true
|
lombok.toString.includeFieldNames = true
|
||||||
lombok.data.flagUsage = error
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
plugins {
|
||||||
|
id 'java'
|
||||||
|
}
|
||||||
|
|
||||||
|
group 'edu.msudenver.tsp'
|
||||||
|
version '1.0'
|
||||||
|
|
||||||
|
sourceCompatibility = 1.8
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
|
compile fileTree(dir: 'lib', include: '**/*.jar')
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package edu.msudenver.tsp.persistence;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
public class PersistenceConfig {
|
||||||
|
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dao;
|
||||||
|
|
||||||
|
class BaseDao {
|
||||||
|
|
||||||
|
// <T> T findById(final int id) {
|
||||||
|
// //TODO insert DB calls for finding objects by their ID's
|
||||||
|
// }
|
||||||
|
|
||||||
|
// <T> List<T> queryForList(final String query) {
|
||||||
|
// //TODO insert DB calls for querying for lists based on the specified query
|
||||||
|
// }
|
||||||
|
|
||||||
|
// <T> T save(final T t) {
|
||||||
|
// //TODO insert DB calls here for insert and update
|
||||||
|
// }
|
||||||
|
|
||||||
|
<T> void delete(final T t) {
|
||||||
|
//TODO insert DB calls here to delete
|
||||||
|
}
|
||||||
|
|
||||||
|
// private <T> T insert(final T object) {
|
||||||
|
// // TODO insert DB calls to insert records
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private <T> T update(final T object) {
|
||||||
|
// //TODO insert DB calls to update records
|
||||||
|
// }
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dao;
|
||||||
|
|
||||||
|
public class DefinitionDao extends BaseDao {
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dao;
|
||||||
|
|
||||||
|
public class NotationDao extends BaseDao {
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dao;
|
||||||
|
|
||||||
|
public class ProofDao extends BaseDao {
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dao;
|
||||||
|
|
||||||
|
public class TheoremDao extends BaseDao {
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
class BaseDto {
|
||||||
|
private String id;
|
||||||
|
private int version;
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dto;
|
||||||
|
|
||||||
|
public class DefinitionDto extends BaseDto {
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dto;
|
||||||
|
|
||||||
|
public class NotationDto extends BaseDto {
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dto;
|
||||||
|
|
||||||
|
public class ProofDto extends BaseDto {
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.dto;
|
||||||
|
|
||||||
|
public class TheoremDto extends BaseDto {
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.manager;
|
||||||
|
|
||||||
|
import edu.msudenver.tsp.persistence.dao.DefinitionDao;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DefinitionManager {
|
||||||
|
final private DefinitionDao definitionDao;
|
||||||
|
}
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.manager;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
public class ManagerConfig {
|
||||||
|
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.manager;
|
||||||
|
|
||||||
|
import edu.msudenver.tsp.persistence.dao.NotationDao;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class NotationManager {
|
||||||
|
final private NotationDao notationDao;
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.manager;
|
||||||
|
|
||||||
|
import edu.msudenver.tsp.persistence.dao.ProofDao;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ProofManager {
|
||||||
|
final private ProofDao proofDao;
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package edu.msudenver.tsp.persistence.manager;
|
||||||
|
|
||||||
|
import edu.msudenver.tsp.persistence.dao.TheoremDao;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TheoremManager {
|
||||||
|
final private TheoremDao theoremDao;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
plugins {
|
||||||
|
id 'java'
|
||||||
|
}
|
||||||
|
|
||||||
|
group 'edu.msudenver.tsp'
|
||||||
|
version '1.0'
|
||||||
|
|
||||||
|
sourceCompatibility = 1.8
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile project(':persistence')
|
||||||
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
|
compile fileTree(dir: 'lib', include: '**/*.jar')
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package edu.msudenver.tsp.services.parser;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
//@PropertySource("classpath:development.properties")
|
||||||
|
public class ParserConfig {
|
||||||
|
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
package edu.msudenver.tsp.services.parser;
|
||||||
|
|
||||||
|
import edu.msudenver.tsp.persistence.manager.DefinitionManager;
|
||||||
|
import edu.msudenver.tsp.persistence.manager.NotationManager;
|
||||||
|
import edu.msudenver.tsp.persistence.manager.ProofManager;
|
||||||
|
import edu.msudenver.tsp.persistence.manager.TheoremManager;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
class ParserService {
|
||||||
|
private final DefinitionManager definitionManager;
|
||||||
|
private final TheoremManager theoremManager;
|
||||||
|
private final NotationManager notationManager;
|
||||||
|
private final ProofManager proofManager;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ParserService(final DefinitionManager definitionManager, final TheoremManager theoremManager,
|
||||||
|
final NotationManager notationManager, final ProofManager proofManager) {
|
||||||
|
this.definitionManager = definitionManager;
|
||||||
|
this.theoremManager = theoremManager;
|
||||||
|
this.notationManager = notationManager;
|
||||||
|
this.proofManager = proofManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package edu.msudenver.tsp.services.scoring;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
//@PropertySource("classpath:development.properties")
|
||||||
|
public class ScoringConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public TheoremScoringService theoremScoringService() {
|
||||||
|
return new TheoremScoringService();
|
||||||
|
}
|
||||||
|
}
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
package edu.msudenver.tsp.services.scoring;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
class TheoremScoringService {
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package edu.msudenver.tsp.services.parser;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.runners.MockitoJUnitRunner;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
|
public class ParserServiceTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
assertEquals(3,3);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package edu.msudenver.tsp.services.scoring;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.runners.MockitoJUnitRunner;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
|
public class TheoremScoringServiceTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
assertEquals(3,3);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
rootProject.name = 'pandamonium-theorem-prover'
|
rootProject.name = 'pandamonium-theorem-prover'
|
||||||
|
include 'services'
|
||||||
|
include 'persistence'
|
||||||
|
include 'utilities'
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package hello;
|
package edu.msudenver.tsp.website;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package hello;
|
package edu.msudenver.tsp.website;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -8,6 +8,6 @@ public class HelloController {
|
|||||||
|
|
||||||
@RequestMapping("/")
|
@RequestMapping("/")
|
||||||
public String index() {
|
public String index() {
|
||||||
return "Greetings from Spring Boot!";
|
return "Welcome to Project Pandamonium!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
package edu.msudenver.tsp.website;
|
||||||
|
|
||||||
|
public class ProofsDriver {
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package edu.msudenver.tsp.website;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
//@PropertySource("classpath:development.properties")
|
||||||
|
public class WebsiteConfig {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
package edu.msudenver.tsp.website;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
public class HelloControllerTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test() {
|
||||||
|
assertEquals(3, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package edu.msudenver.tsp.website;
|
||||||
|
|
||||||
|
public class ProofsDriverTest {
|
||||||
|
|
||||||
|
}
|
||||||
+3
-2
@@ -1,3 +1,5 @@
|
|||||||
|
package edu.msudenver.tsp.website.integrationTest;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
@@ -5,8 +7,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
public class HelloControllerTest {
|
public class HelloControllerIntegrationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() {
|
||||||
assertEquals(3,3);
|
assertEquals(3,3);
|
||||||
-36
@@ -1,36 +0,0 @@
|
|||||||
package integrationTest;
|
|
||||||
|
|
||||||
import hello.Application;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
|
||||||
import org.springframework.boot.web.server.LocalServerPort;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
||||||
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = Application.class)
|
|
||||||
public class HelloControllerIntegrationTest {
|
|
||||||
@LocalServerPort private int port;
|
|
||||||
private URL base;
|
|
||||||
@Autowired private TestRestTemplate testRestTemplate;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setUp() throws Exception {
|
|
||||||
this.base = new URL("http://localhost:" + port + "/");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetHello() {
|
|
||||||
final ResponseEntity<String> response = testRestTemplate.getForEntity(base.toString(),
|
|
||||||
String.class);
|
|
||||||
assertEquals("Greetings from Spring Boot!", response.getBody());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
plugins {
|
||||||
|
id 'java'
|
||||||
|
}
|
||||||
|
|
||||||
|
group 'edu.msudenver.tsp'
|
||||||
|
version '1.0'
|
||||||
|
|
||||||
|
sourceCompatibility = 1.8
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
|
compile fileTree(dir: 'lib', include: '**/*.jar')
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user