* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tt.done();
}
sbw.append('\n');
-
+
tt = trans.start("To XML from Cache",4);
try {
data.out(Data.TYPE.XML).to(sbw);
} finally {
tt.done();
}
-
+
sbw.append('\n');
-
+
tt = trans.start("To JSON from Cache",5);
try {
data.out(Data.TYPE.JSON).to(sbw);
}
report.glean(trans, 1,2,3,4,5);
} while (report.go());
-
+
report.report(sbw);
System.out.println(sbw);
-
+
}
@Test
data.direct(new StringReader(JU_FromJSON.str), sbw);
report.glean(trans);
} while (report.go());
-
+
report.report(sbw);
System.out.println(sbw);
-
+
}
-
+
@Test
public void testMulti() throws Exception {
RosettaEnv env = new RosettaEnv();
Multi m = new Multi();
m.getF1().add("String1");
m.getF2().add("String2");
-
+
System.out.println(df.newData().load(m).out(TYPE.RAW).asString());
System.out.println(df.newData().load(m).out(TYPE.JSON).asString());
-
+
}
@Test
Assert.assertEquals(
"{\"id\":\"\\\"AT&T Services, Inc.\\\"\",\"date\":0}",
out);
-
+
SampleData sd2 = df.newData().in(TYPE.JSON).load(out).asObject();
System.out.println(sd2.getId());
Assert.assertEquals(sd.getId(),sd2.getId());