null,
new MediaType("application", "atomsvc+xml")));
}
public void testJAXBCollectionXMLProviderIsWritableCollection() throws Exception {
JAXBCollectionXmlProvider provider = new JAXBCollectionXmlProvider();
GenericEntity<List<AtomFeed>> type1 =
new GenericEntity<List<AtomFeed>>(new ArrayList<AtomFeed>()) {
};
assertTrue(provider.isWriteable(type1.getRawType(),
type1.getType(),
null,
new MediaType("text", "xml")));
assertTrue(provider.isWriteable(type1.getRawType(),
type1.getType(),
null,
new MediaType("application", "xml")));
assertTrue(provider.isWriteable(type1.getRawType(),
type1.getType(),
null,
new MediaType("application", "atom+xml")));
assertTrue(provider.isWriteable(type1.getRawType(),
type1.getType(),
null,
new MediaType("application", "atomsvc+xml")));
GenericEntity<List<JAXBElement<AtomFeed>>> type2 =
new GenericEntity<List<JAXBElement<AtomFeed>>>(new ArrayList<JAXBElement<AtomFeed>>()) {
};
assertTrue(provider.isWriteable(type2.getRawType(),
type2.getType(),
null,
new MediaType("text", "xml")));
assertTrue(provider.isWriteable(type2.getRawType(),
type2.getType(),
null,
new MediaType("application", "xml")));
assertTrue(provider.isWriteable(type2.getRawType(),
type2.getType(),
null,
new MediaType("application", "atom+xml")));
assertTrue(provider.isWriteable(type2.getRawType(),
type2.getType(),
null,
new MediaType("application", "atomsvc+xml")));
GenericEntity<List<String>> type3 =
new GenericEntity<List<String>>(new ArrayList<String>()) {
};
assertFalse(provider.isWriteable(type3.getRawType(),
type3.getType(),
null,
new MediaType("text", "xml")));
assertFalse(provider.isWriteable(type3.getRawType(),
type3.getType(),
null,
new MediaType("application", "xml")));
assertFalse(provider.isWriteable(type3.getRawType(),
type3.getType(),
null,
new MediaType("application", "atom+xml")));
assertFalse(provider.isWriteable(type3.getRawType(),
type3.getType(),
null,
new MediaType("application", "atomsvc+xml")));
}