示例#1
0
文件: LoadTests.java 项目: qxo/jyaml
 public void testLargeDocument() throws Exception {
   File f = new File("yml/testLargeDocument.yml");
   Map m = new HashMap();
   List largeList = new ArrayList();
   for (int i = 0; i < 100000; i++) largeList.add(i);
   m.put("large list", largeList);
   Yaml.dump(m, f);
   Map result = (Map) Yaml.load(f);
   assertEquals(100000, ((List) m.get("large list")).size());
 }
示例#2
0
 /** {@inheritDoc} */
 protected void save() throws DelegateException {
   //        FileOutputStream fout = null;
   try {
     Yaml.dump(folderExt, getFile(), true);
     //            fout = new FileOutputStream(getFile());
     //            yamlConfig.dump(folderExt, fout);
   } catch (IOException ioe) {
     throw new DelegateException("Error saving metadata", ioe);
   }
   //        finally {
   //            if (fout != null) {
   //                try {
   //                    fout.close();
   //                }
   //                catch (IOException ioe) {}
   //            }
   //        }
 }