BeanPointerFactoryEx extends BeanPointerFactory { @Override public NodePointer createNodePointer( QName name, Object bean, Locale locale) { JXPathBeanInfo bi = JXPathIntrospector.getBeanInfo(bean.getClass()); return new BeanPointerEx(name, bean, bi, locale); }  @Override int getOrder(); @Override NodePointer createNodePointer(
        QName name, Object bean, Locale locale); @Override NodePointer createNodePointer(
        NodePointer parent, QName name, Object bean); static final int BEAN_POINTER_FACTORY_EX_ORDER; }
@Test public void testCreateNodePointerQname01() throws Exception { BeanPointerFactoryEx factory = new BeanPointerFactoryEx(); QName qName = new QName("name"); Object bean = new Object(); Locale locale = new Locale("ja"); NodePointer result = factory.createNodePointer(qName, bean, locale); assertSame(BeanPointerEx.class, result.getClass()); assertSame(locale, result.getLocale()); assertSame(qName, result.getName()); assertSame(bean, ReflectionTestUtils.getField(result, "bean")); }
@Test public void testCreateNodePointerNodePointer01() throws Exception { BeanPointerFactoryEx factory = new BeanPointerFactoryEx(); QName qName = new QName("name"); Locale locale = new Locale("ja"); NodePointer nodePointer = NodePointer.newNodePointer(qName, null, locale); NodePointer result = factory.createNodePointer(nodePointer, qName, null); assertSame(NullPointer.class, result.getClass()); assertSame(nodePointer, result.getParent()); assertSame(qName, result.getName()); }
@Test public void testCreateNodePointerNodePointer02() throws Exception { BeanPointerFactoryEx factory = new BeanPointerFactoryEx(); QName qName = new QName("name"); Object bean = new Object(); Locale locale = new Locale("ja"); NodePointer nodePointer = NodePointer.newNodePointer(qName, bean, locale); NodePointer result = factory.createNodePointer(nodePointer, qName, bean); assertSame(BeanPointerEx.class, result.getClass()); assertSame(nodePointer, result.getParent()); assertSame(qName, result.getName()); assertSame(bean, ReflectionTestUtils.getField(result, "bean")); }