示例#1
0
    @Issue("JENKINS-9367")
    @Test public void persistence() throws Exception {
        ListView view = listView("foo");

        ListView v = (ListView) Jenkins.XSTREAM.fromXML(Jenkins.XSTREAM.toXML(view));
        System.out.println(v.getProperties());
        assertNotNull(v.getProperties());
    }
示例#2
0
 public static View createViewFromXML(String name, InputStream xml) throws IOException {
   InputStream in = new BufferedInputStream(xml);
   try {
     View v = (View) Jenkins.XSTREAM.fromXML(in);
     v.name = name;
     return v;
   } catch (StreamException e) {
     throw new IOException2("Unable to read", e);
   } catch (ConversionException e) {
     throw new IOException2("Unable to read", e);
   } catch (Error e) { // mostly reflection errors
     throw new IOException2("Unable to read", e);
   } finally {
     in.close();
   }
 }