james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tellier Benoit (JIRA)" <server-...@james.apache.org>
Subject [jira] [Resolved] (JAMES-2376) HBASE RRT getAllMappings is buggy
Date Thu, 05 Jul 2018 02:40:00 GMT

     [ https://issues.apache.org/jira/browse/JAMES-2376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tellier Benoit resolved JAMES-2376.
-----------------------------------
    Resolution: Fixed

> HBASE RRT getAllMappings is buggy
> ---------------------------------
>
>                 Key: JAMES-2376
>                 URL: https://issues.apache.org/jira/browse/JAMES-2376
>             Project: James Server
>          Issue Type: Bug
>          Components: hbase, RRT
>    Affects Versions: master
>            Reporter: Tellier Benoit
>            Priority: Major
>              Labels: bug, contributers-welcome, easy-fix, hbase
>
> HBase does some weird RRT overrights:
> Test:
> {code:java}
>     @Test
>     public void getAllMappingsShouldListAllEntries() throws ErrorMappingException, RecipientRewriteTableException
{
>         String user = "test";
>         String user2 = "test2";
>         Domain domain = Domain.LOCALHOST;
>         // String regex = "(.*):{$1}@localhost";
>         // String regex2 = "(.+):{$1}@test";
>         String regex = "(.*)@localhost";
>         String regex2 = "(.+)@test";
>         assertThat(virtualUserTable.getMappings(user, domain)).describedAs("No mapping").isNull();
>         addMapping(user, domain, regex, Type.Regex);
>         addMapping(user, domain, regex2, Type.Regex);
>         addMapping(user2, domain, user + "@" + domain.asString(), Type.Address);
>         assertThat(virtualUserTable.getAllMappings())
>             .describedAs("One mappingline")
>             .containsOnly(
>                 Pair.of(user + "@" + domain.asString(), MappingsImpl.builder()
>                     .add(MappingImpl.regex(regex))
>                     .add(MappingImpl.regex(regex2))
>                     .build()),
>                 Pair.of(user2 + "@" + domain.asString(), MappingsImpl.builder()
>                     .add(MappingImpl.address(user + "@" + domain.asString()))
>                     .build()));
>     }
> {code}
> Result:
> {code:java}
> java.lang.AssertionError: [One mappingline] 
> Expecting:
>   <{"test2@localhost"=MappingsImpl{mappings=[MappingImpl{type=Address mapping=test2@localhost}]},
"test@localhost"=MappingsImpl{mappings=[MappingImpl{type=Address mapping=test@localhost}]}}>
> to contain only:
>   <[(test@localhost,MappingsImpl{mappings=[MappingImpl{type=Regex mapping=(.*)@localhost},
MappingImpl{type=Regex mapping=(.+)@test}]}),
>     (test2@localhost,MappingsImpl{mappings=[MappingImpl{type=Address mapping=test@localhost}]})]>
> elements not found:
>   <[MapEntry[key="test@localhost", value=MappingsImpl{mappings=[MappingImpl{type=Regex
mapping=(.*)@localhost}, MappingImpl{type=Regex mapping=(.+)@test}]}],
>     MapEntry[key="test2@localhost", value=MappingsImpl{mappings=[MappingImpl{type=Address
mapping=test@localhost}]}]]>
> and elements not expected:
>   <[MapEntry[key="test2@localhost", value=MappingsImpl{mappings=[MappingImpl{type=Address
mapping=test2@localhost}]}],
>     MapEntry[key="test@localhost", value=MappingsImpl{mappings=[MappingImpl{type=Address
mapping=test@localhost}]}]]>
> {code}
> This behaviour was not tested.
> I will disable the test.
> Contribution welcomes to fix this.
> (See HBaseRecipientRewriteTableTest)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message