create(oosTestMarshallerProvider, serialTestUnmarshallerProvider),
null
);
final Collection<Object[]> c = new ArrayList<Object[]>();
final MarshallingConfiguration configuration = new MarshallingConfiguration();
for (Pair<TestMarshallerProvider, TestUnmarshallerProvider> pair : marshallerProviderPairs) {
if (pair == null) continue;
// Add this combination
c.add(new Object[] { pair.getA(), pair.getB(), configuration.clone() });
}
configuration.setClassResolver(new AbstractClassResolver() {
protected ClassLoader getClassLoader() {
return SimpleMarshallerTestFactory.class.getClassLoader();
}
public void annotateProxyClass(final Marshaller marshaller, final Class<?> proxyClass) throws IOException {
marshaller.writeObject("Test One");
marshaller.writeObject("Test Two");
}
public void annotateClass(final Marshaller marshaller, final Class<?> clazz) throws IOException {
marshaller.writeObject("Test One");
marshaller.writeObject("Test Two");
}
public Class<?> resolveProxyClass(final Unmarshaller unmarshaller, final String[] interfaces) throws IOException, ClassNotFoundException {
assertEquals(unmarshaller.readObject(String.class), "Test One", "for proxy");
assertEquals(unmarshaller.readObject(String.class), "Test Two", "for proxy");
return super.resolveProxyClass(unmarshaller, interfaces);
}
public Class<?> resolveClass(final Unmarshaller unmarshaller, final String name, final long serialVersionUID) throws IOException, ClassNotFoundException {
assertEquals(unmarshaller.readObject(String.class), "Test One", "for class " + name);
assertEquals(unmarshaller.readObject(String.class), "Test Two", "for class " + name);
return super.resolveClass(unmarshaller, name, serialVersionUID);
}
public String toString() {
return "Test Class Resolver";
}
});
for (Pair<TestMarshallerProvider, TestUnmarshallerProvider> pair : marshallerProviderPairs) {
if (pair == null) continue;
// Add this combination
c.add(new Object[] { pair.getA(), pair.getB(), configuration.clone() });
}
return c.toArray(new Object[c.size()][]);
}