From 6a5868d17a07e3679628b9f7411249d685581e24 Mon Sep 17 00:00:00 2001 From: Wu Sheng Date: Fri, 21 Jun 2024 23:40:33 +0800 Subject: [PATCH] Remove Oracle scenario from testing. --- .github/workflows/plugins-test.3.yaml | 1 - .../scenarios/oracle-scenario/bin/startup.sh | 21 --- .../oracle-scenario/config/expectedData.yaml | 113 -------------- .../oracle-scenario/configuration.yml | 30 ---- test/plugin/scenarios/oracle-scenario/pom.xml | 121 --------------- .../src/main/assembly/assembly.xml | 41 ------ .../apm/testcase/oracle/Application.java | 34 ----- .../oracle/controller/CaseController.java | 139 ------------------ .../src/main/resources/application.yaml | 23 --- .../src/main/resources/log4j2.xml | 30 ---- .../oracle-scenario/support-version.list | 17 --- 11 files changed, 570 deletions(-) delete mode 100644 test/plugin/scenarios/oracle-scenario/bin/startup.sh delete mode 100644 test/plugin/scenarios/oracle-scenario/config/expectedData.yaml delete mode 100644 test/plugin/scenarios/oracle-scenario/configuration.yml delete mode 100644 test/plugin/scenarios/oracle-scenario/pom.xml delete mode 100644 test/plugin/scenarios/oracle-scenario/src/main/assembly/assembly.xml delete mode 100644 test/plugin/scenarios/oracle-scenario/src/main/java/org/apache/skywalking/apm/testcase/oracle/Application.java delete mode 100644 test/plugin/scenarios/oracle-scenario/src/main/java/org/apache/skywalking/apm/testcase/oracle/controller/CaseController.java delete mode 100644 test/plugin/scenarios/oracle-scenario/src/main/resources/application.yaml delete mode 100644 test/plugin/scenarios/oracle-scenario/src/main/resources/log4j2.xml delete mode 100644 test/plugin/scenarios/oracle-scenario/support-version.list diff --git a/.github/workflows/plugins-test.3.yaml b/.github/workflows/plugins-test.3.yaml index e687161731..264529fdd3 100644 --- a/.github/workflows/plugins-test.3.yaml +++ b/.github/workflows/plugins-test.3.yaml @@ -92,7 +92,6 @@ jobs: - gateway-3.x-scenario - gateway-3.x-filter-context-scenario - neo4j-4.x-scenario - - oracle-scenario - druid-1.x-scenario - hikaricp-scenario - clickhouse-0.3.1-scenario diff --git a/test/plugin/scenarios/oracle-scenario/bin/startup.sh b/test/plugin/scenarios/oracle-scenario/bin/startup.sh deleted file mode 100644 index a8f932fa0d..0000000000 --- a/test/plugin/scenarios/oracle-scenario/bin/startup.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# -# 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. - -home="$(cd "$(dirname $0)"; pwd)" - -java -jar ${agent_opts} ${home}/../libs/oracle-scenario.jar & \ No newline at end of file diff --git a/test/plugin/scenarios/oracle-scenario/config/expectedData.yaml b/test/plugin/scenarios/oracle-scenario/config/expectedData.yaml deleted file mode 100644 index 91df4be88d..0000000000 --- a/test/plugin/scenarios/oracle-scenario/config/expectedData.yaml +++ /dev/null @@ -1,113 +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. -segmentItems: -- serviceName: oracle-scenario - segmentSize: ge 1 - segments: - - segmentId: not null - spans: - - operationName: Oracle/JDBC/Statement/execute - parentSpanId: 0 - spanId: 1 - spanLayer: Database - startTime: nq 0 - endTime: nq 0 - componentId: 34 - isError: false - spanType: Exit - peer: oracle-server:1521 - tags: - - {key: db.type, value: Oracle} - - {key: db.instance, value: xe} - - key: db.statement - value: "CREATE TABLE test_007(\nid VARCHAR(1) PRIMARY KEY, \nvalue VARCHAR(1)\ - \ NOT NULL)" - skipAnalysis: 'false' - - operationName: Oracle/JDBC/PreparedStatement/execute - parentSpanId: 0 - spanId: 2 - spanLayer: Database - startTime: nq 0 - endTime: nq 0 - componentId: 34 - isError: false - spanType: Exit - peer: oracle-server:1521 - tags: - - {key: db.type, value: Oracle} - - {key: db.instance, value: xe} - - {key: db.statement, value: 'INSERT INTO test_007(id, value) VALUES(?,?)'} - skipAnalysis: 'false' - - operationName: Oracle/JDBC/PreparedStatement/executeQuery - parentSpanId: 0 - spanId: 3 - spanLayer: Database - startTime: nq 0 - endTime: nq 0 - componentId: 34 - isError: false - spanType: Exit - peer: oracle-server:1521 - tags: - - {key: db.type, value: Oracle} - - {key: db.instance, value: xe} - - {key: db.statement, value: 'SELECT id, value FROM test_007 WHERE id=?'} - skipAnalysis: 'false' - - operationName: Oracle/JDBC/Statement/execute - parentSpanId: 0 - spanId: 4 - spanLayer: Database - startTime: nq 0 - endTime: nq 0 - componentId: 34 - isError: false - spanType: Exit - peer: oracle-server:1521 - tags: - - {key: db.type, value: Oracle} - - {key: db.instance, value: xe} - - {key: db.statement, value: DROP table test_007} - skipAnalysis: 'false' - - operationName: Oracle/JDBC/Connection/close - parentSpanId: 0 - spanId: 5 - spanLayer: Database - tags: - - {key: db.type, value: Oracle} - - {key: db.instance, value: xe} - - {key: db.statement, value: ''} - startTime: nq 0 - endTime: nq 0 - componentId: 34 - isError: false - spanType: Exit - peer: oracle-server:1521 - skipAnalysis: 'false' - - operationName: GET:/oracle-scenario/case/oracle - parentSpanId: -1 - spanId: 0 - spanLayer: Http - startTime: nq 0 - endTime: nq 0 - componentId: 1 - isError: false - spanType: Entry - peer: '' - tags: - - {key: url, value: 'http://localhost:8080/oracle-scenario/case/oracle'} - - {key: http.method, value: GET} - - {key: http.status_code, value: '200'} - skipAnalysis: 'false' diff --git a/test/plugin/scenarios/oracle-scenario/configuration.yml b/test/plugin/scenarios/oracle-scenario/configuration.yml deleted file mode 100644 index 0b112b9e7b..0000000000 --- a/test/plugin/scenarios/oracle-scenario/configuration.yml +++ /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. - -type: jvm -entryService: http://localhost:8080/oracle-scenario/case/oracle -healthCheck: http://localhost:8080/oracle-scenario/case/healthCheck -startScript: ./bin/startup.sh -environment: - - oracle.address=oracle-server:1521 - - oracle.username=system - - oracle.password=oracle -dependencies: - oracle-server: - image: deepdiver/docker-oracle-xe-11g - hostname: oracle-server - expose: - - "1521" diff --git a/test/plugin/scenarios/oracle-scenario/pom.xml b/test/plugin/scenarios/oracle-scenario/pom.xml deleted file mode 100644 index ed087a9cca..0000000000 --- a/test/plugin/scenarios/oracle-scenario/pom.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - org.apache.skywalking.apm.testcase - oracle-scenario - 1.0.0 - jar - - 4.0.0 - - - UTF-8 - 1.8 - 3.8.1 - - 10.2.0.4.0 - - 2.1.6.RELEASE - - - skywalking-oracle-scenario - - - - - org.springframework.boot - spring-boot-dependencies - ${spring.boot.version} - pom - import - - - - - - - com.oracle - ojdbc14 - ${test.framework.version} - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-logging - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - - - - oracle-scenario - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.boot.version} - - - - repackage - - - - - - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${compiler.version} - ${compiler.version} - ${project.build.sourceEncoding} - - - - org.apache.maven.plugins - maven-assembly-plugin - - - assemble - package - - single - - - - src/main/assembly/assembly.xml - - ./target/ - - - - - - - diff --git a/test/plugin/scenarios/oracle-scenario/src/main/assembly/assembly.xml b/test/plugin/scenarios/oracle-scenario/src/main/assembly/assembly.xml deleted file mode 100644 index 9e4db94d75..0000000000 --- a/test/plugin/scenarios/oracle-scenario/src/main/assembly/assembly.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - zip - - - - - ./bin - 0775 - - - - - - ${project.build.directory}/oracle-scenario.jar - ./libs - 0775 - - - diff --git a/test/plugin/scenarios/oracle-scenario/src/main/java/org/apache/skywalking/apm/testcase/oracle/Application.java b/test/plugin/scenarios/oracle-scenario/src/main/java/org/apache/skywalking/apm/testcase/oracle/Application.java deleted file mode 100644 index 31bce49f55..0000000000 --- a/test/plugin/scenarios/oracle-scenario/src/main/java/org/apache/skywalking/apm/testcase/oracle/Application.java +++ /dev/null @@ -1,34 +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.skywalking.apm.testcase.oracle; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class Application { - - public static void main(String[] args) { - try { - SpringApplication.run(Application.class, args); - } catch (Exception e) { - // Never do this - } - } -} diff --git a/test/plugin/scenarios/oracle-scenario/src/main/java/org/apache/skywalking/apm/testcase/oracle/controller/CaseController.java b/test/plugin/scenarios/oracle-scenario/src/main/java/org/apache/skywalking/apm/testcase/oracle/controller/CaseController.java deleted file mode 100644 index c3bb2d2aa9..0000000000 --- a/test/plugin/scenarios/oracle-scenario/src/main/java/org/apache/skywalking/apm/testcase/oracle/controller/CaseController.java +++ /dev/null @@ -1,139 +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.skywalking.apm.testcase.oracle.controller; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import javax.annotation.PostConstruct; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@RequestMapping("/case") -public class CaseController { - - private static final Logger LOGGER = LogManager.getLogger(CaseController.class); - - @Value("${oracle.address}") - private String oracleHostAndPort; - - @Value("${oracle.username}") - private String oracleUsername; - - @Value("${oracle.password}") - private String oraclePassword; - - private String connectURL; - private static final String TEST_EXIST_SQL = "SELECT * FROM dual"; - private static final String CREATE_TABLE_SQL = "CREATE TABLE test_007(\n" + "id VARCHAR(1) PRIMARY KEY, \n" + "value VARCHAR(1) NOT NULL)"; - private static final String INSERT_DATA_SQL = "INSERT INTO test_007(id, value) VALUES(?,?)"; - private static final String QUERY_DATA_SQL = "SELECT id, value FROM test_007 WHERE id=?"; - private static final String DROP_TABLE_SQL = "DROP table test_007"; - - private static final String SUCCESS = "Success"; - - @PostConstruct - public void setUp() throws ClassNotFoundException { - Class.forName("oracle.jdbc.driver.OracleDriver"); - connectURL = "jdbc:oracle:thin:@" + oracleHostAndPort + ":xe"; - } - - @RequestMapping("/oracle") - @ResponseBody - public String testcase() { - Connection connection = null; - try { - // create table by using statement - connection = DriverManager.getConnection(connectURL, oracleUsername, oraclePassword); - Statement statement = connection.createStatement(); - statement.execute(CREATE_TABLE_SQL); - statement.close(); - - // insert table by using PreparedStatement - PreparedStatement insertDataPreparedStatement = connection.prepareStatement(INSERT_DATA_SQL); - insertDataPreparedStatement.setString(1, "1"); - insertDataPreparedStatement.setString(2, "1"); - insertDataPreparedStatement.execute(); - insertDataPreparedStatement.close(); - - // query data by using PreparedStatement - PreparedStatement queryDataPreparedStatement = connection.prepareStatement(QUERY_DATA_SQL); - queryDataPreparedStatement.setString(1, "1"); - ResultSet resultSet = queryDataPreparedStatement.executeQuery(); - resultSet.next(); - LOGGER.info("Query id[{}]: value={}", "1", resultSet.getString(2)); - queryDataPreparedStatement.close(); - - // drop table by using statement - Statement dropTableStatement = connection.createStatement(); - dropTableStatement.execute(DROP_TABLE_SQL); - dropTableStatement.close(); - } catch (SQLException e) { - String message = "Failed to execute sql"; - LOGGER.error(message); - throw new RuntimeException(message); - } finally { - if (connection != null) { - try { - connection.close(); - } catch (SQLException e) { - String message = "Failed to close connection"; - LOGGER.error(message); - throw new RuntimeException(message); - } - } - } - return SUCCESS; - } - - @RequestMapping("/healthCheck") - @ResponseBody - public String healthCheck() { - Connection connection = null; - try { - connection = DriverManager.getConnection(connectURL, oracleUsername, oraclePassword); - PreparedStatement preparedStatement = connection.prepareStatement(TEST_EXIST_SQL); - preparedStatement.execute(); - preparedStatement.close(); - } catch (SQLException e) { - String message = "Failed to execute sql"; - LOGGER.error(message); - throw new RuntimeException(message); - } finally { - if (connection != null) { - try { - connection.close(); - } catch (SQLException e) { - String message = "Failed to close connection"; - LOGGER.error(message); - throw new RuntimeException(message); - } - } - } - return SUCCESS; - } -} diff --git a/test/plugin/scenarios/oracle-scenario/src/main/resources/application.yaml b/test/plugin/scenarios/oracle-scenario/src/main/resources/application.yaml deleted file mode 100644 index 3bf1f53f66..0000000000 --- a/test/plugin/scenarios/oracle-scenario/src/main/resources/application.yaml +++ /dev/null @@ -1,23 +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. -# -# -server: - port: 8080 - servlet: - context-path: /oracle-scenario -logging: - config: classpath:log4j2.xml \ No newline at end of file diff --git a/test/plugin/scenarios/oracle-scenario/src/main/resources/log4j2.xml b/test/plugin/scenarios/oracle-scenario/src/main/resources/log4j2.xml deleted file mode 100644 index 9849ed5a8a..0000000000 --- a/test/plugin/scenarios/oracle-scenario/src/main/resources/log4j2.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/plugin/scenarios/oracle-scenario/support-version.list b/test/plugin/scenarios/oracle-scenario/support-version.list deleted file mode 100644 index 58b2e2f6dd..0000000000 --- a/test/plugin/scenarios/oracle-scenario/support-version.list +++ /dev/null @@ -1,17 +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. - -10.2.0.4.0