From 8bacbff629091d2c30bc6b2e6922695634185851 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Thu, 25 Feb 2021 17:46:26 +0100 Subject: [PATCH] Remove spring-boot-smoke-test-jta-jndi See gh-25434 --- .../src/main/java/smoketest/jndi/Account.java | 43 ---------------- .../smoketest/jndi/AccountRepository.java | 23 --------- .../java/smoketest/jndi/AccountService.java | 45 ----------------- .../main/java/smoketest/jndi/Messages.java | 30 ------------ .../smoketest/jndi/SampleJndiApplication.java | 24 --------- .../smoketest/jndi/SampleJndiInitializer.java | 29 ----------- .../java/smoketest/jndi/WebController.java | 49 ------------------- .../src/main/resources/application.properties | 3 -- 8 files changed, 246 deletions(-) delete mode 100644 spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/Account.java delete mode 100644 spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/AccountRepository.java delete mode 100644 spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/AccountService.java delete mode 100644 spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/Messages.java delete mode 100644 spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/SampleJndiApplication.java delete mode 100644 spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/SampleJndiInitializer.java delete mode 100644 spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/WebController.java delete mode 100644 spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/resources/application.properties diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/Account.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/Account.java deleted file mode 100644 index 9cf53640a4..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/Account.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed 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 - * - * https://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 smoketest.jndi; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; - -@Entity -public class Account { - - @Id - @GeneratedValue - private Long id; - - private String username; - - Account() { - } - - public Account(String username) { - this.username = username; - } - - public String getUsername() { - return this.username; - } - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/AccountRepository.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/AccountRepository.java deleted file mode 100644 index f8c12eeebd..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/AccountRepository.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed 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 - * - * https://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 smoketest.jndi; - -import org.springframework.data.repository.CrudRepository; - -public interface AccountRepository extends CrudRepository { - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/AccountService.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/AccountService.java deleted file mode 100644 index 9f6be377a6..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/AccountService.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed 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 - * - * https://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 smoketest.jndi; - -import org.springframework.jms.core.JmsTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@Service -@Transactional -public class AccountService { - - private final JmsTemplate jmsTemplate; - - private final AccountRepository accountRepository; - - public AccountService(JmsTemplate jmsTemplate, AccountRepository accountRepository) { - this.jmsTemplate = jmsTemplate; - this.accountRepository = accountRepository; - } - - public void createAccountAndNotify(String username) { - this.jmsTemplate.convertAndSend("java:/jms/queue/bootdemo", username); - Account entity = new Account(username); - this.accountRepository.save(entity); - if ("error".equals(username)) { - throw new RuntimeException("Simulated error"); - } - } - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/Messages.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/Messages.java deleted file mode 100644 index f252c45bec..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/Messages.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed 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 - * - * https://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 smoketest.jndi; - -import org.springframework.jms.annotation.JmsListener; -import org.springframework.stereotype.Component; - -@Component -public class Messages { - - @JmsListener(destination = "java:/jms/queue/bootdemo") - public void onMessage(String content) { - System.out.println("----> " + content); - } - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/SampleJndiApplication.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/SampleJndiApplication.java deleted file mode 100644 index 9c95b13e62..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/SampleJndiApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed 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 - * - * https://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 smoketest.jndi; - -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class SampleJndiApplication { - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/SampleJndiInitializer.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/SampleJndiInitializer.java deleted file mode 100644 index b926df4e29..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/SampleJndiInitializer.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed 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 - * - * https://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 smoketest.jndi; - -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -public class SampleJndiInitializer extends SpringBootServletInitializer { - - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { - return application.sources(SampleJndiApplication.class); - } - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/WebController.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/WebController.java deleted file mode 100644 index e61afea1ab..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/java/smoketest/jndi/WebController.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2012-2019 the original author or authors. - * - * Licensed 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 - * - * https://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 smoketest.jndi; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class WebController { - - private final AccountService service; - - private final AccountRepository repository; - - public WebController(AccountService service, AccountRepository repository) { - this.service = service; - this.repository = repository; - } - - @GetMapping("/") - public String hello() { - System.out.println("Count is " + this.repository.count()); - this.service.createAccountAndNotify("josh"); - try { - this.service.createAccountAndNotify("error"); - } - catch (Exception ex) { - System.out.println(ex.getMessage()); - } - long count = this.repository.count(); - System.out.println("Count is " + count); - return "Count is " + count; - } - -} diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/resources/application.properties b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/resources/application.properties deleted file mode 100644 index 89c0de031d..0000000000 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jta-jndi/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -spring.datasource.jndi-name=java:jboss/datasources/bootdemo -spring.jpa.generate-ddl=true -spring.jpa.open-in-view=true