none: add some test case, but ignored

pull/499/head
johnniang 2019-12-26 15:11:53 +08:00
parent 11c32ffdca
commit dc166d0b4a
4 changed files with 30 additions and 8 deletions

View File

@ -14,10 +14,10 @@ spring:
type: com.zaxxer.hikari.HikariDataSource
# H2 Database 配置
driver-class-name: org.h2.Driver
url: jdbc:h2:file:~/halo-test/db/halo
username: admin
password: 123456
# driver-class-name: org.h2.Driver
# url: jdbc:h2:file:~/halo-test/db/halo
# username: admin
# password: 123456
# MySQL 配置
# driver-class-name: com.mysql.cj.jdbc.Driver
@ -33,10 +33,12 @@ spring:
enabled: true
jpa:
hibernate:
ddl-auto: update
ddl-auto: create-drop
show-sql: true
flyway:
enabled: false
locations: classpath:/migration
baseline-on-migrate: true
baseline-version: 1
servlet:
multipart:
max-file-size: 10MB
@ -48,7 +50,7 @@ management:
web:
base-path: /api/admin/actuator
exposure:
include: ['httptrace', 'metrics','env','logfile','health']
include: ['httptrace', 'metrics','env','logfile']
logging:
level:
run.halo.app: DEBUG

View File

@ -5,6 +5,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.convert.ConversionService;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import static org.hamcrest.Matchers.equalTo;
@ -17,6 +18,7 @@ import static org.junit.Assert.assertThat;
*/
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("test")
public class AttachmentTypeTest {
@Autowired

View File

@ -2,11 +2,12 @@ package run.halo.app.utils;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import run.halo.app.model.support.HaloConst;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -92,4 +93,19 @@ public class FileUtilsTest {
public void tempFolderTest() {
log.debug(HaloConst.TEMP_DIR);
}
@Test
@Ignore
public void dbFileReadTest() throws IOException {
Path dbPath = Paths.get(HaloConst.USER_HOME + "/halo-test/db/halo.mv.db");
try (RandomAccessFile randomAccessFile = new RandomAccessFile(dbPath.toString(), "r")) {
randomAccessFile.seek(2283640);
byte[] buffer = new byte[1024];
int count = randomAccessFile.read(buffer, 0, buffer.length);
System.out.println("Count: " + count);
String bufString = new String(buffer);
System.out.println("Buffer String: " + bufString);
}
}
}

View File

@ -1,5 +1,6 @@
package run.halo.app.utils;
import org.junit.Ignore;
import org.junit.Test;
import java.nio.file.Path;
@ -18,6 +19,7 @@ import static org.junit.Assert.assertTrue;
public class PathsTest {
@Test
@Ignore
public void getTest() {
Path path = Paths.get("/home/test/", "/upload/test.txt");
assertThat(path.toString(), equalTo("/home/test/upload/test.txt"));