@Test public void testGgetDocumentSupport() { int result = xmlFactoryModule.getDocumentSupport( docInfo ); assertThat( result, is( equalTo( XmlFactoryModule.NOT_RECOGNIZED ) ) ); doReturn( "incorrect" ).when( docInfo ).getRootElementNameSpace(); doReturn( null ).when( docInfo ).getRootElement(); result = xmlFactoryModule.getDocumentSupport( docInfo ); assertThat( result, is( equalTo( XmlFactoryModule.NOT_RECOGNIZED ) ) ); doReturn( MailModule.NAMESPACE ).when( docInfo ).getRootElementNameSpace(); doReturn( "mail-definition" ).when( docInfo ).getRootElement(); result = xmlFactoryModule.getDocumentSupport( docInfo ); assertThat( result, is( equalTo( XmlFactoryModule.RECOGNIZED_BY_NAMESPACE ) ) ); doReturn( MailModule.NAMESPACE ).when( docInfo ).getRootElementNameSpace(); doReturn( "incorrect" ).when( docInfo ).getRootElement(); result = xmlFactoryModule.getDocumentSupport( docInfo ); assertThat( result, is( equalTo( XmlFactoryModule.NOT_RECOGNIZED ) ) ); doReturn( StringUtils.EMPTY ).when( docInfo ).getRootElementNameSpace(); doReturn( "mail-definition" ).when( docInfo ).getRootElement(); result = xmlFactoryModule.getDocumentSupport( docInfo ); 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 ( MailModule.NAMESPACE.equals( rootNamespace ) == false ) { return XmlFactoryModule.NOT_RECOGNIZED; } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; } } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_TAGNAME; } return XmlFactoryModule.NOT_RECOGNIZED; }
MailDefinitionXmlFactoryModule implements XmlFactoryModule { public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( MailModule.NAMESPACE.equals( rootNamespace ) == false ) { return XmlFactoryModule.NOT_RECOGNIZED; } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; } } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_TAGNAME; } return XmlFactoryModule.NOT_RECOGNIZED; } }
MailDefinitionXmlFactoryModule implements XmlFactoryModule { public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( MailModule.NAMESPACE.equals( rootNamespace ) == false ) { return XmlFactoryModule.NOT_RECOGNIZED; } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; } } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_TAGNAME; } return XmlFactoryModule.NOT_RECOGNIZED; } MailDefinitionXmlFactoryModule(); }
MailDefinitionXmlFactoryModule implements XmlFactoryModule { public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( MailModule.NAMESPACE.equals( rootNamespace ) == false ) { return XmlFactoryModule.NOT_RECOGNIZED; } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; } } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_TAGNAME; } return XmlFactoryModule.NOT_RECOGNIZED; } MailDefinitionXmlFactoryModule(); int getDocumentSupport( final XmlDocumentInfo documentInfo ); String getDefaultNamespace( final XmlDocumentInfo documentInfo ); XmlReadHandler createReadHandler( final XmlDocumentInfo documentInfo ); }
MailDefinitionXmlFactoryModule implements XmlFactoryModule { public int getDocumentSupport( final XmlDocumentInfo documentInfo ) { final String rootNamespace = documentInfo.getRootElementNameSpace(); if ( rootNamespace != null && rootNamespace.length() > 0 ) { if ( MailModule.NAMESPACE.equals( rootNamespace ) == false ) { return XmlFactoryModule.NOT_RECOGNIZED; } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; } } else if ( "mail-definition".equals( documentInfo.getRootElement() ) ) { return XmlFactoryModule.RECOGNIZED_BY_TAGNAME; } return XmlFactoryModule.NOT_RECOGNIZED; } MailDefinitionXmlFactoryModule(); int getDocumentSupport( final XmlDocumentInfo documentInfo ); String getDefaultNamespace( final XmlDocumentInfo documentInfo ); XmlReadHandler createReadHandler( final XmlDocumentInfo documentInfo );  }