Skip to content

Commit

Permalink
发布1.3.1版本
Browse files Browse the repository at this point in the history
  • Loading branch information
blinkfox committed May 2, 2018
1 parent 89252b6 commit a7a4e31
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 15 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,9 @@ Zealot类库遵守[Apache License 2.0][6] 许可证

## 十二、版本更新记录

- v1.3.1(2018-05-03)
- 修复了扫描xml路径始终为zealot的问题
- 修改了阿里规约插件检查出的一些代码坏味道问题
- v1.3.0(2018-05-02)
- 新增完善各种动态SQL操作符和XML标签的``````的逻辑
- 新增了根据自定义模式构建模糊匹配的likePattern标签,新增了isNull、isNotNull等情况
Expand Down
3 changes: 3 additions & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- v1.3.1(2018-05-03)
- 修复了扫描xml路径始终为zealot的问题
- 修改了阿里规约插件检查出的一些代码坏味道问题
- v1.3.0(2018-05-02)
- 新增完善各种动态SQL操作符和XML标签的``````的逻辑
- 新增了根据自定义模式构建模糊匹配的likePattern标签,新增了isNull、isNotNull等情况
Expand Down
4 changes: 2 additions & 2 deletions docs/start-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<dependency>
<groupId>com.blinkfox</groupId>
<artifactId>zealot</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
</dependency>
```

### Gradle

```bash
compile 'com.blinkfox:zealot:1.3.0'
compile 'com.blinkfox:zealot:1.3.1'
```
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.blinkfox</groupId>
<artifactId>zealot</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<packaging>jar</packaging>

<name>zealot</name>
Expand Down
21 changes: 18 additions & 3 deletions src/main/java/com/blinkfox/zealot/config/ZealotConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ public static ZealotConfigManager getInstance() {
return confManager;
}

/**
* 获取配置的zealot的XML文件所在的位置字符串.
* @return xmlLocations
*/
public String getXmlLocations() {
return xmlLocations;
}

/**
* 获取配置的zealot的自定义handler处理器所在的位置字符串.
* @return handlerLocations
*/
public String getHandlerLocations() {
return handlerLocations;
}

/**
* 初始化加载Zealot的配置信息到缓存中.
*
Expand Down Expand Up @@ -137,9 +153,8 @@ private void scanLocations(String xmlLocations, String handlerLocations) {
* @return ZealotConfigManager的全局唯一实例
*/
public ZealotConfigManager initLoadXmlLocations(String xmlLocations) {
this.xmlLocations = xmlLocations;
this.xmlLocations = StringHelper.isBlank(this.xmlLocations) ? "zealot" : this.xmlLocations;
XmlScanner.newInstance().scan(xmlLocations);
this.xmlLocations = StringHelper.isBlank(xmlLocations) ? "zealot" : xmlLocations;
XmlScanner.newInstance().scan(this.xmlLocations);
this.cachingXmlAndEval();
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@
*/
public class ZealotConfigManagerTest {

private static final String XML_LOCATIONS = "zealot";

private static final String HANDLER_LOCATIONS = "com.blinkfox.zealot.test.handler";

/**
* 测试扫描和配置xml文件.
*/
@Test
public void initLoadXmlLocations() {
ZealotConfigManager.getInstance().initLoadXmlLocations("zealot");
public void initLoadLocations() {
ZealotConfigManager zealotConfigManager = ZealotConfigManager.getInstance()
.initLoadXmlLocations(XML_LOCATIONS)
.initLoadHandlerLocations(HANDLER_LOCATIONS);

Assert.assertEquals(XML_LOCATIONS, zealotConfigManager.getXmlLocations());
Assert.assertEquals(HANDLER_LOCATIONS, zealotConfigManager.getHandlerLocations());

Map<String, String> xmlMaps = XmlContext.INSTANCE.getXmlPathMap();
Assert.assertTrue(xmlMaps.size() >= 2);
}

/**
* 测试扫描和配置handler文件.
*/
@Test
public void initLoadHandlerLocations() {
ZealotConfigManager.getInstance().initLoadHandlerLocations("com.blinkfox.zealot.test.handler");
Map<String, TagHandler> tagHandlerMap = AbstractZealotConfig.getTagHandlerMap();
Assert.assertTrue(tagHandlerMap.size() >= 46);
}
Expand Down

0 comments on commit a7a4e31

Please sign in to comment.