@Test public void testGetDocumentSupport() { XmlDocumentInfo documentInfo = mock( XmlDocumentInfo.class ); doReturn( null ).when( documentInfo ).getRootElementNameSpace(); doReturn( "test_elem" ).when( documentInfo ).getRootElement(); int result = module.getDocumentSupport( documentInfo ); assertThat( result, is( equalTo( XmlFactoryModule.NOT_RECOGNIZED ) ) ); doReturn( "test_namespace" ).when( documentInfo ).getRootElementNameSpace(); result = module.getDocumentSupport( documentInfo ); assertThat( result, is( equalTo( XmlFactoryModule.NOT_RECOGNIZED ) ) ); doReturn( ScriptableDataFactoryModule.NAMESPACE ).when( documentInfo ).getRootElementNameSpace(); result = module.getDocumentSupport( documentInfo ); assertThat( result, is( equalTo( XmlFactoryModule.NOT_RECOGNIZED ) ) ); doReturn( ScriptableDataFactoryModule.NAMESPACE ).when( documentInfo ).getRootElementNameSpace(); doReturn( "scriptable-datasource" ).when( documentInfo ).getRootElement(); result = module.getDocumentSupport( documentInfo ); assertThat( result, is( equalTo( XmlFactoryModule.RECOGNIZED_BY_NAMESPACE ) ) ); doReturn( null ).when( documentInfo ).getRootElementNameSpace(); doReturn( "scriptable-datasource" ).when( documentInfo ).getRootElement(); result = module.getDocumentSupport( documentInfo ); assertThat( result, is( equalTo( XmlFactoryModule.RECOGNIZED_BY_TAGNAME ) ) ); }
public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( ScriptableDataFactoryModule.NAMESPACE.equals( rootNamespace ) == false ) { return NOT_RECOGNIZED; } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_NAMESPACE; } } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_TAGNAME; } return NOT_RECOGNIZED; }
ScriptableDataSourceXmlFactoryModule implements XmlFactoryModule { public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( ScriptableDataFactoryModule.NAMESPACE.equals( rootNamespace ) == false ) { return NOT_RECOGNIZED; } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_NAMESPACE; } } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_TAGNAME; } return NOT_RECOGNIZED; } }
ScriptableDataSourceXmlFactoryModule implements XmlFactoryModule { public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( ScriptableDataFactoryModule.NAMESPACE.equals( rootNamespace ) == false ) { return NOT_RECOGNIZED; } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_NAMESPACE; } } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_TAGNAME; } return NOT_RECOGNIZED; } ScriptableDataSourceXmlFactoryModule(); }
ScriptableDataSourceXmlFactoryModule implements XmlFactoryModule { public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( ScriptableDataFactoryModule.NAMESPACE.equals( rootNamespace ) == false ) { return NOT_RECOGNIZED; } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_NAMESPACE; } } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_TAGNAME; } return NOT_RECOGNIZED; } ScriptableDataSourceXmlFactoryModule(); int getDocumentSupport( final XmlDocumentInfo documentInfo ); String getDefaultNamespace( final XmlDocumentInfo documentInfo ); XmlReadHandler createReadHandler( final XmlDocumentInfo documentInfo ); }
ScriptableDataSourceXmlFactoryModule implements XmlFactoryModule { public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( ScriptableDataFactoryModule.NAMESPACE.equals( rootNamespace ) == false ) { return NOT_RECOGNIZED; } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_NAMESPACE; } } else if ( "scriptable-datasource".equals( documentInfo.getRootElement() ) ) { return RECOGNIZED_BY_TAGNAME; } return NOT_RECOGNIZED; } ScriptableDataSourceXmlFactoryModule(); int getDocumentSupport( final XmlDocumentInfo documentInfo ); String getDefaultNamespace( final XmlDocumentInfo documentInfo ); XmlReadHandler createReadHandler( final XmlDocumentInfo documentInfo );  }