blob: cd5ddcc1f39e2468a165876cf9bb29b724b013fc [file] [log] [blame]
package org.codehaus.jackson.map.deser;
import org.codehaus.jackson.annotate.*;
import org.codehaus.jackson.map.*;
/**
* Tests for checking that static methods are not recognized as accessors
* for properties
*/
public class TestStatics
extends BaseMapTest
{
static class Bean
{
int _x;
public static void setX(int value) { throw new Error("Should NOT call static method"); }
@JsonProperty("x") public void assignX(int x) { _x = x; }
}
/*
/**********************************************************
/* Test methods
/**********************************************************
*/
public void testSimpleIgnore() throws Exception
{
ObjectMapper m = new ObjectMapper();
// should not care about static setter...
Bean result = m.readValue("{ \"x\":3}", Bean.class);
assertEquals(3, result._x);
}
}