value = StringHelper.substringInBetween("archive/sub3/subb/doc1.doc", null, "/");
Assert.assertTrue(value.equals("archive"));
}
public void testJava2XmlJson() {
XSerializer serializer = new XSerializer(new XSerializerXmlAdapter());
serializer.setFlattenCollection(true);
serializer.setOmitNull(true);
Foo foo = new Foo("dummyName", "dummyValue");
foo.sub = new SubFoo("subName", "subValue");
foo.subs.add(new SubFoo("Sub1", "Sub1-value"));
foo.subs.add(new SubFoo("Sub2", "Sub2-value"));
foo.subArray = new SubFoo[3];
foo.subArray[0] = new SubFoo("Array-sub1", "Sub1-value");
foo.subArray[1] = new SubFoo("Array-sub2", "Sub1-value");
foo.subArray[2] = new SubFoo("Array-sub3", "Sub1-value");
String output = serializer.serializeTo(foo, "Foo", "http://www.cloud.com/S3", 0);
logger.info(output);
serializer = new XSerializer(new XSerializerJsonAdapter());
output = serializer.serializeTo(foo, "Foo", "http://www.cloud.com/S3", 0);
logger.info(output);
}