Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-bel-apica committed Sep 4, 2020
1 parent e7b637d commit 46309fa
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import org.junit.Ignore;

@Ignore
public class CaseInsensitiveDeser273Test extends XmlTestBase
{
// [dataformat-xml#273]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.junit.Ignore;

@Ignore
public class ConflictingGetters27Test extends XmlTestBase
{
@JacksonXmlRootElement(localName = "output")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import org.junit.Ignore;

@Ignore
public class Deserialization25Test extends XmlTestBase
{
private static class EmptyStrings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import org.junit.Ignore;

@Ignore
public class EmptyBeanDeser318Test extends XmlTestBase
{
static class Wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.dataformat.xml.*;
import org.junit.Ignore;

// for [dataformat-xml#124]
@Ignore
public class EmptyListDeser124Test extends XmlTestBase
{
public static class TestList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import org.junit.Ignore;

// related to [dataformat-xml#9] (and possibly others)
@Ignore
public class EnumIssue9Test extends XmlTestBase
{
static enum TestEnum { A, B, C; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import org.junit.Ignore;

@Ignore
public class FailingDelegatingCreator254Test extends XmlTestBase
{
static class Foo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import com.fasterxml.jackson.dataformat.xml.*;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.junit.Ignore;

// for [dataformat-xml#326]
@Ignore
public class FailingNamespace326Test extends XmlTestBase
{
@JacksonXmlRootElement(localName = "new")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.dataformat.xml.*;
import com.fasterxml.jackson.dataformat.xml.jaxb.XmlJaxbAnnotationIntrospector;
import org.junit.Ignore;

@Ignore
public class Issue37AdapterTest extends XmlTestBase
{
@XmlJavaTypeAdapter(URLEncoderMapDataAdapter.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import org.junit.Ignore;

// [dataformat-xml#314]
@Ignore
public class ListDeser314Test extends XmlTestBase
{
static class Customer314 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import org.junit.Ignore;

@Ignore
public class ListDeser319Test extends XmlTestBase
{
static class Value319 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import org.junit.Ignore;

@Ignore
public class MixedContentTreeRead226Test extends XmlTestBase
{
public void testMixed226() throws Exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import org.junit.Ignore;

// for:
//
// [dataformat-xml#4]
// [dataformat-xml#9] (enums)

@Ignore
public class PolymorphicIssue4Test extends XmlTestBase
{
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/**
* @author pgelinas
*/
@Ignore
public class PolymorphicList97Test extends XmlTestBase
{
@JsonTypeInfo(property = "type", use = Id.NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.junit.Ignore;

@Ignore
public class TestUntypedListSerialization extends XmlTestBase
{
@JacksonXmlRootElement(localName="L")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.xml.*;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import org.junit.Ignore;

@Ignore
public class Unwrapped374Test extends XmlTestBase
{
@JacksonXmlRootElement(localName = "Root")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public String next() {
item--;
return Integer.toString(item);
}

public void remove() {
throw new UnsupportedOperationException("remove");
}
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

public class TextValueTest extends XmlTestBase
{

private static final String EOL = System.lineSeparator();

static class Simple
{
@JacksonXmlProperty(isAttribute=true)
Expand Down Expand Up @@ -103,7 +106,7 @@ public void testSerializeAsText() throws IOException
assertEquals("<Simple a=\"13\">something</Simple>", xml);
// [dataformat-xml#56]: should work with indentation as well
xml = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(new Simple());
assertEquals("<Simple a=\"13\">something</Simple>\n", xml);
assertEquals("<Simple a=\"13\">something</Simple>" + EOL, xml);
}

public void testDeserializeAsText() throws IOException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

public class TestIndentation extends XmlTestBase
{
private static final String EOL = System.lineSeparator();

static class StringWrapperBean {
public StringWrapper string;

Expand Down Expand Up @@ -153,16 +155,16 @@ public void testSimpleMap() throws Exception
public void testWithAttr() throws Exception
{
String xml = _xmlMapper.writeValueAsString(new AttrBean());
assertEquals("<AttrBean count=\"3\"/>\n", xml);
assertEquals("<AttrBean count=\"3\"/>" + EOL, xml);
String xml2 = _xmlMapper.writeValueAsString(new AttrBean2());
assertEquals("<AttrBean2 count=\"3\">\n <value>14</value>\n</AttrBean2>\n", xml2);
assertEquals("<AttrBean2 count=\"3\">" + EOL + " <value>14</value>" + EOL + "</AttrBean2>" + EOL, xml2);
}

public void testEmptyElem() throws Exception
{
PojoFor123 simple = new PojoFor123("foobar");
String xml = _xmlMapper.writeValueAsString(simple);
assertEquals("<PojoFor123 name=\"foobar\"/>\n", xml);
assertEquals("<PojoFor123 name=\"foobar\"/>" + EOL, xml);
}

public void testMultiLevel172() throws Exception
Expand All @@ -175,15 +177,15 @@ public void testMultiLevel172() throws Exception
// unify possible apostrophes to quotes
xml = aposToQuotes(xml);
// with indentation, should get linefeeds in prolog/epilog too
assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<Company>\n"
+" <e>\n"
+" <employee>\n"
+" <id>abc</id>\n"
+" <type>FULL_TIME</type>\n"
+" </employee>\n"
+" </e>\n"
+"</Company>\n",
assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + EOL
+"<Company>" + EOL
+" <e>" + EOL
+" <employee>" + EOL
+" <id>abc</id>" + EOL
+" <type>FULL_TIME</type>" + EOL
+" </employee>" + EOL
+" </e>" + EOL
+"</Company>" + EOL,
xml);
}
}

0 comments on commit 46309fa

Please sign in to comment.