JAMES-2502 fix Eclipse Photon build for dnsservice
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/136acc1e Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/136acc1e Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/136acc1e Branch: refs/heads/master Commit: 136acc1e9cc0f80d8e2f947eb37199fa1867759e Parents: 3dddd7c Author: Raphael Ouazana <raphael.ouaz...@linagora.com> Authored: Fri Jul 27 18:18:22 2018 +0200 Committer: Matthieu Baechler <matth...@apache.org> Committed: Wed Aug 1 14:20:23 2018 +0200 ---------------------------------------------------------------------- mpt/impl/smtp/core/pom.xml | 3 +- pom.xml | 5 + server/data/data-cassandra/pom.xml | 3 +- server/data/data-file/pom.xml | 3 +- server/data/data-hbase/pom.xml | 3 +- server/data/data-jpa/pom.xml | 3 +- server/data/data-library/pom.xml | 3 +- server/data/data-memory/pom.xml | 3 +- .../dnsservice/api/AbstractDNSServiceTest.java | 94 ------------ .../dnsservice/api/InMemoryDNSService.java | 146 ------------------- .../james/dnsservice/api/mock/DNSFixture.java | 97 ------------ .../dnsservice/api/mock/MockDNSService.java | 61 -------- server/dns-service/dnsservice-library/pom.xml | 3 +- server/dns-service/dnsservice-test/pom.xml | 72 +++++++++ .../dnsservice/api/AbstractDNSServiceTest.java | 94 ++++++++++++ .../dnsservice/api/InMemoryDNSService.java | 146 +++++++++++++++++++ .../james/dnsservice/api/mock/DNSFixture.java | 97 ++++++++++++ .../dnsservice/api/mock/MockDNSService.java | 61 ++++++++ server/mailet/integration-testing/pom.xml | 3 +- server/mailet/mailets/pom.xml | 3 +- server/pom.xml | 1 + .../cassandra-jmap-integration-testing/pom.xml | 3 +- .../jmap-integration-testing-common/pom.xml | 3 +- .../memory-jmap-integration-testing/pom.xml | 3 +- server/protocols/protocols-smtp/pom.xml | 3 +- .../protocols/webadmin/webadmin-mailbox/pom.xml | 3 +- 26 files changed, 491 insertions(+), 428 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/mpt/impl/smtp/core/pom.xml ---------------------------------------------------------------------- diff --git a/mpt/impl/smtp/core/pom.xml b/mpt/impl/smtp/core/pom.xml index 18174b0..045de64 100644 --- a/mpt/impl/smtp/core/pom.xml +++ b/mpt/impl/smtp/core/pom.xml @@ -42,11 +42,10 @@ <dependency> <groupId>${james.groupId}</groupId> <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> + <artifactId>james-server-dnsservice-test</artifactId> </dependency> <dependency> <groupId>${james.groupId}</groupId> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 669d927..2007c5f 100644 --- a/pom.xml +++ b/pom.xml @@ -1242,6 +1242,11 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> + <artifactId>james-server-dnsservice-test</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>${james.groupId}</groupId> <artifactId>james-server-fetchmail</artifactId> <version>${project.version}</version> </dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/data/data-cassandra/pom.xml ---------------------------------------------------------------------- diff --git a/server/data/data-cassandra/pom.xml b/server/data/data-cassandra/pom.xml index f7b575e..2e3eb96 100644 --- a/server/data/data-cassandra/pom.xml +++ b/server/data/data-cassandra/pom.xml @@ -77,8 +77,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/data/data-file/pom.xml ---------------------------------------------------------------------- diff --git a/server/data/data-file/pom.xml b/server/data/data-file/pom.xml index 16c3abd..6c9dfd9 100644 --- a/server/data/data-file/pom.xml +++ b/server/data/data-file/pom.xml @@ -61,8 +61,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/data/data-hbase/pom.xml ---------------------------------------------------------------------- diff --git a/server/data/data-hbase/pom.xml b/server/data/data-hbase/pom.xml index fd9adca..239ceaa 100644 --- a/server/data/data-hbase/pom.xml +++ b/server/data/data-hbase/pom.xml @@ -57,8 +57,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/data/data-jpa/pom.xml ---------------------------------------------------------------------- diff --git a/server/data/data-jpa/pom.xml b/server/data/data-jpa/pom.xml index c623347..cb0cd25 100644 --- a/server/data/data-jpa/pom.xml +++ b/server/data/data-jpa/pom.xml @@ -69,8 +69,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/data/data-library/pom.xml ---------------------------------------------------------------------- diff --git a/server/data/data-library/pom.xml b/server/data/data-library/pom.xml index 6c7cf0f..8b18787 100644 --- a/server/data/data-library/pom.xml +++ b/server/data/data-library/pom.xml @@ -62,8 +62,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/data/data-memory/pom.xml ---------------------------------------------------------------------- diff --git a/server/data/data-memory/pom.xml b/server/data/data-memory/pom.xml index b3d7017..b2f2b5a 100644 --- a/server/data/data-memory/pom.xml +++ b/server/data/data-memory/pom.xml @@ -60,8 +60,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java b/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java deleted file mode 100644 index edcba79..0000000 --- a/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one * - * or more contributor license agreements. See the NOTICE file * - * distributed with this work for additional information * - * regarding copyright ownership. The ASF licenses this file * - * to you under the Apache License, Version 2.0 (the * - * "License"); you may not use this file except in compliance * - * with the License. You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, * - * software distributed under the License is distributed on an * - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * - * KIND, either express or implied. See the License for the * - * specific language governing permissions and limitations * - * under the License. * - ****************************************************************/ -package org.apache.james.dnsservice.api; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Collection; - -import org.apache.james.dnsservice.api.mock.MockDNSService; -import org.junit.Ignore; -import org.junit.Test; - -import com.google.common.collect.ImmutableList; - - -/** - * Basic tests for AbstractDNSServer. The goal is to verify that the interface - * remains constants and that the built platform has access to the Internet. - */ -public class AbstractDNSServiceTest { - - /** - * Simple Mock DNSService relaying on InetAddress. - */ - private static final DNSService DNS_SERVER = new MockDNSService() { - - @Override - public String getHostName(InetAddress inet) { - return inet.getCanonicalHostName(); - } - - @Override - public Collection<InetAddress> getAllByName(String name) throws UnknownHostException { - return ImmutableList.copyOf(InetAddress.getAllByName(name)); - } - - @Override - public InetAddress getLocalHost() throws UnknownHostException { - return InetAddress.getLocalHost(); - } - - @Override - public InetAddress getByName(String host) throws UnknownHostException { - return InetAddress.getByName(host); - } - }; - - /** - * Simple localhost resolution. - * - * @throws UnknownHostException - */ - @Test - public void testLocalhost() throws UnknownHostException { - - assertEquals("localhost/127.0.0.1", DNS_SERVER.getByName("localhost").toString()); - - String localHost = DNS_SERVER.getHostName(InetAddress.getByName("127.0.0.1")); - // We only can check if the returned localhost is not empty. Its value - // depends on the hosts file. - assertTrue(localHost.length() > 0); - } - - /** - * Simple apache.org resolution. - * - * @throws UnknownHostException - */ - @Test - @Ignore(value = "It requires internet connection!") - public void testApache() throws UnknownHostException { - //TODO: move to some sort of Live tests - assertEquals(true, DNS_SERVER.getByName("www.apache.org").toString().startsWith("www.apache.org")); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/InMemoryDNSService.java ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/InMemoryDNSService.java b/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/InMemoryDNSService.java deleted file mode 100644 index 76f1148..0000000 --- a/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/InMemoryDNSService.java +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one * - * or more contributor license agreements. See the NOTICE file * - * distributed with this work for additional information * - * regarding copyright ownership. The ASF licenses this file * - * to you under the Apache License, Version 2.0 (the * - * "License"); you may not use this file except in compliance * - * with the License. You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, * - * software distributed under the License is distributed on an * - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * - * KIND, either express or implied. See the License for the * - * specific language governing permissions and limitations * - * under the License. * - ****************************************************************/ - -package org.apache.james.dnsservice.api; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.function.Predicate; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Maps; -import com.google.common.net.InetAddresses; - -public class InMemoryDNSService implements DNSService { - - private Map<String,DNSRecord> records; - - public InMemoryDNSService() { - records = Maps.newHashMap(); - records.put("0.0.0.0", dnsRecordFor(InetAddresses.forString("0.0.0.0"))); - records.put("127.0.0.1", dnsRecordFor(InetAddresses.forString("127.0.0.1"))); - } - - private DNSRecord dnsRecordFor(InetAddress addresses) { - Collection<String> emptyList = ImmutableList.of(); - return dnsRecordFor(emptyList, emptyList, ImmutableList.of(addresses)); - } - - private DNSRecord dnsRecordFor(Collection<String> mxRecords, Collection<String> txtRecords, List<InetAddress> addresses) { - return new DNSRecord(addresses, mxRecords, txtRecords); - } - - public InMemoryDNSService registerRecord(String hostname, InetAddress address, String mxRecord) { - Collection<String> emptyTxtRecords = ImmutableList.of(); - registerRecord(hostname, ImmutableList.of(address), ImmutableList.of(mxRecord), emptyTxtRecords); - return this; - } - - public InMemoryDNSService registerMxRecord(String hostname, String ip) throws UnknownHostException { - InetAddress containerIp = InetAddress.getByName(ip); - registerRecord(hostname, containerIp, hostname); - return this; - } - - public InMemoryDNSService registerRecord(String hostname, List<InetAddress> addresses, Collection<String> mxRecords, Collection<String> txtRecords) { - records.put(hostname, dnsRecordFor(mxRecords, txtRecords, addresses)); - return this; - } - - public void dropRecord(String hostname) { - records.remove(hostname); - } - - @Override - public Collection<String> findMXRecords(String hostname) throws TemporaryResolutionException { - try { - return hostRecord(hostname).mxRecords; - } catch (UnknownHostException e) { - throw new RuntimeException(e); - } - } - - @Override - public Collection<String> findTXTRecords(String hostname) { - try { - return hostRecord(hostname).txtRecords; - } catch (UnknownHostException e) { - throw new RuntimeException(e); - } - } - - @Override - public List<InetAddress> getAllByName(String host) throws UnknownHostException { - return hostRecord(host).addresses; - } - - @Override - public InetAddress getByName(String host) throws UnknownHostException { - return hostRecord(host).addresses.get(0); - } - - private DNSRecord hostRecord(final String host) throws UnknownHostException { - Predicate<? super Entry<String, DNSRecord>> filterByKey = entry -> entry.getKey().equals(host); - return getDNSEntry(filterByKey).getValue(); - } - - @Override - public InetAddress getLocalHost() throws UnknownHostException { - return InetAddress.getLocalHost(); - } - - @Override - public String getHostName(final InetAddress addr) { - Predicate<? super Entry<String, DNSRecord>> filterByValue = entry -> entry.getValue().contains(addr); - - try { - return getDNSEntry(filterByValue).getKey(); - } catch (UnknownHostException e) { - throw new RuntimeException(e); - } - } - - private Entry<String, DNSRecord> getDNSEntry(Predicate<? super Entry<String, DNSRecord>> filter) throws UnknownHostException { - return records.entrySet().stream() - .filter(filter) - .findFirst() - .orElseThrow(() -> new UnknownHostException()); - } - - public static class DNSRecord { - - final Collection<String> mxRecords; - final Collection<String> txtRecords; - private final List<InetAddress> addresses; - - public DNSRecord(List<InetAddress> addresses, Collection<String> mxRecords, Collection<String> txtRecords) { - this.addresses = addresses; - this.mxRecords = mxRecords; - this.txtRecords = txtRecords; - } - - public boolean contains(InetAddress address) { - return addresses.contains(address); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/mock/DNSFixture.java ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/mock/DNSFixture.java b/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/mock/DNSFixture.java deleted file mode 100644 index bd91def..0000000 --- a/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/mock/DNSFixture.java +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one * - * or more contributor license agreements. See the NOTICE file * - * distributed with this work for additional information * - * regarding copyright ownership. The ASF licenses this file * - * to you under the Apache License, Version 2.0 (the * - * "License"); you may not use this file except in compliance * - * with the License. You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, * - * software distributed under the License is distributed on an * - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * - * KIND, either express or implied. See the License for the * - * specific language governing permissions and limitations * - * under the License. * - ****************************************************************/ -package org.apache.james.dnsservice.api.mock; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Collection; - -import org.apache.james.dnsservice.api.DNSService; - -import com.google.common.collect.ImmutableList; - -/** - * Some DNS Fixtures used by various Test related to DNS and InetNetwork. - */ -public class DNSFixture { - - public static final String LOCALHOST_IP_V4_ADDRESS_0 = "localhost/16"; - public static final String LOCALHOST_IP_V4_ADDRESS_1 = "172.16.0.0/16"; - public static final String LOCALHOST_IP_V4_ADDRESS_2 = "192.168.1.0/255.255.255.0"; - public static final String[] LOCALHOST_IP_V4_ADDRESSES = new String[]{LOCALHOST_IP_V4_ADDRESS_0, - LOCALHOST_IP_V4_ADDRESS_1, LOCALHOST_IP_V4_ADDRESS_2}; - public static final String[] LOCALHOST_IP_V4_ADDRESSES_DUPLICATE = new String[]{LOCALHOST_IP_V4_ADDRESS_1, - LOCALHOST_IP_V4_ADDRESS_1, LOCALHOST_IP_V4_ADDRESS_2, LOCALHOST_IP_V4_ADDRESS_2}; - public static final String LOCALHOST_IP_V6_ADDRESS_0 = "00:00:00:00:00:00:00:1"; - public static final String LOCALHOST_IP_V6_ADDRESS_1 = "2781:0db8:1234:8612:45ee:0000:f05e:0001/48"; - public static final String[] LOCALHOST_IP_V6_ADDRESSES = new String[]{LOCALHOST_IP_V6_ADDRESS_0, - LOCALHOST_IP_V6_ADDRESS_1}; - public static final String[] LOCALHOST_IP_V6_ADDRESSES_DUPLICATE = new String[]{LOCALHOST_IP_V6_ADDRESS_0, - LOCALHOST_IP_V6_ADDRESS_0, LOCALHOST_IP_V6_ADDRESS_1, LOCALHOST_IP_V6_ADDRESS_1}; - /** - * A Mock DNS Server that handles IPv4-only InetAddress. - */ - public static final DNSService DNS_SERVER_IPV4_MOCK = new MockDNSService() { - - @Override - public String getHostName(InetAddress inet) { - return "localhost"; - } - - @Override - public Collection<InetAddress> getAllByName(String name) throws UnknownHostException { - return ImmutableList.of(InetAddress.getByName("127.0.0.1")); - } - - @Override - public InetAddress getLocalHost() throws UnknownHostException { - return InetAddress.getLocalHost(); - } - - @Override - public InetAddress getByName(String host) throws UnknownHostException { - return InetAddress.getByName(host); - } - }; - /** - * A Mock DNS Server that handles IPv6-only InetAddress. - */ - public static final DNSService DNS_SERVER_IPV6_MOCK = new MockDNSService() { - - @Override - public String getHostName(InetAddress inet) { - return "localhost"; - } - - @Override - public Collection<InetAddress> getAllByName(String name) throws UnknownHostException { - return ImmutableList.of(InetAddress.getByName("::1")); - } - - @Override - public InetAddress getLocalHost() throws UnknownHostException { - return InetAddress.getLocalHost(); - } - - @Override - public InetAddress getByName(String host) throws UnknownHostException { - return InetAddress.getByName(host); - } - }; -} http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/mock/MockDNSService.java ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/mock/MockDNSService.java b/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/mock/MockDNSService.java deleted file mode 100644 index b7c238c..0000000 --- a/server/dns-service/dnsservice-api/src/test/java/org/apache/james/dnsservice/api/mock/MockDNSService.java +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one * - * or more contributor license agreements. See the NOTICE file * - * distributed with this work for additional information * - * regarding copyright ownership. The ASF licenses this file * - * to you under the Apache License, Version 2.0 (the * - * "License"); you may not use this file except in compliance * - * with the License. You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, * - * software distributed under the License is distributed on an * - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * - * KIND, either express or implied. See the License for the * - * specific language governing permissions and limitations * - * under the License. * - ****************************************************************/ -package org.apache.james.dnsservice.api.mock; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Collection; - -import org.apache.james.dnsservice.api.DNSService; - -/** - * Abstract class to simplify the mocks - */ -public class MockDNSService implements DNSService { - - @Override - public Collection<String> findMXRecords(String hostname) { - throw new UnsupportedOperationException("Unimplemented Stub Method"); - } - - @Override - public Collection<String> findTXTRecords(String hostname) { - throw new UnsupportedOperationException("Unimplemented Stub Method"); - } - - @Override - public Collection<InetAddress> getAllByName(String host) throws UnknownHostException { - throw new UnsupportedOperationException("Unimplemented Stub Method"); - } - - @Override - public InetAddress getByName(String host) throws UnknownHostException { - throw new UnsupportedOperationException("Unimplemented Stub Method"); - } - - @Override - public String getHostName(InetAddress addr) { - throw new UnsupportedOperationException("Unimplemented Stub Method"); - } - - @Override - public InetAddress getLocalHost() throws UnknownHostException { - throw new UnsupportedOperationException("Unimplemented Stub Method"); - } -} http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-library/pom.xml ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-library/pom.xml b/server/dns-service/dnsservice-library/pom.xml index 1155ede..cf4a9cf 100644 --- a/server/dns-service/dnsservice-library/pom.xml +++ b/server/dns-service/dnsservice-library/pom.xml @@ -43,8 +43,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-test/pom.xml ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-test/pom.xml b/server/dns-service/dnsservice-test/pom.xml new file mode 100644 index 0000000..2b203db --- /dev/null +++ b/server/dns-service/dnsservice-test/pom.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.james</groupId> + <artifactId>james-server</artifactId> + <version>3.2.0-SNAPSHOT</version> + <relativePath>../../pom.xml</relativePath> + </parent> + + <artifactId>james-server-dnsservice-test</artifactId> + <packaging>bundle</packaging> + + <name>Apache James :: Server :: DNS Service :: Test</name> + + <dependencies> + + <dependency> + <groupId>${james.groupId}</groupId> + <artifactId>james-server-dnsservice-api</artifactId> + </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + </plugin> + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java new file mode 100644 index 0000000..edcba79 --- /dev/null +++ b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/AbstractDNSServiceTest.java @@ -0,0 +1,94 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.dnsservice.api; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Collection; + +import org.apache.james.dnsservice.api.mock.MockDNSService; +import org.junit.Ignore; +import org.junit.Test; + +import com.google.common.collect.ImmutableList; + + +/** + * Basic tests for AbstractDNSServer. The goal is to verify that the interface + * remains constants and that the built platform has access to the Internet. + */ +public class AbstractDNSServiceTest { + + /** + * Simple Mock DNSService relaying on InetAddress. + */ + private static final DNSService DNS_SERVER = new MockDNSService() { + + @Override + public String getHostName(InetAddress inet) { + return inet.getCanonicalHostName(); + } + + @Override + public Collection<InetAddress> getAllByName(String name) throws UnknownHostException { + return ImmutableList.copyOf(InetAddress.getAllByName(name)); + } + + @Override + public InetAddress getLocalHost() throws UnknownHostException { + return InetAddress.getLocalHost(); + } + + @Override + public InetAddress getByName(String host) throws UnknownHostException { + return InetAddress.getByName(host); + } + }; + + /** + * Simple localhost resolution. + * + * @throws UnknownHostException + */ + @Test + public void testLocalhost() throws UnknownHostException { + + assertEquals("localhost/127.0.0.1", DNS_SERVER.getByName("localhost").toString()); + + String localHost = DNS_SERVER.getHostName(InetAddress.getByName("127.0.0.1")); + // We only can check if the returned localhost is not empty. Its value + // depends on the hosts file. + assertTrue(localHost.length() > 0); + } + + /** + * Simple apache.org resolution. + * + * @throws UnknownHostException + */ + @Test + @Ignore(value = "It requires internet connection!") + public void testApache() throws UnknownHostException { + //TODO: move to some sort of Live tests + assertEquals(true, DNS_SERVER.getByName("www.apache.org").toString().startsWith("www.apache.org")); + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/InMemoryDNSService.java ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/InMemoryDNSService.java b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/InMemoryDNSService.java new file mode 100644 index 0000000..76f1148 --- /dev/null +++ b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/InMemoryDNSService.java @@ -0,0 +1,146 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ + +package org.apache.james.dnsservice.api; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.function.Predicate; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Maps; +import com.google.common.net.InetAddresses; + +public class InMemoryDNSService implements DNSService { + + private Map<String,DNSRecord> records; + + public InMemoryDNSService() { + records = Maps.newHashMap(); + records.put("0.0.0.0", dnsRecordFor(InetAddresses.forString("0.0.0.0"))); + records.put("127.0.0.1", dnsRecordFor(InetAddresses.forString("127.0.0.1"))); + } + + private DNSRecord dnsRecordFor(InetAddress addresses) { + Collection<String> emptyList = ImmutableList.of(); + return dnsRecordFor(emptyList, emptyList, ImmutableList.of(addresses)); + } + + private DNSRecord dnsRecordFor(Collection<String> mxRecords, Collection<String> txtRecords, List<InetAddress> addresses) { + return new DNSRecord(addresses, mxRecords, txtRecords); + } + + public InMemoryDNSService registerRecord(String hostname, InetAddress address, String mxRecord) { + Collection<String> emptyTxtRecords = ImmutableList.of(); + registerRecord(hostname, ImmutableList.of(address), ImmutableList.of(mxRecord), emptyTxtRecords); + return this; + } + + public InMemoryDNSService registerMxRecord(String hostname, String ip) throws UnknownHostException { + InetAddress containerIp = InetAddress.getByName(ip); + registerRecord(hostname, containerIp, hostname); + return this; + } + + public InMemoryDNSService registerRecord(String hostname, List<InetAddress> addresses, Collection<String> mxRecords, Collection<String> txtRecords) { + records.put(hostname, dnsRecordFor(mxRecords, txtRecords, addresses)); + return this; + } + + public void dropRecord(String hostname) { + records.remove(hostname); + } + + @Override + public Collection<String> findMXRecords(String hostname) throws TemporaryResolutionException { + try { + return hostRecord(hostname).mxRecords; + } catch (UnknownHostException e) { + throw new RuntimeException(e); + } + } + + @Override + public Collection<String> findTXTRecords(String hostname) { + try { + return hostRecord(hostname).txtRecords; + } catch (UnknownHostException e) { + throw new RuntimeException(e); + } + } + + @Override + public List<InetAddress> getAllByName(String host) throws UnknownHostException { + return hostRecord(host).addresses; + } + + @Override + public InetAddress getByName(String host) throws UnknownHostException { + return hostRecord(host).addresses.get(0); + } + + private DNSRecord hostRecord(final String host) throws UnknownHostException { + Predicate<? super Entry<String, DNSRecord>> filterByKey = entry -> entry.getKey().equals(host); + return getDNSEntry(filterByKey).getValue(); + } + + @Override + public InetAddress getLocalHost() throws UnknownHostException { + return InetAddress.getLocalHost(); + } + + @Override + public String getHostName(final InetAddress addr) { + Predicate<? super Entry<String, DNSRecord>> filterByValue = entry -> entry.getValue().contains(addr); + + try { + return getDNSEntry(filterByValue).getKey(); + } catch (UnknownHostException e) { + throw new RuntimeException(e); + } + } + + private Entry<String, DNSRecord> getDNSEntry(Predicate<? super Entry<String, DNSRecord>> filter) throws UnknownHostException { + return records.entrySet().stream() + .filter(filter) + .findFirst() + .orElseThrow(() -> new UnknownHostException()); + } + + public static class DNSRecord { + + final Collection<String> mxRecords; + final Collection<String> txtRecords; + private final List<InetAddress> addresses; + + public DNSRecord(List<InetAddress> addresses, Collection<String> mxRecords, Collection<String> txtRecords) { + this.addresses = addresses; + this.mxRecords = mxRecords; + this.txtRecords = txtRecords; + } + + public boolean contains(InetAddress address) { + return addresses.contains(address); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/mock/DNSFixture.java ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/mock/DNSFixture.java b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/mock/DNSFixture.java new file mode 100644 index 0000000..bd91def --- /dev/null +++ b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/mock/DNSFixture.java @@ -0,0 +1,97 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.dnsservice.api.mock; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Collection; + +import org.apache.james.dnsservice.api.DNSService; + +import com.google.common.collect.ImmutableList; + +/** + * Some DNS Fixtures used by various Test related to DNS and InetNetwork. + */ +public class DNSFixture { + + public static final String LOCALHOST_IP_V4_ADDRESS_0 = "localhost/16"; + public static final String LOCALHOST_IP_V4_ADDRESS_1 = "172.16.0.0/16"; + public static final String LOCALHOST_IP_V4_ADDRESS_2 = "192.168.1.0/255.255.255.0"; + public static final String[] LOCALHOST_IP_V4_ADDRESSES = new String[]{LOCALHOST_IP_V4_ADDRESS_0, + LOCALHOST_IP_V4_ADDRESS_1, LOCALHOST_IP_V4_ADDRESS_2}; + public static final String[] LOCALHOST_IP_V4_ADDRESSES_DUPLICATE = new String[]{LOCALHOST_IP_V4_ADDRESS_1, + LOCALHOST_IP_V4_ADDRESS_1, LOCALHOST_IP_V4_ADDRESS_2, LOCALHOST_IP_V4_ADDRESS_2}; + public static final String LOCALHOST_IP_V6_ADDRESS_0 = "00:00:00:00:00:00:00:1"; + public static final String LOCALHOST_IP_V6_ADDRESS_1 = "2781:0db8:1234:8612:45ee:0000:f05e:0001/48"; + public static final String[] LOCALHOST_IP_V6_ADDRESSES = new String[]{LOCALHOST_IP_V6_ADDRESS_0, + LOCALHOST_IP_V6_ADDRESS_1}; + public static final String[] LOCALHOST_IP_V6_ADDRESSES_DUPLICATE = new String[]{LOCALHOST_IP_V6_ADDRESS_0, + LOCALHOST_IP_V6_ADDRESS_0, LOCALHOST_IP_V6_ADDRESS_1, LOCALHOST_IP_V6_ADDRESS_1}; + /** + * A Mock DNS Server that handles IPv4-only InetAddress. + */ + public static final DNSService DNS_SERVER_IPV4_MOCK = new MockDNSService() { + + @Override + public String getHostName(InetAddress inet) { + return "localhost"; + } + + @Override + public Collection<InetAddress> getAllByName(String name) throws UnknownHostException { + return ImmutableList.of(InetAddress.getByName("127.0.0.1")); + } + + @Override + public InetAddress getLocalHost() throws UnknownHostException { + return InetAddress.getLocalHost(); + } + + @Override + public InetAddress getByName(String host) throws UnknownHostException { + return InetAddress.getByName(host); + } + }; + /** + * A Mock DNS Server that handles IPv6-only InetAddress. + */ + public static final DNSService DNS_SERVER_IPV6_MOCK = new MockDNSService() { + + @Override + public String getHostName(InetAddress inet) { + return "localhost"; + } + + @Override + public Collection<InetAddress> getAllByName(String name) throws UnknownHostException { + return ImmutableList.of(InetAddress.getByName("::1")); + } + + @Override + public InetAddress getLocalHost() throws UnknownHostException { + return InetAddress.getLocalHost(); + } + + @Override + public InetAddress getByName(String host) throws UnknownHostException { + return InetAddress.getByName(host); + } + }; +} http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/mock/MockDNSService.java ---------------------------------------------------------------------- diff --git a/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/mock/MockDNSService.java b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/mock/MockDNSService.java new file mode 100644 index 0000000..b7c238c --- /dev/null +++ b/server/dns-service/dnsservice-test/src/main/java/org/apache/james/dnsservice/api/mock/MockDNSService.java @@ -0,0 +1,61 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.dnsservice.api.mock; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Collection; + +import org.apache.james.dnsservice.api.DNSService; + +/** + * Abstract class to simplify the mocks + */ +public class MockDNSService implements DNSService { + + @Override + public Collection<String> findMXRecords(String hostname) { + throw new UnsupportedOperationException("Unimplemented Stub Method"); + } + + @Override + public Collection<String> findTXTRecords(String hostname) { + throw new UnsupportedOperationException("Unimplemented Stub Method"); + } + + @Override + public Collection<InetAddress> getAllByName(String host) throws UnknownHostException { + throw new UnsupportedOperationException("Unimplemented Stub Method"); + } + + @Override + public InetAddress getByName(String host) throws UnknownHostException { + throw new UnsupportedOperationException("Unimplemented Stub Method"); + } + + @Override + public String getHostName(InetAddress addr) { + throw new UnsupportedOperationException("Unimplemented Stub Method"); + } + + @Override + public InetAddress getLocalHost() throws UnknownHostException { + throw new UnsupportedOperationException("Unimplemented Stub Method"); + } +} http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/mailet/integration-testing/pom.xml ---------------------------------------------------------------------- diff --git a/server/mailet/integration-testing/pom.xml b/server/mailet/integration-testing/pom.xml index 0af81e4..3a53ffc 100644 --- a/server/mailet/integration-testing/pom.xml +++ b/server/mailet/integration-testing/pom.xml @@ -54,8 +54,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/mailet/mailets/pom.xml ---------------------------------------------------------------------- diff --git a/server/mailet/mailets/pom.xml b/server/mailet/mailets/pom.xml index 5a3f3cc..c199753 100644 --- a/server/mailet/mailets/pom.xml +++ b/server/mailet/mailets/pom.xml @@ -138,8 +138,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/pom.xml ---------------------------------------------------------------------- diff --git a/server/pom.xml b/server/pom.xml index 21c6e8a..7b25899 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -71,6 +71,7 @@ <module>dns-service/dnsservice-api</module> <module>dns-service/dnsservice-dnsjava</module> <module>dns-service/dnsservice-library</module> + <module>dns-service/dnsservice-test</module> <module>mailet/integration-testing</module> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml index 6309274..0380b9c 100644 --- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml +++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/pom.xml @@ -87,8 +87,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> </dependency> <dependency> <groupId>${james.groupId}</groupId> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml index 7f69759..b109376 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/pom.xml @@ -51,8 +51,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml ---------------------------------------------------------------------- diff --git a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml index c873e5e..180cab6 100644 --- a/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml +++ b/server/protocols/jmap-integration-testing/memory-jmap-integration-testing/pom.xml @@ -46,8 +46,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> </dependency> <dependency> <groupId>${james.groupId}</groupId> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/protocols/protocols-smtp/pom.xml ---------------------------------------------------------------------- diff --git a/server/protocols/protocols-smtp/pom.xml b/server/protocols/protocols-smtp/pom.xml index 9291472..3a4f615 100644 --- a/server/protocols/protocols-smtp/pom.xml +++ b/server/protocols/protocols-smtp/pom.xml @@ -93,8 +93,7 @@ </dependency> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/james-project/blob/136acc1e/server/protocols/webadmin/webadmin-mailbox/pom.xml ---------------------------------------------------------------------- diff --git a/server/protocols/webadmin/webadmin-mailbox/pom.xml b/server/protocols/webadmin/webadmin-mailbox/pom.xml index 0f366a9..5c91f4a 100644 --- a/server/protocols/webadmin/webadmin-mailbox/pom.xml +++ b/server/protocols/webadmin/webadmin-mailbox/pom.xml @@ -35,8 +35,7 @@ <dependencies> <dependency> <groupId>${james.groupId}</groupId> - <artifactId>james-server-dnsservice-api</artifactId> - <type>test-jar</type> + <artifactId>james-server-dnsservice-test</artifactId> <scope>test</scope> </dependency> <dependency> --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org