mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-31 18:01:42 +00:00
Testing yaml annotations
This commit is contained in:
parent
3ec0dbd404
commit
fba4dd2d9a
19 changed files with 1690 additions and 7 deletions
37
Essentials/test/com/earth2me/essentials/YamlTest.java
Normal file
37
Essentials/test/com/earth2me/essentials/YamlTest.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
package com.earth2me.essentials;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.nodes.Tag;
|
||||
import com.earth2me.essentials.yaml.Settings;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.yaml.snakeyaml.constructor.Constructor;
|
||||
|
||||
|
||||
public class YamlTest extends TestCase
|
||||
{
|
||||
public YamlTest()
|
||||
{
|
||||
}
|
||||
|
||||
public void testYaml()
|
||||
{
|
||||
final DumperOptions options = new DumperOptions();
|
||||
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
options.setExplicitRoot(Tag.MAP);
|
||||
final Yaml yaml = new Yaml(options);
|
||||
//Settings settings = (Settings)yaml.load("");
|
||||
Settings set1 = new Settings();
|
||||
final String dump = yaml.dump(set1);
|
||||
final Yaml yaml2 = new Yaml(new Constructor(Settings.class));
|
||||
final Settings set = (Settings)yaml2.load(dump);
|
||||
if (set != null)
|
||||
{
|
||||
//assert set.getGeneral().getLocation() == null;
|
||||
//assert set.equals(new Settings());
|
||||
System.out.println(dump);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue