작성
·
396
0
이유가 뭔지 모르겠는데 아래 로그를 봤을때는 생성후 다시 드랍으로 없애고 있던데 이유를 모르겠습니다 ㅠㅠ
어디 부분을 봐야 할까요 ?
20:03:09.370 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class jpabook.jpabook.MemberRepositoryTest]
20:03:09.378 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
20:03:09.392 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
20:03:09.427 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [jpabook.jpabook.MemberRepositoryTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
20:03:09.458 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [jpabook.jpabook.MemberRepositoryTest], using SpringBootContextLoader
20:03:09.469 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [jpabook.jpabook.MemberRepositoryTest]: class path resource [jpabook/jpabook/MemberRepositoryTest-context.xml] does not exist
20:03:09.471 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [jpabook.jpabook.MemberRepositoryTest]: class path resource [jpabook/jpabook/MemberRepositoryTestContext.groovy] does not exist
20:03:09.471 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [jpabook.jpabook.MemberRepositoryTest]: no resource found for suffixes {-context.xml, Context.groovy}.
20:03:09.474 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [jpabook.jpabook.MemberRepositoryTest]: MemberRepositoryTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
20:03:09.563 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.701 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\jpabook\bin\main\jpabook\jpabook\JpabookApplication.class]
20:03:09.707 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration jpabook.jpabook.JpabookApplication for test class jpabook.jpabook.MemberRepositoryTest
20:03:09.856 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [jpabook.jpabook.MemberRepositoryTest]: using defaults.
20:03:09.857 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
20:03:09.884 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@5119fb47, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@7193666c, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@20deea7f, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@3835c46, org.springframework.test.context.support.DirtiesContextTestExecutionListener@1dde4cb2, org.springframework.test.context.transaction.TransactionalTestExecutionListener@7714e963, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@20ce78ec, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@393671df, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@56620197, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@6eda5c9, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@55b7a4e0, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@5f058f00]
20:03:09.887 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.888 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.912 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.912 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.915 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.915 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.916 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.917 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.924 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@359f7cdf testClass = MemberRepositoryTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@1fa268de testClass = MemberRepositoryTest, locations = '{}', classes = '{class jpabook.jpabook.JpabookApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@131276c2, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@51cdd8a, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@2d6eabae, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@59e5ddf], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true]], class annotated with @DirtiesContext [false] with mode [null].
20:03:09.926 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.927 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpabook.MemberRepositoryTest]
20:03:09.993 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true, server.port=-1}
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.17.RELEASE)
2020-10-28 20:03:10.686 INFO 14952 --- [ main] jpabook.jpabook.MemberRepositoryTest : Starting MemberRepositoryTest on DESKTOP-5KG44G6 with PID 14952 (started by bosok in C:\jpabook)
2020-10-28 20:03:10.689 INFO 14952 --- [ main] jpabook.jpabook.MemberRepositoryTest : No active profile set, falling back to default profiles: default
2020-10-28 20:03:12.113 INFO 14952 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-10-28 20:03:12.152 INFO 14952 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 24ms. Found 0 JPA repository interfaces.
2020-10-28 20:03:13.961 INFO 14952 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-10-28 20:03:14.125 INFO 14952 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-10-28 20:03:14.399 INFO 14952 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2020-10-28 20:03:14.871 INFO 14952 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.18.Final}
2020-10-28 20:03:14.876 INFO 14952 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2020-10-28 20:03:15.092 INFO 14952 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2020-10-28 20:03:15.988 INFO 14952 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2020-10-28 20:03:17.033 DEBUG 14952 --- [ main] org.hibernate.SQL : drop table member if exists
2020-10-28 20:03:17.037 DEBUG 14952 --- [ main] org.hibernate.SQL : drop sequence if exists hibernate_sequence
2020-10-28 20:03:17.041 DEBUG 14952 --- [ main] org.hibernate.SQL : create sequence hibernate_sequence start with 1 increment by 1
2020-10-28 20:03:17.044 DEBUG 14952 --- [ main] org.hibernate.SQL : create table member (id bigint not null, username varchar(255), primary key (id))
2020-10-28 20:03:17.047 INFO 14952 --- [ main] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@3e900e1a'
2020-10-28 20:03:17.051 INFO 14952 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-10-28 20:03:18.331 INFO 14952 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-10-28 20:03:18.454 WARN 14952 --- [ main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2020-10-28 20:03:18.550 INFO 14952 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2020-10-28 20:03:19.434 INFO 14952 --- [ main] jpabook.jpabook.MemberRepositoryTest : Started MemberRepositoryTest in 9.369 seconds (JVM running for 10.797)
2020-10-28 20:03:19.795 INFO 14952 --- [ main] o.s.t.c.transaction.TransactionContext : Began transaction (1) for test context [DefaultTestContext@359f7cdf testClass = MemberRepositoryTest, testInstance = jpabook.jpabook.MemberRepositoryTest@267891bf, testMethod = testMember@MemberRepositoryTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@1fa268de testClass = MemberRepositoryTest, locations = '{}', classes = '{class jpabook.jpabook.JpabookApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@131276c2, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@51cdd8a, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@2d6eabae, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@59e5ddf], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@1c3b6963]; rollback [false]
2020-10-28 20:03:20.415 DEBUG 14952 --- [ main] org.hibernate.SQL : call next value for hibernate_sequence
2020-10-28 20:03:20.621 DEBUG 14952 --- [ main] org.hibernate.SQL : insert into member (username, id) values (?, ?)
2020-10-28 20:03:20.635 INFO 14952 --- [ main] o.s.t.c.transaction.TransactionContext : Committed transaction for test: [DefaultTestContext@359f7cdf testClass = MemberRepositoryTest, testInstance = jpabook.jpabook.MemberRepositoryTest@267891bf, testMethod = testMember@MemberRepositoryTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@1fa268de testClass = MemberRepositoryTest, locations = '{}', classes = '{class jpabook.jpabook.JpabookApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@131276c2, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@51cdd8a, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@2d6eabae, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@59e5ddf], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]
2020-10-28 20:03:20.692 INFO 14952 --- [ Thread-2] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2020-10-28 20:03:20.721 INFO 14952 --- [ Thread-2] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-10-28 20:03:20.721 INFO 14952 --- [ Thread-2] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'
2020-10-28 20:03:20.722 DEBUG 14952 --- [ Thread-2] org.hibernate.SQL : drop table member if exists
2020-10-28 20:03:20.727 DEBUG 14952 --- [ Thread-2] org.hibernate.SQL : drop sequence if exists hibernate_sequence
2020-10-28 20:03:20.733 INFO 14952 --- [ Thread-2] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-10-28 20:03:20.773 INFO 14952 --- [ Thread-2] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
답변 7
2
2
8번 라인부터 잘못되었습니다^^! 띄어쓰기를 잘 보고 확인해주세요.
jpa(2칸)
hibernate(4칸)
...
spring:
datasource:
url: jdbc:h2:tcp://localhost/~/jpashop
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
hibernate:
ddl-auto: create
properties:
hibernate:
generate_statistics: true
#show_sql: true
format_sql: true
logging:
level:
# org.hibernate: debug
org.hibernate.stat: debug
org.hibernate.SQL: debug
# org.hibernate.type: trace
0
감사합니다 .
저 부분 때문에 그런건 맞았습니다 ㅠㅠ !
근대 테이블은 제대로 생성이 되었는데 insert는 안되고 있는데 이건 어느 부분 때문에 그런지 알수 있을까요 늦은 시간에 계속 물어보게 되어서 죄송합니다 ㅠㅠ
2020-10-29 01:02:13.237 DEBUG 3576 --- [ main] org.hibernate.SQL :
insert
into
member
(username, id)
values
(?, ?)
2020-10-29 01:02:13.249 INFO 3576 --- [ main] i.StatisticalLoggingSessionEventListener : Session Metrics {
652100 nanoseconds spent acquiring 1 JDBC connections;
0 nanoseconds spent releasing 0 JDBC connections;
7316900 nanoseconds spent preparing 2 JDBC statements;
12227300 nanoseconds spent executing 2 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
0 nanoseconds spent performing 0 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
36391700 nanoseconds spent executing 1 flushes (flushing a total of 1 entities and 0 collections);
0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
}
2020-10-29 01:02:13.255 INFO 3576 --- [ main] o.s.t.c.transaction.TransactionContext : Committed transaction for test: [DefaultTestContext@4466af20 testClass = MemberRepositoryTest, testInstance = jpabook.jpabook.MemberRepositoryTest@4bcdd11, testMethod = testMember@MemberRepositoryTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@a514af7 testClass = MemberRepositoryTest, locations = '{}', classes = '{class jpabook.jpabook.JpabookApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@711f39f9, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@2d6eabae, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@10bbd20a, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@1f57539], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]
2020-10-29 01:02:13.278 INFO 3576 --- [ Thread-3] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2020-10-29 01:02:13.283 INFO 3576 --- [ Thread-3] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-10-29 01:02:13.302 INFO 3576 --- [ Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-10-29 01:02:13.365 INFO 3576 --- [ Thread-3] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
0
0
0
김영한 선생님 확인을 해봤는데 test/resources/application.yml 가 따로 없습니다
test/resources 자체가 없는데 혹시 이부분 자체가 문제일까요 ?
0
안녕하세요. 보현님
테스트를 실행할 때는 test/resources/application.yml 파일을 참고합니다.
여기에 별다른 설정이 없다면, 메모리 DB를 만들고, 거기에 테이블을 생성하고, 마지막에 삭제하는게 기본 옵션입니다.
test/resources/application.yml 파일을 지우면 src/resources/application.yml 파일을 참고합니다.
감사합니다.