Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
7c873e1
fix: beanClass null 체크 추가
jungbin97 Aug 11, 2025
2854308
feat: PropertyValues 클래스에 equals, hashCode, toString 메서드 추가
jungbin97 Aug 11, 2025
87b53f7
feat: PropertyValue 클래스에 toString 메서드 추가
jungbin97 Aug 11, 2025
03f9ed1
fix: BeanDefinition 클래스 toString()에 propertyValues 정보 추가
jungbin97 Aug 11, 2025
d4d7fdf
test: BeanFactory 단위 테스트 추가
jungbin97 Aug 11, 2025
795f0e9
test: BeanDefinition 단위 테스트 추가
jungbin97 Aug 11, 2025
c8a674b
fix: PropertyValue 클래스 toString()에서 value를 문자열 포맷 수정
jungbin97 Aug 11, 2025
d03c11f
fix: PropertyValues 클래스 toString() value를 문자열 포맷 수정
jungbin97 Aug 11, 2025
40d6b9c
test: PropertyValues 및 PropertyValue 클래스에 대한 단위 테스트 추가
jungbin97 Aug 11, 2025
897c5f1
fix: beanDefinition에 대한 검증 추가
jungbin97 Aug 11, 2025
81ad0e9
test: DefaultListableBeanFactory에 대한 단위 테스트 추가
jungbin97 Aug 11, 2025
5a530c5
refactor: 패키지 구조를 beans.factory로 변경
jungbin97 Aug 12, 2025
e28388c
test: DefaultSingletonBeanRegistry에 대한 단위 테스트 추가
jungbin97 Aug 13, 2025
f49cb99
test: SimpleInstantiationStrategy에 대한 단위 테스트 추가
jungbin97 Aug 13, 2025
309e908
test: BeanLifecycleIntegrationTest 추가하여 생명주기 콜백 및 의존성 주입 검증
jungbin97 Aug 13, 2025
1bee8af
test: AbstractAutowireCapableBeanFactory의 빈 생성 및 주입 과정 테스트 추가
jungbin97 Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions boa/src/main/java/beans/PropertyValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ public boolean equals(Object obj) {
public int hashCode() {
return Objects.hash(name, value);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("PropertyValue{name='").append(name).append('\'');
sb.append(", value='").append(value).append('\'');
sb.append('}');
return sb.toString();
}
}
23 changes: 23 additions & 0 deletions boa/src/main/java/beans/PropertyValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
* 하나 이상의 PropertyValue 객체를 담는 컨테이너 클래스 입니다.
Expand Down Expand Up @@ -48,4 +49,26 @@ public PropertyValue getPropertyValue(String propertyName) {
public boolean isEmpty() {
return this.propertyValueList.isEmpty();
}

@Override
public boolean equals(Object other) {
if (this == other) return true;
if (other == null || getClass() != other.getClass()) return false;
PropertyValues that = (PropertyValues) other;
return Objects.equals(propertyValueList, that.propertyValueList);
}

@Override
public int hashCode() {
return Objects.hash(propertyValueList);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("PropertyValues{");
sb.append(propertyValueList);
sb.append('}');
return sb.toString();
}
}
4 changes: 4 additions & 0 deletions boa/src/main/java/beans/factory/config/BeanDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public BeanDefinition(Class<?> beanClass) {
}

public BeanDefinition(Class<?> beanClass, PropertyValues propertyValues) {
if (beanClass == null) {
throw new IllegalArgumentException("beanClass cannot be null");
}
this.beanClass = beanClass;
this.propertyValues = propertyValues != null ? propertyValues : new PropertyValues();
}
Expand Down Expand Up @@ -112,6 +115,7 @@ public String toString() {
sb.append(getBeanClassName()).append("]");
sb.append("; scope=").append(scope);
sb.append("; lazyInit=").append(lazyInit);
sb.append("; propertyValues=").append(propertyValues);
sb.append("; initMethodName=").append(initMethodName);
sb.append("; destroyMethodName=").append(destroyMethodName);
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto

@Override
public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) {
if (beanName == null) {
throw new IllegalArgumentException("Bean name must not be null");
}
if (beanName.isEmpty()) {
throw new IllegalArgumentException("Bean name must not be empty");
}
if (beanDefinition == null) {
throw new IllegalArgumentException("BeanDefinition must not be null");
}
beanDefinitionMap.put(beanName, beanDefinition);
}

Expand Down
71 changes: 0 additions & 71 deletions boa/src/test/java/bean/BeanFactoryTest.java

This file was deleted.

Loading