This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch postgresql in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 52ca5e9dbd2ab04d348df3f13f94988f18aa0e61 Author: Tung Tran <[email protected]> AuthorDate: Tue Dec 5 11:12:16 2023 +0700 JAMES-2586 Postgres app – Remove server test for authentication database sql validation - It was created for JPA, with Postgresql we don't need it. (instead of mark @Disabled for it) --- .../org/apache/james/PostgresJamesServerTest.java | 2 +- ...WithAuthenticatedDatabaseSqlValidationTest.java | 42 ------------ ...atabaseAuthenticaticationSqlValidationTest.java | 74 ---------------------- .../PostgresJamesServerWithSqlValidationTest.java | 30 --------- .../src/test/resources/usersrepository.xml | 28 ++++++++ 5 files changed, 29 insertions(+), 147 deletions(-) diff --git a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerTest.java b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerTest.java index 7f82a1963f..c2157a7e9e 100644 --- a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerTest.java +++ b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerTest.java @@ -74,7 +74,7 @@ class PostgresJamesServerTest implements JamesServerConcreteContract { } @Test - void jpaGuiceServerShouldUpdateQuota(GuiceJamesServer jamesServer) throws Exception { + void guiceServerShouldUpdateQuota(GuiceJamesServer jamesServer) throws Exception { jamesServer.getProbe(DataProbeImpl.class) .fluent() .addDomain(DOMAIN) diff --git a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithAuthenticatedDatabaseSqlValidationTest.java b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithAuthenticatedDatabaseSqlValidationTest.java deleted file mode 100644 index 2e0fc42cd5..0000000000 --- a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithAuthenticatedDatabaseSqlValidationTest.java +++ /dev/null @@ -1,42 +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; - -import static org.apache.james.data.UsersRepositoryModuleChooser.Implementation.DEFAULT; - -import org.apache.james.backends.postgres.PostgresExtension; -import org.junit.jupiter.api.extension.RegisterExtension; - -class PostgresJamesServerWithAuthenticatedDatabaseSqlValidationTest extends PostgresJamesServerWithSqlValidationTest { - static PostgresExtension postgresExtension = PostgresExtension.empty(); - - @RegisterExtension - static JamesServerExtension jamesServerExtension = new JamesServerBuilder<PostgresJamesConfiguration>(tmpDir -> - PostgresJamesConfiguration.builder() - .workingDirectory(tmpDir) - .configurationFromClasspath() - .usersRepository(DEFAULT) - .build()) - .server(configuration -> PostgresJamesServerMain.createServer(configuration) - .overrideWith(new TestJPAConfigurationModuleWithSqlValidation.WithDatabaseAuthentication(postgresExtension))) - .extension(postgresExtension) - .lifeCycle(JamesServerExtension.Lifecycle.PER_CLASS) - .build(); -} diff --git a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithNoDatabaseAuthenticaticationSqlValidationTest.java b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithNoDatabaseAuthenticaticationSqlValidationTest.java deleted file mode 100644 index 37d5491075..0000000000 --- a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithNoDatabaseAuthenticaticationSqlValidationTest.java +++ /dev/null @@ -1,74 +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; - -import static org.apache.james.data.UsersRepositoryModuleChooser.Implementation.DEFAULT; - -import org.apache.james.backends.postgres.PostgresExtension; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.extension.RegisterExtension; - -class PostgresJamesServerWithNoDatabaseAuthenticaticationSqlValidationTest extends PostgresJamesServerWithSqlValidationTest { - static PostgresExtension postgresExtension = PostgresExtension.empty(); - - @RegisterExtension - static JamesServerExtension jamesServerExtension = new JamesServerBuilder<PostgresJamesConfiguration>(tmpDir -> - PostgresJamesConfiguration.builder() - .workingDirectory(tmpDir) - .configurationFromClasspath() - .usersRepository(DEFAULT) - .build()) - .server(configuration -> PostgresJamesServerMain.createServer(configuration) - .overrideWith(new TestJPAConfigurationModuleWithSqlValidation.NoDatabaseAuthentication(postgresExtension))) - .extension(postgresExtension) - .lifeCycle(JamesServerExtension.Lifecycle.PER_CLASS) - .build(); - - @Override - @Disabled("PostgresExtension does not support non-authentication mode. SQL validation for JPA code with authentication should be enough.") - public void jpaGuiceServerShouldUpdateQuota(GuiceJamesServer jamesServer) { - - } - - @Override - @Disabled("PostgresExtension does not support non-authentication mode. SQL validation for JPA code with authentication should be enough.") - public void connectIMAPServerShouldSendShabangOnConnect(GuiceJamesServer jamesServer) { - } - - @Override - @Disabled("PostgresExtension does not support non-authentication mode. SQL validation for JPA code with authentication should be enough.") - public void connectOnSecondaryIMAPServerIMAPServerShouldSendShabangOnConnect(GuiceJamesServer jamesServer) { - } - - @Override - @Disabled("PostgresExtension does not support non-authentication mode. SQL validation for JPA code with authentication should be enough.") - public void connectPOP3ServerShouldSendShabangOnConnect(GuiceJamesServer jamesServer) { - } - - @Override - @Disabled("PostgresExtension does not support non-authentication mode. SQL validation for JPA code with authentication should be enough.") - public void connectSMTPServerShouldSendShabangOnConnect(GuiceJamesServer jamesServer) { - } - - @Override - @Disabled("PostgresExtension does not support non-authentication mode. SQL validation for JPA code with authentication should be enough.") - public void connectLMTPServerShouldSendShabangOnConnect(GuiceJamesServer jamesServer) { - } -} diff --git a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithSqlValidationTest.java b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithSqlValidationTest.java deleted file mode 100644 index 27643a4f16..0000000000 --- a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresJamesServerWithSqlValidationTest.java +++ /dev/null @@ -1,30 +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; - -import org.junit.jupiter.api.Disabled; - -abstract class PostgresJamesServerWithSqlValidationTest extends PostgresJamesServerTest { - - @Override - @Disabled("Failing to create the domain: duplicate with test in JPAJamesServerTest") - void jpaGuiceServerShouldUpdateQuota(GuiceJamesServer jamesServer) { - } -} diff --git a/server/apps/postgres-app/src/test/resources/usersrepository.xml b/server/apps/postgres-app/src/test/resources/usersrepository.xml new file mode 100644 index 0000000000..a5390d7140 --- /dev/null +++ b/server/apps/postgres-app/src/test/resources/usersrepository.xml @@ -0,0 +1,28 @@ +<?xml version="1.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. + --> + +<!-- Read https://james.apache.org/server/config-users.html for further details --> + +<usersrepository name="LocalUsers"> + <algorithm>PBKDF2-SHA512</algorithm> + <enableVirtualHosting>true</enableVirtualHosting> + <enableForwarding>true</enableForwarding> +</usersrepository> + --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
