-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More robust default value parsing; add tests for defaultValues
- Loading branch information
Showing
10 changed files
with
131 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration base="com.github.g3force.configurable.ConfigClass4"> | ||
<testStoredDifferent>42</testStoredDifferent> | ||
</configuration> |
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
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
52 changes: 52 additions & 0 deletions
52
src/test/java/com/github/g3force/configurable/ConfigClass4.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 @@ | ||
/* | ||
* ********************************************************* | ||
* Copyright (c) 2009 - 2016, DHBW Mannheim - Tigers Mannheim | ||
* Project: TIGERS - Sumatra | ||
* Date: Mar 14, 2016 | ||
* Author(s): Nicolai Ommer <nicolai.ommer@gmail.com> | ||
* ********************************************************* | ||
*/ | ||
package com.github.g3force.configurable; | ||
|
||
|
||
/** | ||
* @author Nicolai Ommer <nicolai.ommer@gmail.com> | ||
*/ | ||
public class ConfigClass4 | ||
{ | ||
|
||
@Configurable(comment = "Document this field") | ||
static boolean testBoolFalse = false; | ||
|
||
@Configurable(comment = "Document this field") | ||
static boolean testBoolTrue = true; | ||
|
||
@Configurable(comment = "Document this field") | ||
static ETest testEnum = ETest.ONE; | ||
|
||
@Configurable(comment = "Document this field", defValue = "TWO") | ||
static ETest testEnumDefValue = ETest.ONE; | ||
|
||
@Configurable(comment = "Document this field") | ||
static double testDouble = 1; | ||
|
||
@Configurable(comment = "Document this field", defValue = "2") | ||
static double testDoubleWithDefault = 2; | ||
|
||
@Configurable(comment = "Document this field", defValue = "6") | ||
static double testDefaultDifferent = 5; | ||
|
||
@Configurable(comment = "Document this field") | ||
static double testStoredDifferent = 5; | ||
|
||
static | ||
{ | ||
ConfigRegistration.registerClass("read", ConfigClass4.class); | ||
} | ||
|
||
enum ETest | ||
{ | ||
ONE, | ||
TWO | ||
} | ||
} |
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