Commit eeef89c5 authored by huriarte's avatar huriarte

Pruebas Unitarias para Subida de Archivos

parent 0631a1b3
<?xml version="1.0" encoding="UTF-8"?> <?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" <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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>com.bytesw.xdf</groupId> <groupId>com.bytesw.xdf</groupId>
<artifactId>byteXDF4Java-arq</artifactId> <artifactId>byteXDF4Java-arq</artifactId>
<version>3.1.0</version> <version>3.1.0</version>
</parent> </parent>
<groupId>com.bytesw.bytebot</groupId> <groupId>com.bytesw.bytebot</groupId>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>bytebot-service</artifactId> <artifactId>bytebot-service</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<xdf.version>3.1.0</xdf.version> <xdf.version>3.1.0</xdf.version>
<mainclass>com.bytesw.bytebot.BytebotApplication</mainclass>
<jacoco.version>0.8.5</jacoco.version>
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${project.basedir}/../target/jacoco.exec</sonar.jacoco.reportPath>
<sonar.language>java</sonar.language>
<docker.image.prefix>bytesw</docker.image.prefix> <docker.image.prefix>bytesw</docker.image.prefix>
<docker.image.name>bytebot-service</docker.image.name> <docker.image.name>bytebot-service</docker.image.name>
<packaging.type>war</packaging.type> <packaging.type>war</packaging.type>
<json-path.version>2.4.0</json-path.version> <json-path.version>2.4.0</json-path.version>
<org.everit.json.schema.version>1.5.1</org.everit.json.schema.version> <org.everit.json.schema.version>1.5.1</org.everit.json.schema.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.bytesw.xdf</groupId> <groupId>com.bytesw.xdf</groupId>
<artifactId>byteXDF4Java-coreweb</artifactId> <artifactId>byteXDF4Java-coreweb</artifactId>
<version>${xdf.version}</version> <version>${xdf.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId> <artifactId>spring-cloud-starter-config</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>org.apache.tomcat.embed</groupId> <groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId> <artifactId>tomcat-embed-websocket</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.drools</groupId> <groupId>org.drools</groupId>
<artifactId>drools-core</artifactId> <artifactId>drools-core</artifactId>
<version>7.37.0.Final</version> <version>7.37.0.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>4.1.2</version> <version>4.1.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.jayway.jsonpath</groupId> <groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId> <artifactId>json-path</artifactId>
<version>${json-path.version}</version> <version>${json-path.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.everit.json</groupId> <groupId>org.everit.json</groupId>
<artifactId>org.everit.json.schema</artifactId> <artifactId>org.everit.json.schema</artifactId>
<version>${org.everit.json.schema.version}</version> <version>${org.everit.json.schema.version}</version>
</dependency> </dependency>
<!-- Inicio de Lock para scheduling --> <!-- Inicio de Lock para scheduling -->
<dependency> <dependency>
<groupId>net.javacrumbs.shedlock</groupId> <groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId> <artifactId>shedlock-spring</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.javacrumbs.shedlock</groupId> <groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId> <artifactId>shedlock-provider-jdbc-template</artifactId>
</dependency> </dependency>
<!-- Fin de Lock para scheduling --> <!-- Fin de Lock para scheduling -->
<dependency> <dependency>
<groupId>io.micrometer</groupId> <groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId> <artifactId>micrometer-registry-prometheus</artifactId>
<version>1.3.2</version> <version>1.3.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId> <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security.oauth</groupId> <groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId> <artifactId>spring-security-oauth2</artifactId>
<version>2.3.4.RELEASE</version> <version>2.3.4.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security.oauth.boot</groupId> <groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId> <artifactId>spring-security-oauth2-autoconfigure</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.session</groupId> <groupId>org.springframework.session</groupId>
<artifactId>spring-session-jdbc</artifactId> <artifactId>spring-session-jdbc</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.codehaus.jettison</groupId> <groupId>org.codehaus.jettison</groupId>
<artifactId>jettison</artifactId> <artifactId>jettison</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.batch</groupId> <groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId> <artifactId>spring-batch-core</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
<!-- test --> <!-- test -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId> <artifactId>assertj-core</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sourceforge.cobertura</groupId> <groupId>net.sourceforge.cobertura</groupId>
<artifactId>cobertura</artifactId> <artifactId>cobertura</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.jparams</groupId> <groupId>com.jparams</groupId>
<artifactId>to-string-verifier</artifactId> <artifactId>to-string-verifier</artifactId>
<version>1.4.2</version> <version>1.4.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.springframework.security</groupId>
<artifactId>poi-ooxml</artifactId> <artifactId>spring-security-test</artifactId>
<version>4.1.2</version> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<!-- websocket--> <!-- websocket-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
<version>2.1.0.RELEASE</version> <version>2.1.0.RELEASE</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.webjars</groupId> <groupId>org.webjars</groupId>
<artifactId>webjars-locator-core</artifactId> <artifactId>webjars-locator-core</artifactId>
<version>0.37</version> <version>0.37</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.webjars</groupId> <groupId>org.webjars</groupId>
<artifactId>sockjs-client</artifactId> <artifactId>sockjs-client</artifactId>
<version>1.0.2</version> <version>1.0.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.webjars</groupId> <groupId>org.webjars</groupId>
<artifactId>stomp-websocket</artifactId> <artifactId>stomp-websocket</artifactId>
<version>2.3.3</version> <version>2.3.3</version>
</dependency> </dependency>
<!-- fin de web sockets --> <!-- fin de web sockets -->
<!-- ibatis --> <!-- ibatis -->
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId> <artifactId>mybatis</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId> <artifactId>mybatis-spring</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<profiles> <plugin>
<profile> <groupId>org.springframework.boot</groupId>
<id>default</id> <artifactId>spring-boot-maven-plugin</artifactId>
<activation> <version>1.2.5.RELEASE</version>
<property> <executions>
<name>default</name> <execution>
</property> <goals>
</activation> <goal>repackage</goal>
<properties> </goals>
<packaging.type>jar</packaging.type> </execution>
</properties> </executions>
<dependencies> </plugin>
<dependency> <plugin>
<groupId>com.nimbusds</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>nimbus-jose-jwt</artifactId> <artifactId>cobertura-maven-plugin</artifactId>
<version>4.16</version> <version>2.7</version>
</dependency> <executions>
<dependency> <execution>
<groupId>org.springframework.boot</groupId> <id>cobertura</id>
<artifactId>spring-boot-starter-undertow</artifactId> <phase>test</phase>
</dependency> <goals>
</dependencies> <goal>cobertura</goal>
<build> </goals>
<plugins> <configuration>
<plugin> <formats>
<groupId>org.apache.maven.plugins</groupId> <format>xml</format>
<artifactId>maven-war-plugin</artifactId> <format>html</format>
<version>3.2.3</version> </formats>
<configuration> </configuration>
<warSourceExcludes>**/jboss-web.xml</warSourceExcludes> </execution>
</configuration> </executions>
</plugin> </plugin>
</plugins> <plugin>
</build> <groupId>org.apache.maven.plugins</groupId>
</profile> <artifactId>maven-surefire-plugin</artifactId>
<profile> <configuration>
<id>weblogic</id> <runOrder>random</runOrder>
<activation> </configuration>
<property> </plugin>
<name>weblogic</name> <plugin>
</property> <groupId>org.jacoco</groupId>
</activation> <artifactId>jacoco-maven-plugin</artifactId>
<properties> <version>${jacoco.version}</version>
<packaging.type>war</packaging.type> <configuration>
</properties> <skip>${maven.test.skip}</skip>
<dependencies> <destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
<dependency> <dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
<groupId>com.nimbusds</groupId> <output>file</output>
<artifactId>nimbus-jose-jwt</artifactId> <append>true</append>
<version>4.16</version> <excludes>
</dependency> <exclude>*MethodAccess</exclude>
<dependency> </excludes>
<groupId>javax.servlet</groupId> </configuration>
<artifactId>javax.servlet-api</artifactId> <executions>
<scope>provided</scope> <execution>
</dependency> <id>jacoco-initialize</id>
<dependency> <goals>
<groupId>org.springframework.boot</groupId> <goal>prepare-agent</goal>
<artifactId>spring-boot-starter-undertow</artifactId> </goals>
<scope>provided</scope> <phase>test-compile</phase>
</dependency> </execution>
<dependency> <execution>
<groupId>javax.servlet</groupId> <id>jacoco-site</id>
<artifactId>javax.servlet-api</artifactId> <phase>verify</phase>
<scope>provided</scope> <goals>
</dependency> <goal>report</goal>
</dependencies> </goals>
<build> </execution>
<plugins> </executions>
<plugin> </plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceExcludes>**/jboss-web.xml</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>nexus</id>
<activation>
<property>
<name>nexus</name>
</property>
</activation>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
</profile>
</profiles> </plugins>
</build>
<profiles>
<profile>
<id>default</id>
<activation>
<property>
<name>default</name>
</property>
</activation>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceExcludes>**/jboss-web.xml</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>weblogic</id>
<activation>
<property>
<name>weblogic</name>
</property>
</activation>
<properties>
<packaging.type>war</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceExcludes>**/jboss-web.xml</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>nexus</id>
<activation>
<property>
<name>nexus</name>
</property>
</activation>
<properties>
<packaging.type>jar</packaging.type>
</properties>
<dependencies>
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.16</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project> </project>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.bytesw.bytebot.controller;
import com.bytesw.bytebot.service.AgentService;
import com.bytesw.bytebot.service.FileManagementService;
import com.bytesw.xdf.config.security.annotation.DummyPermissionEvaluator;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Bean;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* @author Hernán Uriarte Melchor
* @date 14/09/2020.
* <p>
* <p>
* Copyright (c) 2018 Byte, S.A. Todos los derechos reservados.
* <p>
* Este software constituye información confidencial y propietaria de Byte, S.A.
* ("Información Confidencial"). Usted no debe develar dicha Información
* Confidencial y debe usarla de acuerdo con los términos de aceptación de
* licencia de uso que firmó con Byte.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@WebMvcTest(controllers = AgentController.class)
@ActiveProfiles(value = "test")
@AutoConfigureMockMvc(secure = false)
public class AgentControllerTest {
public static String baseService = "/service/agent";
@TestConfiguration
static class UserServiceTestContextConfiguration {
@Bean
DummyPermissionEvaluator dummyPermissionEvaluator() {
return new DummyPermissionEvaluator();
}
}
@Autowired
private MockMvc mvc;
@MockBean
private AgentService agentService;
@MockBean
private FileManagementService fileManagementService;
@Before
public void setUp() {
}
@Test
@WithMockUser(username="admin",roles={"USER","ADMIN"})
public void uploadFile_whenFileXLS_isOK() throws Exception {
MockMultipartFile xlsFile = new MockMultipartFile("file", "my-xls-file.xls", "application/vnd.ms-excel",
"my-xls-file".getBytes());
mvc.perform(MockMvcRequestBuilders.multipart(baseService + "/file-upload")
.file(xlsFile))
.andExpect(status().isOk());
}
@Test
@WithMockUser(username="admin",roles={"USER","ADMIN"})
public void uploadFile_whenFileXLSNotAppropriate_throwException() throws Exception {
MockMultipartFile xlsFile = new MockMultipartFile("file", "my-xls-file.xls", "application/vnd.ms-excel",
"my-xls-file".getBytes());
Mockito.when(fileManagementService.validateAndSaveFile(anyString(), eq(xlsFile) ))
.thenThrow(IOException.class);
mvc.perform(MockMvcRequestBuilders.multipart(baseService + "/file-upload")
.file(xlsFile))
.andExpect(status().isInternalServerError());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!--<import resource="classpath:applicationContext-aop.xml" />-->
<import resource="classpath:applicationContext-scheduler.xml" />
<!-- MyBatis stuff -->
<!--
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:/mybatis-config.xml" />
</bean>
-->
</beans>
spring.autoconfigure.exclude: org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration
server:
servlet.context-path: /tenant-server
port: 9443
ssl:
key-store-type: JKS
key-store: 'classpath:keystore.jks'
key-store-password: changeit
key-alias: tomcat
security:
require-ssl: true
basic:
enabled: false
application:
services:
security: none
api.info:
title: 'byteXDF4Java Service'
description: 'API para el desarrollo de software'
version: '1.0.0'
terms-of-service-url: 'https://es.wikipedia.org/wiki/byteXDF4Java'
license: 'Open source licensing'
license-url: 'https://help.github.com/articles/open-source-licensing/'
spring:
application:
name: tenant-server
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
username: sa
password: sa
minimum-idle: 10
maximum-pool-size: 10
validationQuery: SELECT 1
testWhileIdle: true
hikari.registerMbeans: true
jpa:
properties.hibernate.dialect: org.hibernate.dialect.H2Dialect
show-sql: true
logging.level.root: info
logging.pattern.console: '%d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger.%M - %msg%n'
logging.level.com.bytesw: debug
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-1.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
">
<bean id="threadPoolTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="2" />
<property name="maxPoolSize" value="5" />
<property name="queueCapacity" value="5" />
<property name="waitForTasksToCompleteOnShutdown" value="true" />
<property name="rejectedExecutionHandler">
<bean class="java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy"/>
</property>
</bean>
</beans>
\ No newline at end of file
CREATE TABLE SEQUENCE_TABLE
(SEQ_NAME VARCHAR(50) NOT NULL,
SEQ_COUNT INTEGER DEFAULT 0,
PRIMARY KEY (SEQ_NAME));
INSERT SEQUENCE_TABLE (SEQ_NAME, SEQ_COUNT) VALUES ('USER_SEQ', 0);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment