diff options
author | Shevek <[email protected]> | 2015-01-01 10:44:27 -0800 |
---|---|---|
committer | Shevek <[email protected]> | 2015-01-01 10:44:27 -0800 |
commit | 3e0f34f77c1ea1f9b27b097efaa8bcf3dee19e4b (patch) | |
tree | eee67b9123714cdc54f45b3f4c509e483b60c6d7 /src/test | |
parent | 86f7ce7b960f504f299b0e43ffcd6a179566144a (diff) |
Fix #10 using build-time metadata.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/anarres/cpp/BuildMetadataTest.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/java/org/anarres/cpp/BuildMetadataTest.java b/src/test/java/org/anarres/cpp/BuildMetadataTest.java new file mode 100644 index 0000000..42dc071 --- /dev/null +++ b/src/test/java/org/anarres/cpp/BuildMetadataTest.java @@ -0,0 +1,33 @@ +package org.anarres.cpp; + +import com.google.common.base.Charsets; +import com.google.common.io.Resources; +import java.net.URL; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author shevek + */ +public class BuildMetadataTest { + + private static final Logger LOG = LoggerFactory.getLogger(BuildMetadataTest.class); + + @Test + public void testProperties() throws Exception { + URL url = Resources.getResource("META-INF/jcpp.properties"); + String text = Resources.asCharSource(url, Charsets.ISO_8859_1).read(); + LOG.info("Metadata is " + text); + } + + @Test + public void testMetadata() throws Exception { + BuildMetadata metadata = BuildMetadata.getInstance(); + LOG.info("Version is " + metadata.getVersion()); + LOG.info("BuildDate is " + metadata.getBuildDate()); + LOG.info("ChangeId is " + metadata.getChangeId()); + } + +} |