-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from youngmonkeys/dev
version 1.2.1
- Loading branch information
Showing
68 changed files
with
1,714 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
ezyfox-bean/src/main/java/com/tvd12/ezyfox/bean/EzyPackagesToScanProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.tvd12.ezyfox.bean; | ||
|
||
import java.util.Set; | ||
|
||
public interface EzyPackagesToScanProvider { | ||
|
||
Set<String> provide(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/testing/EzySimpleBeanContextBuilderTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.tvd12.ezyfox.bean.testing; | ||
|
||
import java.util.Properties; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import com.tvd12.ezyfox.bean.EzyBeanContext; | ||
import com.tvd12.ezyfox.bean.EzyBeanContextBuilder; | ||
import com.tvd12.test.assertion.Asserts; | ||
import com.tvd12.test.reflect.FieldUtil; | ||
import com.tvd12.test.reflect.MethodUtil; | ||
|
||
public class EzySimpleBeanContextBuilderTest { | ||
|
||
@Test | ||
public void activeProfilesTest() { | ||
// given | ||
String activeProfiles = "foo,bar"; | ||
|
||
EzyBeanContextBuilder sut = EzyBeanContext.builder() | ||
.scan((String)null) | ||
.addProperty(EzyBeanContext.ACTIVE_PROFILES_KEY, "hello,big,world") | ||
.activeProfiles(activeProfiles); | ||
|
||
// when | ||
String actual = MethodUtil.invokeMethod("getActiveProfiles", sut); | ||
|
||
// then | ||
Asserts.assertEquals("hello,big,world,bar,foo", actual); | ||
} | ||
|
||
@Test | ||
public void activeProfilesDefaultNullTest() { | ||
// given | ||
String activeProfiles = "foo,bar"; | ||
|
||
EzyBeanContextBuilder sut = EzyBeanContext.builder() | ||
.activeProfiles(null) | ||
.scan((String)null); | ||
|
||
Properties properties = FieldUtil.getFieldValue(sut, "properties"); | ||
properties.clear(); | ||
|
||
sut.activeProfiles(activeProfiles); | ||
|
||
// when | ||
String actual = MethodUtil.invokeMethod("getActiveProfiles", sut); | ||
|
||
// then | ||
Asserts.assertEquals("bar,foo", actual); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/v120/testing/packet01/PackagesProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.tvd12.ezyfox.bean.v120.testing.packet01; | ||
|
||
import java.util.Collections; | ||
import java.util.Set; | ||
|
||
import com.tvd12.ezyfox.bean.EzyPackagesToScanProvider; | ||
|
||
public class PackagesProvider implements EzyPackagesToScanProvider { | ||
|
||
@Override | ||
public Set<String> provide() { | ||
return Collections.singleton("com.tvd12.ezyfox.bean.v120.testing.packet01"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.