From 51d5e41aa4c8bb8499ff7daefb73b0506c088750 Mon Sep 17 00:00:00 2001 From: Fabio Burzigotti Date: Fri, 27 Oct 2023 14:11:29 +0200 Subject: [PATCH] [issue 80] - Fixing a redundancy related to IntersmashConfig#eap7ProductCode(), fixing license headers --- .../examples/MicroProfileConfigEndpoint.java | 15 +++++++++++ .../IntersmashTestsuiteProperties.java | 15 +++++++++++ .../NotForCommunityExecutionProfile.java | 15 +++++++++++ .../NotForProductizedExecutionProfile.java | 15 +++++++++++ .../Eap7ImageProvisionerTestCase.java | 15 +++++++++++ .../Eap7TemplateProvisionerTestCase.java | 15 +++++++++++ .../intersmash/tools/IntersmashConfig.java | 11 +++++++- .../Eap7ImageOpenShiftApplication.java | 15 +++++++++++ .../Eap7TemplateOpenShiftApplication.java | 15 +++++++++++ .../openshift/template/Eap7Template.java | 15 +++++++++++ .../Eap7ImageOpenShiftProvisioner.java | 15 +++++++++++ .../Eap7ImageOpenShiftProvisionerFactory.java | 15 +++++++++++ .../Eap7TemplateOpenShiftProvisioner.java | 15 +++++++++++ .../template/Eap7TemplateProvisioner.java | 26 ++++++++++++------- .../tools/util/tls/CertificatesUtils.java | 15 +++++++++++ .../util/wildfly/Eap7CliScriptBuilder.java | 15 +++++++++++ 16 files changed, 236 insertions(+), 11 deletions(-) diff --git a/deployments/intersmash-deployments-shared/intersmash-deployments-shared-wildfly/wildfly-bootable-jar-javax/src/main/java/org/jboss/intersmash/deployments/examples/MicroProfileConfigEndpoint.java b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-wildfly/wildfly-bootable-jar-javax/src/main/java/org/jboss/intersmash/deployments/examples/MicroProfileConfigEndpoint.java index 013365fe4..78fa81d41 100644 --- a/deployments/intersmash-deployments-shared/intersmash-deployments-shared-wildfly/wildfly-bootable-jar-javax/src/main/java/org/jboss/intersmash/deployments/examples/MicroProfileConfigEndpoint.java +++ b/deployments/intersmash-deployments-shared/intersmash-deployments-shared-wildfly/wildfly-bootable-jar-javax/src/main/java/org/jboss/intersmash/deployments/examples/MicroProfileConfigEndpoint.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.deployments.examples; import javax.inject.Inject; diff --git a/testsuite/src/main/java/org/jboss/intersmash/testsuite/IntersmashTestsuiteProperties.java b/testsuite/src/main/java/org/jboss/intersmash/testsuite/IntersmashTestsuiteProperties.java index 9111a82c4..e0f8e5f7b 100644 --- a/testsuite/src/main/java/org/jboss/intersmash/testsuite/IntersmashTestsuiteProperties.java +++ b/testsuite/src/main/java/org/jboss/intersmash/testsuite/IntersmashTestsuiteProperties.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.testsuite; import java.io.IOException; diff --git a/testsuite/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/NotForCommunityExecutionProfile.java b/testsuite/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/NotForCommunityExecutionProfile.java index 08ff9cce9..ad999b672 100644 --- a/testsuite/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/NotForCommunityExecutionProfile.java +++ b/testsuite/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/NotForCommunityExecutionProfile.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.testsuite.junit5.categories; import java.lang.annotation.Retention; diff --git a/testsuite/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/NotForProductizedExecutionProfile.java b/testsuite/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/NotForProductizedExecutionProfile.java index fd255260c..b73b03f1c 100644 --- a/testsuite/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/NotForProductizedExecutionProfile.java +++ b/testsuite/src/main/java/org/jboss/intersmash/testsuite/junit5/categories/NotForProductizedExecutionProfile.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.testsuite.junit5.categories; import java.lang.annotation.Retention; diff --git a/testsuite/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7ImageProvisionerTestCase.java b/testsuite/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7ImageProvisionerTestCase.java index 767137ed8..9b524ad5e 100644 --- a/testsuite/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7ImageProvisionerTestCase.java +++ b/testsuite/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7ImageProvisionerTestCase.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.testsuite.provision.openshift; import java.util.HashMap; diff --git a/testsuite/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7TemplateProvisionerTestCase.java b/testsuite/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7TemplateProvisionerTestCase.java index d69c2a61e..491b15ed8 100644 --- a/testsuite/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7TemplateProvisionerTestCase.java +++ b/testsuite/src/test/java/org/jboss/intersmash/testsuite/provision/openshift/Eap7TemplateProvisionerTestCase.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.testsuite.provision.openshift; import java.util.Optional; diff --git a/tools/intersmash-tools-core/src/main/java/org/jboss/intersmash/tools/IntersmashConfig.java b/tools/intersmash-tools-core/src/main/java/org/jboss/intersmash/tools/IntersmashConfig.java index d15677057..a59eaf7ee 100644 --- a/tools/intersmash-tools-core/src/main/java/org/jboss/intersmash/tools/IntersmashConfig.java +++ b/tools/intersmash-tools-core/src/main/java/org/jboss/intersmash/tools/IntersmashConfig.java @@ -260,7 +260,16 @@ public static String eap7RuntimeImageUrl() { } public static String eap7ProductCode() { - return getProductCode(eap7ImageURL()); + final String image = eap7ImageURL(); + if (image.matches(".*eap-xp\\d+.*")) { + return image.replaceFirst(".*eap-xp(\\d+).*", "eap-xp$1"); + } else if (image.contains("eap-cd")) { + return "eap-cd"; + } else if (image.matches(".*eap\\d\\d.*")) { + return image.replaceFirst(".*eap(\\d\\d?).*", "eap$1"); + } else { + return IntersmashConfig.getProductCode(image); + } } public static String eap7Templates() { diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/Eap7ImageOpenShiftApplication.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/Eap7ImageOpenShiftApplication.java index b8d8fc168..fb39cd78e 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/Eap7ImageOpenShiftApplication.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/Eap7ImageOpenShiftApplication.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.application.openshift; import java.util.Collections; diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/Eap7TemplateOpenShiftApplication.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/Eap7TemplateOpenShiftApplication.java index dc4fe66f4..ed6ab6a93 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/Eap7TemplateOpenShiftApplication.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/Eap7TemplateOpenShiftApplication.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.application.openshift; import org.jboss.intersmash.tools.application.openshift.template.Eap7Template; diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/template/Eap7Template.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/template/Eap7Template.java index a7334f230..0b8b8f242 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/template/Eap7Template.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/application/openshift/template/Eap7Template.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.application.openshift.template; import org.jboss.intersmash.tools.provision.openshift.template.OpenShiftTemplate; diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7ImageOpenShiftProvisioner.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7ImageOpenShiftProvisioner.java index df8f584ed..337508671 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7ImageOpenShiftProvisioner.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7ImageOpenShiftProvisioner.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.provision.openshift; import java.util.ArrayList; diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7ImageOpenShiftProvisionerFactory.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7ImageOpenShiftProvisionerFactory.java index ee133dd6d..aeff738db 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7ImageOpenShiftProvisionerFactory.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7ImageOpenShiftProvisionerFactory.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.provision.openshift; import org.jboss.intersmash.tools.application.Application; diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7TemplateOpenShiftProvisioner.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7TemplateOpenShiftProvisioner.java index d1d07ed5e..080d246f4 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7TemplateOpenShiftProvisioner.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/Eap7TemplateOpenShiftProvisioner.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.provision.openshift; import java.util.Collections; diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/template/Eap7TemplateProvisioner.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/template/Eap7TemplateProvisioner.java index b97664000..6436f9d56 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/template/Eap7TemplateProvisioner.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/provision/openshift/template/Eap7TemplateProvisioner.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.provision.openshift.template; import java.io.IOException; @@ -98,16 +113,7 @@ public List deployImageStreams() { @Override public String getProductCode() { - final String image = IntersmashConfig.eap7ImageURL(); - if (image.matches(".*eap-xp\\d+.*")) { - return image.replaceFirst(".*eap-xp(\\d+).*", "eap-xp$1"); - } else if (image.contains("eap-cd")) { - return "eap-cd"; - } else if (image.matches(".*eap\\d\\d.*")) { - return image.replaceFirst(".*eap(\\d\\d?).*", "eap$1"); - } else { - return IntersmashConfig.getProductCode(image); - } + return IntersmashConfig.eap7ProductCode(); } /** diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/tls/CertificatesUtils.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/tls/CertificatesUtils.java index eaae70c93..79c198d0f 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/tls/CertificatesUtils.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/tls/CertificatesUtils.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.util.tls; import java.io.BufferedReader; diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/wildfly/Eap7CliScriptBuilder.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/wildfly/Eap7CliScriptBuilder.java index 6e6d5dd4f..7062c6f55 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/wildfly/Eap7CliScriptBuilder.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/wildfly/Eap7CliScriptBuilder.java @@ -1,3 +1,18 @@ +/** + * Copyright (C) 2023 Red Hat, Inc. + * + * 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 + * + * 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.jboss.intersmash.tools.util.wildfly; import java.util.List;