-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to get the value of a resource
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 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
22 changes: 22 additions & 0 deletions
22
resourcespoet/src/test/java/com/commit451/resourcespoet/ValueTest.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,22 @@ | ||
package com.commit451.resourcespoet; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.io.File; | ||
import java.util.ArrayList; | ||
|
||
/** | ||
* Tests reading a value | ||
*/ | ||
public class ValueTest { | ||
|
||
@Test | ||
public void valueTest() throws Exception { | ||
ClassLoader classLoader = getClass().getClassLoader(); | ||
File file = new File(classLoader.getResource("bool.xml").getFile()); | ||
ResourcesPoet poet = ResourcesPoet.create(file); | ||
String value = poet.value(Type.BOOL, "is_cool"); | ||
Assert.assertEquals("true", value); | ||
} | ||
} |