Clean autotest folder 46/3346/3
authorYongchaoWu <yongchao.wu@est.tech>
Tue, 21 Apr 2020 07:03:42 +0000 (09:03 +0200)
committeryongchao <yongchao.wu@est.tech>
Tue, 21 Apr 2020 11:18:12 +0000 (13:18 +0200)
remove unused code directory
rename autotest folder to "test"

Issue-ID: NONRTRIC-148
Signed-off-by: YongchaoWu <yongchao.wu@est.tech>
Change-Id: I484d22d87486d22f9b05a1631812a7f5194d3966

84 files changed:
near-rt-ric-simulator/nearric-service/.gitignore [deleted file]
near-rt-ric-simulator/nearric-service/pom.xml [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/ApplicationConfig.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/NearRicApplication.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/SwaggerConfiguration.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/controller/A1PApi.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/controller/A1PApiController.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/model/PolicyInstance.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/model/PolicyType.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/service/A1PApiService.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/service/A1PApiServiceImpl.java [deleted file]
near-rt-ric-simulator/nearric-service/src/main/resources/application.properties [deleted file]
near-rt-ric-simulator/nearric-service/test/.gitignore [deleted file]
near-rt-ric-simulator/nearric-service/test/pi-template.json [deleted file]
near-rt-ric-simulator/nearric-service/test/populate.sh [deleted file]
near-rt-ric-simulator/nearric-service/test/pt-template.json [deleted file]
near-rt-ric-simulator/nearric-service/test/test-api.sh [deleted file]
near-rt-ric-simulator/pom.xml [deleted file]
pom.xml
test/.gitignore [moved from near-rt-ric-simulator/.gitignore with 100% similarity]
test/LICENSES.txt [moved from near-rt-ric-simulator/LICENSES.txt with 100% similarity]
test/auto-test/.gitignore [moved from near-rt-ric-simulator/auto-test/.gitignore with 100% similarity]
test/auto-test/Dockerize_test.sh [moved from near-rt-ric-simulator/auto-test/Dockerize_test.sh with 100% similarity]
test/auto-test/FTC10.sh [moved from near-rt-ric-simulator/auto-test/FTC10.sh with 100% similarity]
test/auto-test/FTC100.sh [moved from near-rt-ric-simulator/auto-test/FTC100.sh with 100% similarity]
test/auto-test/FTC200.sh [moved from near-rt-ric-simulator/auto-test/FTC200.sh with 100% similarity]
test/auto-test/FTC300.sh [moved from near-rt-ric-simulator/auto-test/FTC300.sh with 100% similarity]
test/auto-test/FTC310.sh [moved from near-rt-ric-simulator/auto-test/FTC310.sh with 100% similarity]
test/auto-test/FTC320.sh [moved from near-rt-ric-simulator/auto-test/FTC320.sh with 100% similarity]
test/auto-test/FTC500.sh [moved from near-rt-ric-simulator/auto-test/FTC500.sh with 100% similarity]
test/auto-test/FTC_SDNC.sh [moved from near-rt-ric-simulator/auto-test/FTC_SDNC.sh with 100% similarity]
test/auto-test/README.md [moved from near-rt-ric-simulator/auto-test/README.md with 100% similarity]
test/auto-test/Suite-interfaces.sh [moved from near-rt-ric-simulator/auto-test/Suite-interfaces.sh with 100% similarity]
test/auto-test/testdata/OSC/1.json [moved from near-rt-ric-simulator/auto-test/testdata/OSC/1.json with 100% similarity]
test/auto-test/testdata/OSC/2.json [moved from near-rt-ric-simulator/auto-test/testdata/OSC/2.json with 100% similarity]
test/auto-test/testdata/OSC/pi1_template.json [moved from near-rt-ric-simulator/auto-test/testdata/OSC/pi1_template.json with 100% similarity]
test/auto-test/testdata/OSC/pi2_template.json [moved from near-rt-ric-simulator/auto-test/testdata/OSC/pi2_template.json with 100% similarity]
test/auto-test/testdata/OSC/sim_1.json [moved from near-rt-ric-simulator/auto-test/testdata/OSC/sim_1.json with 100% similarity]
test/auto-test/testdata/OSC/sim_2.json [moved from near-rt-ric-simulator/auto-test/testdata/OSC/sim_2.json with 100% similarity]
test/auto-test/testdata/STD/EMPTYTYPE.json [moved from near-rt-ric-simulator/auto-test/testdata/STD/EMPTYTYPE.json with 100% similarity]
test/auto-test/testdata/STD/pi1_template.json [moved from near-rt-ric-simulator/auto-test/testdata/STD/pi1_template.json with 100% similarity]
test/auto-test/utils/pa-logviewer.sh [moved from near-rt-ric-simulator/auto-test/utils/pa-logviewer.sh with 100% similarity]
test/common/README.md [moved from near-rt-ric-simulator/common/README.md with 100% similarity]
test/common/agent_api_functions.sh [moved from near-rt-ric-simulator/common/agent_api_functions.sh with 99% similarity]
test/common/compare_json.py [moved from near-rt-ric-simulator/common/compare_json.py with 100% similarity]
test/common/controller_api_functions.sh [moved from near-rt-ric-simulator/common/controller_api_functions.sh with 100% similarity]
test/common/count_json_elements.py [moved from near-rt-ric-simulator/common/count_json_elements.py with 100% similarity]
test/common/create_rics_json.py [moved from near-rt-ric-simulator/common/create_rics_json.py with 100% similarity]
test/common/do_curl_function.sh [moved from near-rt-ric-simulator/common/do_curl_function.sh with 100% similarity]
test/common/extract_sdnc_reply.py [moved from near-rt-ric-simulator/common/extract_sdnc_reply.py with 100% similarity]
test/common/ricsimulator_api_functions.sh [moved from near-rt-ric-simulator/common/ricsimulator_api_functions.sh with 100% similarity]
test/common/test_env.sh [moved from near-rt-ric-simulator/common/test_env.sh with 100% similarity]
test/common/testcase_common.sh [moved from near-rt-ric-simulator/common/testcase_common.sh with 100% similarity]
test/common/testsuite_common.sh [moved from near-rt-ric-simulator/common/testsuite_common.sh with 100% similarity]
test/cr/.gitignore [moved from near-rt-ric-simulator/cr/.gitignore with 100% similarity]
test/cr/Dockerfile [moved from near-rt-ric-simulator/cr/Dockerfile with 100% similarity]
test/cr/README.md [moved from near-rt-ric-simulator/cr/README.md with 100% similarity]
test/cr/basic_test.sh [moved from near-rt-ric-simulator/cr/basic_test.sh with 100% similarity]
test/cr/cr-build-start.sh [moved from near-rt-ric-simulator/cr/cr-build-start.sh with 100% similarity]
test/cr/cr.py [moved from near-rt-ric-simulator/cr/cr.py with 100% similarity]
test/cr/requirements.txt [moved from near-rt-ric-simulator/cr/requirements.txt with 100% similarity]
test/mrstub/.gitignore [moved from near-rt-ric-simulator/mrstub/.gitignore with 100% similarity]
test/mrstub/Dockerfile [moved from near-rt-ric-simulator/mrstub/Dockerfile with 100% similarity]
test/mrstub/README.md [moved from near-rt-ric-simulator/mrstub/README.md with 100% similarity]
test/mrstub/basic_test.sh [moved from near-rt-ric-simulator/mrstub/basic_test.sh with 100% similarity]
test/mrstub/mr.py [moved from near-rt-ric-simulator/mrstub/mr.py with 100% similarity]
test/mrstub/mrstub-build-start.sh [moved from near-rt-ric-simulator/mrstub/mrstub-build-start.sh with 100% similarity]
test/mrstub/requirements.txt [moved from near-rt-ric-simulator/mrstub/requirements.txt with 100% similarity]
test/simulator-group/.gitignore [moved from near-rt-ric-simulator/simulator-group/.gitignore with 100% similarity]
test/simulator-group/consul_cbs/consul/cbs_config.hcl [moved from near-rt-ric-simulator/simulator-group/consul_cbs/consul/cbs_config.hcl with 100% similarity]
test/simulator-group/consul_cbs/consul/cbs_localhost_config.hcl [moved from near-rt-ric-simulator/simulator-group/consul_cbs/consul/cbs_localhost_config.hcl with 100% similarity]
test/simulator-group/consul_cbs/docker-compose.yml [moved from near-rt-ric-simulator/simulator-group/consul_cbs/docker-compose.yml with 100% similarity]
test/simulator-group/consul_cbs/start.sh [moved from near-rt-ric-simulator/simulator-group/consul_cbs/start.sh with 100% similarity]
test/simulator-group/control_panel/docker-compose.yml [moved from near-rt-ric-simulator/simulator-group/control_panel/docker-compose.yml with 100% similarity]
test/simulator-group/cr/docker-compose.yml [moved from near-rt-ric-simulator/simulator-group/cr/docker-compose.yml with 100% similarity]
test/simulator-group/mr/docker-compose.yml [moved from near-rt-ric-simulator/simulator-group/mr/docker-compose.yml with 100% similarity]
test/simulator-group/policy_agent/docker-compose.yml [moved from near-rt-ric-simulator/simulator-group/policy_agent/docker-compose.yml with 100% similarity]
test/simulator-group/ric/.gitignore [moved from near-rt-ric-simulator/simulator-group/ric/.gitignore with 100% similarity]
test/simulator-group/ric/cleanConsul.py [moved from near-rt-ric-simulator/simulator-group/ric/cleanConsul.py with 100% similarity]
test/simulator-group/ric/docker-compose.yml [moved from near-rt-ric-simulator/simulator-group/ric/docker-compose.yml with 100% similarity]
test/simulator-group/ric/prepareConsul.py [moved from near-rt-ric-simulator/simulator-group/ric/prepareConsul.py with 100% similarity]
test/simulator-group/sdnc/docker-compose.yml [moved from near-rt-ric-simulator/simulator-group/sdnc/docker-compose.yml with 100% similarity]
test/simulator-group/sim-monitor-start.sh [moved from near-rt-ric-simulator/simulator-group/sim-monitor-start.sh with 100% similarity]
test/simulator-group/sim-monitor.js [moved from near-rt-ric-simulator/simulator-group/sim-monitor.js with 100% similarity]

diff --git a/near-rt-ric-simulator/nearric-service/.gitignore b/near-rt-ric-simulator/nearric-service/.gitignore
deleted file mode 100644 (file)
index b83d222..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/target/
diff --git a/near-rt-ric-simulator/nearric-service/pom.xml b/near-rt-ric-simulator/nearric-service/pom.xml
deleted file mode 100644 (file)
index dd21d57..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ============LICENSE_START=======================================================
-   Copyright (C) 2019 Nordix Foundation.
-  ================================================================================
-  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.
-
-  SPDX-License-Identifier: Apache-2.0
-  ============LICENSE_END=========================================================
--->
-<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/xsd/maven-4.0.0.xsd">
-       <modelVersion>4.0.0</modelVersion>
-       <parent>
-               <groupId>org.oran.nearric</groupId>
-               <artifactId>nearric-simulator</artifactId>
-               <version>1.0.0-SNAPSHOT</version>
-       </parent>
-       <artifactId>nearric-service</artifactId>
-       <name>${project.artifactId}</name>
-
-       <properties>
-               <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-               <okhttp-version>2.7.5</okhttp-version>
-               <gson-version>2.8.1</gson-version>
-               <dockerfile-maven-version>1.4.2</dockerfile-maven-version>
-       </properties>
-       <dependencies>
-               <dependency>
-                       <groupId>org.oran.nearric</groupId>
-                       <artifactId>a1-med-api</artifactId>
-                       <version>1.0.0-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-web</artifactId>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.springframework.boot</groupId>
-                                       <artifactId>spring-boot-starter-logging</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-data-jpa</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-actuator</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-starter-test</artifactId>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.springframework.boot</groupId>
-                       <artifactId>spring-boot-devtools</artifactId>
-                       <scope>runtime</scope>
-               </dependency>
-               <dependency>
-                       <groupId>junit</groupId>
-                       <artifactId>junit</artifactId>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>io.swagger</groupId>
-                       <artifactId>swagger-jaxrs</artifactId>
-                       <version>1.5.0</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.apache.directory.studio</groupId>
-                       <artifactId>org.apache.commons.io</artifactId>
-                       <version>2.4</version>
-               </dependency>
-               <dependency>
-                       <groupId>com.googlecode.json-simple</groupId>
-                       <artifactId>json-simple</artifactId>
-                       <version>1.1.1</version>
-               </dependency>
-
-               <dependency>
-                       <groupId>io.springfox</groupId>
-                       <artifactId>springfox-swagger-ui</artifactId>
-                       <version>2.6.1</version>
-                       <scope>compile</scope>
-               </dependency>
-               <dependency>
-                       <groupId>io.springfox</groupId>
-                       <artifactId>springfox-swagger2</artifactId>
-                       <version>2.6.1</version>
-                       <scope>compile</scope>
-               </dependency>
-               <dependency>
-                       <groupId>com.fasterxml.jackson.core</groupId>
-                       <artifactId>jackson-databind</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>com.h2database</groupId>
-                       <artifactId>h2</artifactId>
-               </dependency>
-               <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
-               <dependency>
-                       <groupId>commons-beanutils</groupId>
-                       <artifactId>commons-beanutils</artifactId>
-                       <version>1.9.3</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.modelmapper</groupId>
-                       <artifactId>modelmapper</artifactId>
-                       <version>2.3.0</version>
-               </dependency>
-               <dependency>
-                       <groupId>com.squareup.okio</groupId>
-                       <artifactId>okio</artifactId>
-                       <version>1.13.0</version>
-               </dependency>
-               <dependency>
-                       <groupId>com.squareup.okhttp</groupId>
-                       <artifactId>okhttp</artifactId>
-                       <version>${okhttp-version}</version>
-               </dependency>
-               <dependency>
-                       <groupId>com.squareup.okhttp</groupId>
-                       <artifactId>logging-interceptor</artifactId>
-                       <version>${okhttp-version}</version>
-               </dependency>
-               <dependency>
-                       <groupId>com.google.code.gson</groupId>
-                       <artifactId>gson</artifactId>
-                       <version>${gson-version}</version>
-               </dependency>
-        <dependency>
-            <groupId>com.github.java-json-tools</groupId>
-            <artifactId>json-schema-validator</artifactId>
-            <version>2.2.11</version>
-        </dependency>
-       </dependencies>
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.springframework.boot</groupId>
-                               <artifactId>spring-boot-maven-plugin</artifactId>
-                               <configuration>
-                                       <mainClass>org.onap.nearric.simulator.config.NearRicApplication</mainClass>
-                               </configuration>
-                               <executions>
-                                       <execution>
-                                               <goals>
-                                                       <goal>repackage</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                       </plugin>
-            <plugin>
-                <groupId>io.fabric8</groupId>
-                <artifactId>docker-maven-plugin</artifactId>
-                <version>0.30.0</version>
-                <configuration>
-                    <verbose>true</verbose>
-                    <!-- environment variables supplied by Jenkins -->
-                    <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
-                    <images>
-                        <image>
-                            <!-- Specify a tag to avoid default tag "latest" -->
-                            <!-- Avoid maven artifact name here -->
-                            <name>o-ran-sc/nonrtric-nearric-simulator:${project.version}</name>
-                            <build>
-                                <from>openjdk:11-jre-slim</from>
-                                <tags>
-                                    <!-- Add tag with build number -->
-                                    <tag>${project.version}</tag>
-                                </tags>
-                                <assembly>
-                                    <descriptorRef>artifact</descriptorRef>
-                                </assembly>
-                                <cmd>
-                                    <!-- Include maven dir on classpath for prop files -->
-                                    <exec>
-                                        <arg>java</arg>
-                                        <arg>-Xms128m</arg>
-                                        <arg>-Xmx256m</arg>
-                                        <arg>-cp</arg>
-                                        <arg>maven:maven/${project.artifactId}-${project.version}.${project.packaging}</arg>
-                                        <arg>-Dloader.main=org.onap.nearric.simulator.config.NearRicApplication</arg>
-                                        <arg>-Djava.security.egd=file:/dev/./urandom</arg>
-                                        <arg>org.springframework.boot.loader.PropertiesLauncher</arg>
-                                    </exec>
-                                </cmd>
-                            </build>
-                        </image>
-                    </images>
-                </configuration>
-                <!-- build Docker images in install phase, push in deploy phase -->
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>build</goal>
-                            <goal>push</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <dependencies>
-                    <dependency>
-                        <groupId>javax.activation</groupId>
-                        <artifactId>activation</artifactId>
-                        <version>1.1.1</version>
-                    </dependency>
-                </dependencies>
-            </plugin>
-               </plugins>
-       </build>
-</project>
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/ApplicationConfig.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/ApplicationConfig.java
deleted file mode 100644 (file)
index 3c634cc..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.nearric.simulator.config;
-
-import java.util.HashMap;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * This class provides all the configuration for the Spring boot application
- * 
- * @author lathishbabu.ganesan@est.tech
- *
- */
-@Configuration
-public class ApplicationConfig {
-
-  private final HashMap<Integer, Object> policyTypeCache = new HashMap<>();
-
-  @Bean
-  public HashMap<Integer, Object> getPolicyTypeCache() {
-    return policyTypeCache;
-  }
-
-}
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/NearRicApplication.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/NearRicApplication.java
deleted file mode 100644 (file)
index 5b21d1a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.nearric.simulator.config;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.ComponentScan;
-
-/**
- * This is the Spring Boot Application
- * 
- * @author lathishbabu.ganesan@est.tech
- *
- */
-
-@SpringBootApplication
-@ComponentScan({"org.oransc", "org.onap"})
-@EnableCaching
-public class NearRicApplication {
-  public static void main(final String[] args) {
-    SpringApplication.run(NearRicApplication.class, args);
-  }
-}
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/SwaggerConfiguration.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/config/SwaggerConfiguration.java
deleted file mode 100644 (file)
index f77c189..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.nearric.simulator.config;
-
-import org.onap.nearric.simulator.controller.A1PApiController;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-/**
- * This class provides all the configuration for the Spring boot application
- * 
- * @author lathishbabu.ganesan@est.tech
- *
- */
-@Configuration
-@EnableSwagger2
-public class SwaggerConfiguration {
-  @Bean
-  public Docket apiDocket() {
-    return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage("org.onap.nearric.simulator"))
-        .paths(PathSelectors.any()).build();
-  }
-
-}
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/controller/A1PApi.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/controller/A1PApi.java
deleted file mode 100644 (file)
index 4f8b31e..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-/**
- * NOTE: This class is auto generated by the swagger code generator program (3.0.8).
- * https://github.com/swagger-api/swagger-codegen
- * Do not edit the class manually.
- */
-package org.onap.nearric.simulator.controller;
-
-import org.oransc.ric.a1med.api.model.InlineResponse200;
-import org.oransc.ric.a1med.api.model.PolicyTypeSchema;
-import io.swagger.annotations.*;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RequestPart;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2019-10-04T13:41:42.802+01:00[Europe/Dublin]")
-@Api(value = "a1-p", description = "the a1-p API")
-public interface A1PApi {
-
-    @ApiOperation(value = "", nickname = "a1ControllerCreateOrReplacePolicyInstance", notes = "Create or replace a policy instance of type policy_type_id. The schema of the PUT body is defined by the create_schema field of the policy type. ", tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 201, message = "Policy instance created "),
-        @ApiResponse(code = 400, message = "Bad PUT body for this policy instance "),
-        @ApiResponse(code = 404, message = "There is no policy type with this policy_type_id ") })
-    @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}",
-        consumes = { "application/json" },
-        method = RequestMethod.PUT)
-    ResponseEntity<Void> a1ControllerCreateOrReplacePolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId,@ApiParam(value = ""  )  @Valid @RequestBody Object body);
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerCreatePolicyType", notes = "Create a new policy type . Replace is not currently allowed; to replace, for now do a DELETE and then a PUT again. ", tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 201, message = "policy type successfully created"),
-        @ApiResponse(code = 400, message = "illegal ID, or object already existed") })
-    @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}",
-        consumes = { "application/json" },
-        method = RequestMethod.PUT)
-    ResponseEntity<Void> a1ControllerCreatePolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = ""  )  @Valid @RequestBody PolicyTypeSchema body);
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerDeletePolicyInstance", notes = "Delete this policy instance ", tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 204, message = "policy instance successfully deleted "),
-        @ApiResponse(code = 404, message = "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id ") })
-    @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}",
-        method = RequestMethod.DELETE)
-    ResponseEntity<Void> a1ControllerDeletePolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId);
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerDeletePolicyType", notes = "Delete this policy type. Can only be performed if there are no instances of this type ", tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 204, message = "policy type successfully deleted "),
-        @ApiResponse(code = 400, message = "Policy type cannot be deleted because there are instances All instances must be removed before a policy type can be deleted "),
-        @ApiResponse(code = 404, message = "policy type not found ") })
-    @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}",
-        method = RequestMethod.DELETE)
-    ResponseEntity<Void> a1ControllerDeletePolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId);
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerGetAllInstancesForType", notes = "get a list of all policy instance ids for this policy type id", response = String.class, responseContainer = "List", tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 200, message = "list of all policy instance ids for this policy type id", response = String.class, responseContainer = "List") })
-    @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies",
-        produces = { "application/json" }, 
-        method = RequestMethod.GET)
-    ResponseEntity<List<String>> a1ControllerGetAllInstancesForType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId);
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerGetAllPolicyTypes", notes = "Get a list of all registered policy type ids", response = Integer.class, responseContainer = "List", tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 200, message = "list of all registered policy type ids", response = Integer.class, responseContainer = "List") })
-    @RequestMapping(value = "/a1-p/policytypes/",
-        produces = { "application/json" }, 
-        method = RequestMethod.GET)
-    ResponseEntity<List<Integer>> a1ControllerGetAllPolicyTypes();
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerGetHealthcheck", notes = "Perform a healthcheck on a1 ", tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 200, message = "A1 is healthy. Anything other than a 200 should be considered a1 as failing ") })
-    @RequestMapping(value = "/a1-p/healthcheck",
-        method = RequestMethod.GET)
-    ResponseEntity<Void> a1ControllerGetHealthcheck();
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerGetPolicyInstance", notes = "Retrieve the policy instance ", response = Object.class, tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 200, message = "The policy instance. the schema of this object is defined by the create_schema field of the policy type ", response = Object.class),
-        @ApiResponse(code = 404, message = "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id ") })
-    @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}",
-        produces = { "application/json" }, 
-        method = RequestMethod.GET)
-    ResponseEntity<Object> a1ControllerGetPolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId);
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerGetPolicyInstanceStatus", notes = "Retrieve the policy instance status across all handlers of the policy ", response = InlineResponse200.class, responseContainer = "List", tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 200, message = "The policy instance status. Returns a vector of statuses, where each contains a handler_id (opaque id of a RIC component that implements this policy) and the policy status as returned by that handler ", response = InlineResponse200.class, responseContainer = "List"),
-        @ApiResponse(code = 404, message = "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id ") })
-    @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}/status",
-        produces = { "application/json" }, 
-        method = RequestMethod.GET)
-    ResponseEntity<List<InlineResponse200>> a1ControllerGetPolicyInstanceStatus(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId);
-
-
-    @ApiOperation(value = "", nickname = "a1ControllerGetPolicyType", notes = "Get this policy type ", response = PolicyTypeSchema.class, tags={ "A1 Mediator", })
-    @ApiResponses(value = { 
-        @ApiResponse(code = 200, message = "policy type successfully found", response = PolicyTypeSchema.class),
-        @ApiResponse(code = 404, message = "policy type not found ") })
-    @RequestMapping(value = "/a1-p/policytypes/{policy_type_id}",
-        produces = { "application/json" }, 
-        method = RequestMethod.GET)
-    ResponseEntity<PolicyTypeSchema> a1ControllerGetPolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId);
-
-}
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/controller/A1PApiController.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/controller/A1PApiController.java
deleted file mode 100644 (file)
index d33e6c6..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.nearric.simulator.controller;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
-
-import org.apache.commons.beanutils.BeanUtils;
-import org.onap.nearric.simulator.model.PolicyType;
-import org.onap.nearric.simulator.service.A1PApiServiceImpl;
-import org.oransc.ric.a1med.api.model.InlineResponse200;
-import org.oransc.ric.a1med.api.model.PolicyTypeSchema;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-import io.swagger.annotations.ApiParam;
-
-/**
- * This class provides all the operation performed by A1 API.
- * 
- * @author lathishbabu.ganesan@est.tech
- *
- */
-@RestController
-public class A1PApiController implements A1PApi {
-
-  private static final Logger log = LoggerFactory.getLogger(A1PApiController.class);
-
-  private final ObjectMapper objectMapper;
-
-  private final HttpServletRequest request;
-
-  //@Autowired
-  private A1PApiServiceImpl a1pApiService;
-  //private A1PApiService a1pApiService;
-
-  @Autowired
-  public A1PApiController(ObjectMapper objectMapper, HttpServletRequest request) {
-      this.objectMapper = objectMapper;
-      this.request = request;
-      a1pApiService = new A1PApiServiceImpl();
-      a1pApiService.set(objectMapper, request);
-  }
-
-  //Reset policy db
-  @RequestMapping(value = "reset",
-          method = RequestMethod.GET)
-  public void reset() {
-         a1pApiService.reset();
-  }
-  
-  public ResponseEntity<Void> a1ControllerCreateOrReplacePolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId,@ApiParam(value = ""  )  @Valid @RequestBody Object body) {
-      return a1pApiService.createReplaceInstance(policyTypeId, policyInstanceId, body);
-  }
-
-  public ResponseEntity<Void> a1ControllerCreatePolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = ""  )  @Valid @RequestBody PolicyTypeSchema body) {
-       return a1pApiService.createReplaceType(policyTypeId, body);
-  }
-
-  public ResponseEntity<Void> a1ControllerDeletePolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId) {
-       return a1pApiService.deleteInstance(policyTypeId, policyInstanceId);
-  }
-
-  public ResponseEntity<Void> a1ControllerDeletePolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId) {
-       return a1pApiService.deleteType(policyTypeId);
-  }
-
-  public ResponseEntity<List<String>> a1ControllerGetAllInstancesForType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId) {
-      return a1pApiService.getAllInstanceForType(policyTypeId);
-  }
-
-  public ResponseEntity<List<Integer>> a1ControllerGetAllPolicyTypes() {
-       return a1pApiService.getAllTypes();
-  }
-
-  public ResponseEntity<Void> a1ControllerGetHealthcheck() {
-      return new ResponseEntity<Void>(HttpStatus.OK);
-  }
-
-  public ResponseEntity<Object> a1ControllerGetPolicyInstance(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId) {
-      return a1pApiService.getPolicyInstance(policyTypeId, policyInstanceId);
-  }
-
-  public ResponseEntity<List<InlineResponse200>> a1ControllerGetPolicyInstanceStatus(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId,@ApiParam(value = "",required=true) @PathVariable("policy_instance_id") String policyInstanceId) {
-       return a1pApiService.getStatus(policyTypeId, policyInstanceId);
-  }
-
-  public ResponseEntity<PolicyTypeSchema> a1ControllerGetPolicyType(@ApiParam(value = "",required=true) @PathVariable("policy_type_id") Integer policyTypeId) {
-      return a1pApiService.getPolicyTypeSchema(policyTypeId);
-  }
-
-}
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/model/PolicyInstance.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/model/PolicyInstance.java
deleted file mode 100644 (file)
index ca797d4..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.nearric.simulator.model;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-
-  public class PolicyInstance implements Serializable {
-    /**
-     * 
-     */
-    private static final long serialVersionUID = -4903894058377154039L;
-       private String policyInstanceId;
-       private Object jsonObject;
-       
-       public PolicyInstance(String policyInstanceId, Object jsonObject) {
-               this.policyInstanceId = policyInstanceId;
-               this.jsonObject = jsonObject;
-       }
-
-       public Object getJson() {
-               return jsonObject;
-       }
-       
-       public String getInstanceId() {
-               return policyInstanceId;
-       }
-}
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/model/PolicyType.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/model/PolicyType.java
deleted file mode 100644 (file)
index 5429cab..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.nearric.simulator.model;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Set;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-import org.oransc.ric.a1med.api.model.PolicyTypeSchema;
-
-public class PolicyType implements Serializable {
-
-       /**
-        * 
-        */
-       private static final long serialVersionUID = 8719589957000170141L;
-       private Integer policyTypeId;
-       private PolicyTypeSchema policyTypeSchema;
-       private HashMap<String, PolicyInstance> policyInstances = new HashMap<String, PolicyInstance>();
-
-       public PolicyType(Integer policyTypeId, PolicyTypeSchema policyTypeSchema) {
-               this.policyTypeId = policyTypeId;
-               this.policyTypeSchema = policyTypeSchema;
-       }
-
-       public int getNumberInstances() {
-               return policyInstances.size();
-       }
-
-       public PolicyInstance getInstance(String policyInstanceId) {
-               return policyInstances.get(policyInstanceId);
-       }
-
-       public void delete(String policyInstanceId) {
-               policyInstances.remove(policyInstanceId);
-       }
-
-       public PolicyTypeSchema getSchema() {
-               return policyTypeSchema;
-       }
-
-       public void createReplaceInstance(String policyTypeId, PolicyInstance policyInstance) {
-               policyInstances.put(policyTypeId, policyInstance);
-       }
-
-       public Set<String> getInstances() {
-               return policyInstances.keySet();
-       }
-
-       public Integer getTypeId() {
-               return policyTypeId;
-       }
-
-}
\ No newline at end of file
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/service/A1PApiService.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/service/A1PApiService.java
deleted file mode 100644 (file)
index b875ec7..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.nearric.simulator.service;
-
-import org.onap.nearric.simulator.model.PolicyType;
-import org.oransc.ric.a1med.api.model.PolicyTypeSchema;
-
-/**
- * @author lathishbabu.ganesan@est.tech
- *
- */
-
-public interface A1PApiService {
-
-  public void getHealthCheck();
-
-  public void getPolicyTypes();
-
-  public PolicyType getPolicyType(Integer policyTypeId);
-
-  public void deletePolicyTypeId();
-
-  public void putPolicyType(Integer policyTypeId, PolicyTypeSchema policyTypeSchema);
-
-  public void getPolicyInstances();
-
-  public void getPolicyInstanceId();
-
-  public void deletePolicyInstanceId();
-
-  public void putPolicyInstance(Integer policyTypeId, String policyInstanceId, Object body);
-
-  public void getPolicyInstanceIdStatus();
-
-}
diff --git a/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/service/A1PApiServiceImpl.java b/near-rt-ric-simulator/nearric-service/src/main/java/org/onap/nearric/simulator/service/A1PApiServiceImpl.java
deleted file mode 100644 (file)
index a79cfa4..0000000
+++ /dev/null
@@ -1,460 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.nearric.simulator.service;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.onap.nearric.simulator.model.PolicyInstance;
-import org.onap.nearric.simulator.model.PolicyType;
-import org.oransc.ric.a1med.api.model.InlineResponse200;
-import org.oransc.ric.a1med.api.model.PolicyTypeSchema;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.github.fge.jackson.JsonLoader;
-import com.github.fge.jsonschema.core.exceptions.ProcessingException;
-import com.github.fge.jsonschema.core.report.ProcessingMessage;
-import com.github.fge.jsonschema.core.report.ProcessingReport;
-import com.github.fge.jsonschema.main.JsonSchema;
-import com.github.fge.jsonschema.main.JsonSchemaFactory;
-
-/**
- * This class provides the service implementation of all the A1 operation
- * 
- * @author lathishbabu.ganesan@est.tech
- *
- */
-
-@Service
-public class A1PApiServiceImpl {
-
-       private static final Logger log = LoggerFactory.getLogger(A1PApiServiceImpl.class);
-
-       private HashMap<String, PolicyType> policyTypes = new HashMap<String, PolicyType>();
-
-       private ObjectMapper objectMapper = null;
-
-       private HttpServletRequest request = null;
-
-       public boolean validateSchema(String jsonData, String jsonSchema) {
-               ProcessingReport report = null;
-               boolean result = false;
-               try {
-                       log.info("Applying schema: @<@<" + jsonSchema + ">@>@ to data: #<#<" + jsonData + ">#>#");
-                       JsonNode schemaNode = JsonLoader.fromString(jsonSchema);
-                       JsonNode data = JsonLoader.fromString(jsonData);
-                       JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
-                       JsonSchema schema = factory.getJsonSchema(schemaNode);
-                       report = schema.validate(data);
-               } catch (JsonParseException jpex) {
-                       log.info("Error. Something went wrong trying to parse json data: #<#<" + jsonData
-                                       + ">#># or json schema: @<@<" + jsonSchema + ">@>@. Are the double quotes included? "
-                                       + jpex.getMessage());
-               } catch (ProcessingException pex) {
-                       log.info("Error. Something went wrong trying to process json data: #<#<" + jsonData
-                                       + ">#># with json schema: @<@<" + jsonSchema + ">@>@ " + pex.getMessage());
-               } catch (IOException e) {
-                       log.info("Error. Something went wrong trying to read json data: #<#<" + jsonData
-                                       + ">#># or json schema: @<@<" + jsonSchema + ">@>@");
-               }
-               if (report != null) {
-                       Iterator<ProcessingMessage> iter = report.iterator();
-                       while (iter.hasNext()) {
-                               ProcessingMessage pm = iter.next();
-                               log.info("Processing Message: " + pm.getMessage());
-                       }
-                       result = report.isSuccess();
-               }
-               log.info("Result=" + result);
-               return result;
-       }
-
-       public A1PApiServiceImpl() {
-       }
-
-       public void set(ObjectMapper objectMapper, HttpServletRequest request) {
-               this.objectMapper = objectMapper;
-               this.request = request;
-       }
-       
-    public void reset() {
-       log.info("Resetting db");
-       policyTypes.clear();
-    }
-
-       public ResponseEntity<Void> createReplaceType(Integer policyTypeId, PolicyTypeSchema policyTypeSchema) {
-               log.info("createReplaceType - policyTypeId: " + policyTypeId);
-               log.info("createReplaceType - policyTypeSchema: " + policyTypeSchema);
-
-               if (policyTypeId == null || policyTypeSchema == null || policyTypeSchema.getName() == null) {
-                       log.info("createReplaceType - bad parameters");
-                       return new ResponseEntity<Void>(HttpStatus.BAD_REQUEST);
-               }
-
-               if (policyTypeSchema.getPolicyTypeId().intValue() != policyTypeId.intValue()) {
-                       log.info("createReplaceType - policytype id mismatch between request and policyTypeSchema");
-                       return new ResponseEntity<Void>(HttpStatus.BAD_REQUEST);
-               }
-
-               if (policyTypes.containsKey(policyTypeId.toString())) {
-                       log.info("createReplaceType - policytype already exists");
-                       return new ResponseEntity<Void>(HttpStatus.BAD_REQUEST);
-               }
-
-               PolicyType policyType = new PolicyType(policyTypeId, policyTypeSchema);
-               policyTypes.put(policyTypeId.toString(), policyType);
-               log.info("createReplaceType - created ok");
-
-               return new ResponseEntity<Void>(HttpStatus.CREATED);
-       }
-
-       public ResponseEntity<Void> deleteType(Integer policyTypeId) {
-               log.info("deleteType - policyTypeId: " + policyTypeId);
-
-               if (policyTypeId == null) {
-                       log.info("deleteType - bad parameter");
-                       return new ResponseEntity<Void>(HttpStatus.BAD_REQUEST);
-               }
-
-               PolicyType policyType = policyTypes.get(policyTypeId.toString());
-
-               if (policyType == null) {
-                       log.info("deleteType - policytype does not exists");
-                       return new ResponseEntity<Void>(HttpStatus.NOT_FOUND);
-               }
-
-               if (policyType.getNumberInstances() > 0) {
-                       log.info("deleteType - cannot delete, instances exists");
-                       return new ResponseEntity<Void>(HttpStatus.BAD_REQUEST);
-               }
-               policyTypes.remove(policyTypeId.toString());
-
-               log.info("deleteType - deleted ok");
-               return new ResponseEntity<Void>(HttpStatus.NO_CONTENT);
-       }
-
-       public ResponseEntity<Void> deleteInstance(Integer policyTypeId, String policyInstanceId) {
-
-               log.info("deleteInstance - policyTypeId: " + policyTypeId);
-               log.info("deleteInstance - policyInstanceId: " + policyInstanceId);
-
-               if (policyTypeId == null || policyInstanceId == null) {
-                       log.info("deleteInstance - bad parameters");
-                       return new ResponseEntity<Void>(HttpStatus.NOT_FOUND);
-               }
-
-               PolicyType policyType = policyTypes.get(policyTypeId.toString());
-
-               if (policyType == null) {
-                       log.info("deleteType - policytype does not exists");
-                       return new ResponseEntity<Void>(HttpStatus.NOT_FOUND);
-               }
-               PolicyInstance policyInstance = policyType.getInstance(policyInstanceId);
-               if (policyInstance == null) {
-                       log.info("deleteType - instance does not exists");
-                       return new ResponseEntity<Void>(HttpStatus.NOT_FOUND);
-               }
-               policyType.delete(policyInstanceId);
-
-               log.info("deleteInstance - deleted ok");
-               return new ResponseEntity<Void>(HttpStatus.NO_CONTENT);
-
-       }
-
-       public ResponseEntity<PolicyTypeSchema> getPolicyTypeSchema(Integer policyTypeId) {
-               log.info("getPolicyTypeSchema - policyTypeId: " + policyTypeId);
-
-               if (policyTypeId == null) {
-                       log.info("getPolicyTypeSchema - bad parameter");
-                       return new ResponseEntity<PolicyTypeSchema>(HttpStatus.NOT_FOUND);
-               }
-
-               String accept = request.getHeader("Accept");
-               if (accept != null && accept.contains("application/json")) {
-                       String res = null;
-                       try {
-                               PolicyType policyType = policyTypes.get(policyTypeId.toString());
-
-                               if (policyType == null) {
-                                       log.info("getPolicyTypeSchema - policytype does not exists");
-                                       return new ResponseEntity<PolicyTypeSchema>(HttpStatus.NOT_FOUND);
-                               }
-
-                               String json = null;
-                               PolicyTypeSchema schema = policyType.getSchema();
-                               String createSchema = "{}";
-                               try {
-                                       // Convert Map to JSON
-                                       json = objectMapper.writeValueAsString(schema);
-                                       // Print JSON output
-                                       log.info("getPolicyTypeSchema - schema: " + json);
-
-                                       createSchema = objectMapper.writeValueAsString(schema.getCreateSchema());
-                                       log.info("getPolicyTypeSchema - createSchema: " + createSchema);
-                               } catch (Exception e) {
-                                       e.printStackTrace();
-                                       log.info("getPolicyTypeSchema - schema corrupt");
-                                       return new ResponseEntity<PolicyTypeSchema>(HttpStatus.INTERNAL_SERVER_ERROR);
-                               }
-                               res = "{\n  \"name\" : \"" + schema.getName() + "\",\n  \"description\" : \"" + schema.getDescription()
-                                               + "\",\n  \"create_schema\" : " + createSchema + ",\n  \"policy_type_id\" : "
-                                               + schema.getPolicyTypeId().intValue() + "\n}";
-                               log.info("getPolicyTypeSchema - json schema: " + res);
-                               return new ResponseEntity<PolicyTypeSchema>(objectMapper.readValue(res, PolicyTypeSchema.class),
-                                               HttpStatus.OK);
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                               log.info("getPolicyTypeSchema - Couldn't serialize response for content type application/json");
-                               return new ResponseEntity<PolicyTypeSchema>(HttpStatus.INTERNAL_SERVER_ERROR);
-                       }
-               }
-               log.info("getPolicyTypeSchema - not implemented");
-               return new ResponseEntity<PolicyTypeSchema>(HttpStatus.NOT_IMPLEMENTED);
-       }
-
-       public ResponseEntity<List<Integer>> getAllTypes() {
-               log.info("getAllTypes");
-               
-               String accept = request.getHeader("Accept");
-               if (accept != null && accept.contains("application/json")) {
-                       try {
-                               Set<String> types = policyTypes.keySet();
-                               String res = "";
-                               for (Iterator<String> iterator = types.iterator(); iterator.hasNext();) {
-                                       String tid = (String) iterator.next();
-                                       if (res.length() > 0) {
-                                               res = res + ",";
-                                       }
-                                       res = res + tid;
-                               }
-                               return new ResponseEntity<List<Integer>>(objectMapper.readValue("[" + res + "]", List.class),
-                                               HttpStatus.OK);
-                       } catch (IOException e) {
-                               e.printStackTrace();
-                               log.info("getAllTypes - Couldn't serialize response for content type application/json");
-                               return new ResponseEntity<List<Integer>>(HttpStatus.INTERNAL_SERVER_ERROR);
-                       }
-               }
-               log.info("getAllTypes - not implemented");
-               return new ResponseEntity<List<Integer>>(HttpStatus.NOT_IMPLEMENTED);
-       }
-
-       public ResponseEntity<Void> createReplaceInstance(Integer policyTypeId, String policyInstanceId, Object body) {
-               log.info("createReplaceInstance -  policyTypeId:" + policyTypeId);
-               log.info("createReplaceInstance -  policyInstanceId:" + policyInstanceId);
-               log.info("createReplaceInstance -  body:" + body);
-
-               if (policyTypeId == null || policyInstanceId == null || body == null) {
-                       log.info("createReplaceInstance - bad parameter");
-                       return new ResponseEntity<Void>(HttpStatus.BAD_REQUEST);
-               }
-
-               log.info("createReplaceInstance -  bodyclass:" + body.getClass().toString());
-
-               PolicyType policyType = policyTypes.get(policyTypeId.toString());
-
-               if (policyType == null) {
-                       log.info("createReplaceInstance - policytype does not exists");
-                       return new ResponseEntity<Void>(HttpStatus.NOT_FOUND);
-               }
-
-               // Create json string from schema
-               String createSchema = null;
-               try {
-                       PolicyTypeSchema schema = policyType.getSchema();
-                       // Convert Map to JSON
-                       String json = objectMapper.writeValueAsString(schema);
-                       // Print JSON output
-                       log.info("createReplaceInstance - schema - json: " + json);
-                       createSchema = objectMapper.writeValueAsString(schema.getCreateSchema());
-                       log.info("createReplaceInstance - createSchema - string: " + createSchema);
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       log.info("createReplaceInstance - schema corrupt");
-                       return new ResponseEntity<Void>(HttpStatus.INTERNAL_SERVER_ERROR);
-               }
-
-               // Create json string from instance
-               String jsonInstance = null;
-               try {
-                       log.info("createReplaceInstance - raw: " + body);
-                       // Convert Map to JSON
-                       jsonInstance = objectMapper.writeValueAsString(body);
-                       // Print JSON output
-                       log.info("createReplaceInstance - instance: " + jsonInstance);
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       log.info("createReplaceInstance - instancce corrupt");
-                       return new ResponseEntity<Void>(HttpStatus.INTERNAL_SERVER_ERROR);
-               }
-
-               if (!validateSchema(jsonInstance, createSchema)) {
-                       log.info("createReplaceInstance - schema validation failed");
-                       return new ResponseEntity<Void>(HttpStatus.BAD_REQUEST);
-               }
-               PolicyInstance policyInstance = new PolicyInstance(policyInstanceId, body);
-               policyType.createReplaceInstance(policyInstanceId, policyInstance);
-
-               log.info("createReplaceInstance - created/replaced ok");
-               return new ResponseEntity<Void>(HttpStatus.CREATED);
-
-       }
-
-       public ResponseEntity<List<String>> getAllInstanceForType(Integer policyTypeId) {
-               log.info("getAllInstanceForType -  policyTypeId:" + policyTypeId);
-
-               if (policyTypeId == null) {
-                       log.info("getAllInstanceForType - bad parameter");
-                       return new ResponseEntity<List<String>>(HttpStatus.NOT_FOUND);
-               }
-
-               String accept = request.getHeader("Accept");
-               if (accept != null && accept.contains("application/json")) {
-                       try {
-                               PolicyType policyType = policyTypes.get(policyTypeId.toString());
-                               if (policyType == null) {
-                                       log.info("getAllInstanceForType - policytype does not exists");
-                                       return new ResponseEntity<List<String>>(HttpStatus.NOT_FOUND);
-                               }
-                               Set<String> instances = policyType.getInstances();
-                               String res = "";
-                               for (Iterator iterator = instances.iterator(); iterator.hasNext();) {
-                                       String iid = (String) iterator.next();
-                                       iid = "\"" + iid + "\"";
-                                       if (res.length() > 0) {
-                                               res = res + ",";
-                                       }
-                                       res = res + iid;
-                               }
-                               log.info("getAllInstanceForType - " + res);
-                               return new ResponseEntity<List<String>>(objectMapper.readValue("[" + res + "]", List.class),
-                                               HttpStatus.OK);
-                       } catch (IOException e) {
-                               e.printStackTrace();
-                               log.info("getAllInstanceForType - Couldn't serialize response for content type application/json");
-                               return new ResponseEntity<List<String>>(HttpStatus.INTERNAL_SERVER_ERROR);
-                       }
-               }
-               log.info("getAllInstanceForType - not implemented");
-               return new ResponseEntity<List<String>>(HttpStatus.NOT_IMPLEMENTED);
-
-       }
-
-       public ResponseEntity<Object> getPolicyInstance(Integer policyTypeId, String policyInstanceId) {
-               log.info("getPolicyInstance -  policyTypeId:" + policyTypeId);
-               log.info("getPolicyInstance -  policyInstanceId:" + policyInstanceId);
-
-               if (policyTypeId == null || policyInstanceId == null) {
-                       log.info("getPolicyInstance - bad parameter");
-                       return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-               }
-
-               String accept = request.getHeader("Accept");
-               if (accept != null && accept.contains("application/json")) {
-                       try {
-                               PolicyType policyType = policyTypes.get(policyTypeId.toString());
-                               if (policyType == null) {
-                                       log.info("getPolicyInstance - policytype does not exists");
-                                       return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-                               }
-                               PolicyInstance policyInstance = policyType.getInstance(policyInstanceId);
-                               if (policyInstance == null) {
-                                       log.info("getPolicyInstance - policyinstance does not exists");
-                                       return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
-                               }
-
-                               String json = null;
-                               try {
-                                       log.info("getPolicyInstance - rawschema: " + policyInstance.getJson());
-                                       // Convert Map to JSON
-                                       json = objectMapper.writeValueAsString(policyInstance.getJson());
-                                       // Print JSON output
-                                       log.info("getPolicyInstance - schema: " + json);
-
-                               } catch (Exception e) {
-                                       e.printStackTrace();
-                                       log.info("getPolicyInstance - schema corrupt");
-                                       return new ResponseEntity<Object>(HttpStatus.INTERNAL_SERVER_ERROR);
-                               }
-
-                               return new ResponseEntity<Object>(objectMapper.readValue(json, Object.class), HttpStatus.OK);
-                       } catch (IOException e) {
-                               e.printStackTrace();
-                               log.info("getPolicyInstance - policyinstance corrupt");
-                               return new ResponseEntity<Object>(HttpStatus.INTERNAL_SERVER_ERROR);
-                       }
-               }
-
-               return new ResponseEntity<Object>(HttpStatus.NOT_IMPLEMENTED);
-       }
-
-       public ResponseEntity<List<InlineResponse200>> getStatus(Integer policyTypeId, String policyInstanceId) {
-               log.info("getStatus -  policyTypeId:" + policyTypeId);
-               log.info("getStatus -  policyInstanceId:" + policyInstanceId);
-
-               if (policyTypeId == null || policyInstanceId == null) {
-                       log.info("getStatus - bad parameters");
-                       return new ResponseEntity<List<InlineResponse200>>(HttpStatus.NOT_FOUND);
-               }
-
-               String accept = request.getHeader("Accept");
-               if (accept != null && accept.contains("application/json")) {
-                       try {
-                               PolicyType policyType = policyTypes.get(policyTypeId.toString());
-                               if (policyType == null) {
-                                       log.info("getStatus - policytype does not exists");
-                                       return new ResponseEntity<List<InlineResponse200>>(HttpStatus.NOT_FOUND);
-                               }
-                               PolicyInstance policyInstance = policyType.getInstance(policyInstanceId);
-                               if (policyInstance == null) {
-                                       log.info("getStatus - policyinstance does not exists");
-                                       return new ResponseEntity<List<InlineResponse200>>(HttpStatus.NOT_FOUND);
-                               }
-
-                               return new ResponseEntity<List<InlineResponse200>>(
-                                               objectMapper.readValue("[ {\n  \"handler_id\" : \"NearRTRIC-1\",\n  \"status\" : \"enforced\"\n} ]",
-                                                               List.class),
-                                               HttpStatus.OK);
-                       } catch (IOException e) {
-                               e.printStackTrace();
-                               log.info("getStatus - Couldn't serialize response for content type application/json");
-                               return new ResponseEntity<List<InlineResponse200>>(HttpStatus.INTERNAL_SERVER_ERROR);
-                       }
-               }
-
-               return new ResponseEntity<List<InlineResponse200>>(HttpStatus.NOT_IMPLEMENTED);
-       }
-
-}
diff --git a/near-rt-ric-simulator/nearric-service/src/main/resources/application.properties b/near-rt-ric-simulator/nearric-service/src/main/resources/application.properties
deleted file mode 100644 (file)
index b6c85b5..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# ========================LICENSE_START=================================
-# %%
-# Copyright (C) 2019 Nordix Foundation
-# %%
-# 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.
-# ========================LICENSE_END===================================
-spring.security.user.name=admin
-spring.security.user.password=admin
-spring.jackson.property-naming-strategy=SNAKE_CASE
\ No newline at end of file
diff --git a/near-rt-ric-simulator/nearric-service/test/.gitignore b/near-rt-ric-simulator/nearric-service/test/.gitignore
deleted file mode 100644 (file)
index aab4112..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.tmp*
diff --git a/near-rt-ric-simulator/nearric-service/test/pi-template.json b/near-rt-ric-simulator/nearric-service/test/pi-template.json
deleted file mode 100644 (file)
index a6c6bdc..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-{ "scope": {"ue_id": "1","flow_id": "3"},
-  "statement" : {"gfbr": "l", "mfbr": "2", "priority_level": "3", "pdb": "4"},
-  "policy_id": "pi-XXXX"
-}
\ No newline at end of file
diff --git a/near-rt-ric-simulator/nearric-service/test/populate.sh b/near-rt-ric-simulator/nearric-service/test/populate.sh
deleted file mode 100755 (executable)
index 378fee8..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-echo "Usage: populate.sh [<host:port>]"
-
-HOST_PORT="localhost:8080"
-
-if [ $# == 1 ]; then
-       echo "Setting host and port from cmd line: "$1
-       HOST_PORT=$1
-fi
-
-echo "======================================="
-echo "Using host and port:" $HOST_PORT
-echo "======================================="
-
-
-PT_MAX=10
-PI_MAX=20
-PI_ID=0
-pt=0
-while [ $pt -lt $PT_MAX ]; do
-    pi=0
-    PATTERN="s/XXXX/${pt}/g"
-    sed $PATTERN pt-template.json > .tmp.json
-    curl -v -X PUT --header 'Content-Type: application/json' --header 'Accept: */*' -d @.tmp.json 'http://'$HOST_PORT'/a1-p/policytypes/'$pt
-    while [ $pi -lt $PI_MAX ]; do  
-        echo $pt"--"$pi"-"$PI_ID
-        
-        PATTERN="s/XXXX/${PI_ID}/g"
-        sed $PATTERN pi-template.json > .tmp.json
-        curl -v -X PUT --header 'Content-Type: application/json' --header 'Accept: */*' -d @.tmp.json 'http://'$HOST_PORT'/a1-p/policytypes/'$pt'/policies/'$PI_ID
-        let pi=pi+1
-        let PI_ID=PI_ID+1
-    done
-    let pt=pt+1
-done
-
-curl -v --header 'Accept: application/json'  'http://'$HOST_PORT'/a1-p/policytypes/'
-curl -v --header 'Accept: application/json'  'http://'$HOST_PORT'/a1-p/policytypes/1/policies'
diff --git a/near-rt-ric-simulator/nearric-service/test/pt-template.json b/near-rt-ric-simulator/nearric-service/test/pt-template.json
deleted file mode 100644 (file)
index 8fa16b1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-{
-  "description": "Policy type XXXX",
-  "name": "PT XXXX",
-  "policy_type_id": XXXX,
-  "create_schema":
-
-
-  {
-    "$id": "https://est.tech/policy-type.schema.json",
-    "$schema": "http://json-schema.org/draft-07/schema#",
-    "title": "Policy type schema XXXX",
-    "description": "Policy type schema for qos",
-    "type": "object",
-    "properties": {
-      "policy_id": {
-        "description": "Identity of the policy",
-        "type": "string"},
-      "scope": {
-        "type": "object",
-        "properties": {
-          "ue_id": {
-            "description": "User identity",
-            "type": "string"},
-          "flow_id": {
-            "description": "Identity of the flow",
-            "type": "string"}
-        }, "required": ["ue_id", "flow_id"]
-      },
-      "statement": {
-        "type": "object",
-        "properties": {
-          "gfbr": {
-            "description": "Guaranteed Flow Bit Rate",
-            "type": "string"},
-          "mfbr": {
-            "description": "Maximum Flow Bit Rate",
-            "type": "string"},
-          "priority_level": {
-            "description": "Priority Level",
-            "type": "string"},
-          "pdb": {
-            "description": "Packet Delay Budget",
-            "type": "string"}
-        }, "required": ["gfbr", "mfbr", "priority_level", "pdb"]
-      }
-    }, "required": ["policy_id", "scope", "statement"]
-  }
-
-}
diff --git a/near-rt-ric-simulator/nearric-service/test/test-api.sh b/near-rt-ric-simulator/nearric-service/test/test-api.sh
deleted file mode 100755 (executable)
index fd6b1d0..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/bin/bash
-
-#Script for basic testing of the A1 simulator API
-#Note: policy is reset before test
-
-HOST_PORT="localhost:8080"
-
-echo "Usage: populate.sh [<host:port>]"
-
-HOST_PORT="localhost:8080"
-
-if [ $# == 1 ]; then
-       echo "Setting host and port from cmd line: "$1
-       HOST_PORT=$1
-fi
-
-echo "======================================="
-echo "Using host and port:" $HOST_PORT
-echo "======================================="
-
-echo "======================================="
-echo "Resetting db"
-curl 'http://'$HOST_PORT'/reset'
-echo "======================================="
-
-#Create a policy type
-create_pt() {
-    PATTERN="s/XXXX/${1}/g"
-    sed $PATTERN pt-template.json > .tmp.json
-    res=$(curl -sw "%{http_code}" -X PUT --header 'Content-Type: application/json' --header 'Accept: */*' -d @.tmp.json 'http://'${HOST_PORT}'/a1-p/policytypes/'$1)
-       http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code
-}
-
-get_pt() {
-    res=$(curl -sw "%{http_code}" --header 'Accept: application/json'  'http://'${HOST_PORT}'/a1-p/policytypes/'$1)
-    http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code
-    echo "Response: " ${res:0:${#res}-3}
-}
-
-get_pts() {
-    res=$(curl -sw "%{http_code}" --header 'Accept: application/json'  'http://'${HOST_PORT}'/a1-p/policytypes/')
-    http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code
-    echo "Response: " ${res:0:${#res}-3}
-}
-
-del_pt() {
-    res=$(curl -sw "%{http_code}" -X DELETE --header 'Accept: */*'  'http://'${HOST_PORT}'/a1-p/policytypes/'$1)
-    http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code  
-}
-
-get_pis() {
-    res=$(curl -sw "%{http_code}" --header 'Accept: application/json'  'http://'${HOST_PORT}'/a1-p/policytypes/'${1}'/policies')
-    http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code
-    echo "Response: " ${res:0:${#res}-3}
-}
-
-create_pi() {
-    PATTERN="s/XXXX/${2}/g"
-    sed $PATTERN pi-template.json > .tmp.json
-    res=$(curl -sw "%{http_code}" -X PUT --header 'Content-Type: application/json' --header 'Accept: */*' -d @.tmp.json 'http://'${HOST_PORT}'/a1-p/policytypes/'$1'/policies/'$2)
-    http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code
-}
-
-get_pi() {
-    res=$(curl -sw "%{http_code}" --header 'Accept: application/json'  'http://'${HOST_PORT}'/a1-p/policytypes/'${1}'/policies/'$2)
-    http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code
-    echo "Response: " ${res:0:${#res}-3}
-}
-
-del_pi() {
-    res=$(curl -sw "%{http_code}" -X DELETE --header 'Accept: application/json'  'http://'${HOST_PORT}'/a1-p/policytypes/'${1}'/policies/'$2)
-    http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code 
-}
-
-stat_pi() {
-    res=$(curl -sw "%{http_code}" --header 'Accept: application/json'  'http://'${HOST_PORT}'/a1-p/policytypes/'${1}'/policies/'$2'/status')
-    http_code="${res:${#res}-3}"
-    echo "Response code: " $http_code
-    echo "Response: " ${res:0:${#res}-3}
-}
-
-
-echo "== Create policy type 23"
-create_pt 23
-echo "== Get policy type 23"
-get_pt 23
-echo "== Create policy type 23 again"
-create_pt 23
-echo "== Create policy type 24"
-create_pt 24
-echo "== Get all policy types"
-get_pts
-echo "== Delete policy type 24"
-del_pt 24
-echo "== Delete policy type 24 again"
-del_pt 24
-echo "== Get all policy types"
-get_pts
-echo "== Get all policy instancess for type 23"
-get_pis 23
-echo "== Create policy instance 16 for type 23"
-create_pi 23 16
-echo "== Create policy instance 16 for type 23 again"
-create_pi 23 16
-echo "== Get policy instance 16 for type 23"
-get_pi 23 16
-echo "== Get missing policy instance 17 for type 23"
-get_pi 23 17
-echo "== Create policy instance 18 for type 23"
-create_pi 23 18
-echo "== Get all policy instances for type 23"
-get_pis 23
-echo "== Delete policy instance 18 for type 23"
-del_pi 23 18
-echo "== Get all policy instances for type 23"
-get_pis 23
-echo "== Get status for policy instance 16 for type 23"
-stat_pi 23 16
diff --git a/near-rt-ric-simulator/pom.xml b/near-rt-ric-simulator/pom.xml
deleted file mode 100644 (file)
index 5836853..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ============LICENSE_START=======================================================
-   Copyright (C) 2019 Nordix Foundation.
-  ================================================================================
-  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.
-
-  SPDX-License-Identifier: Apache-2.0
-  ============LICENSE_END=========================================================
--->
-
-<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/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.oran.nearric</groupId>
-  <artifactId>nearric-simulator</artifactId>
-  <version>1.0.1-SNAPSHOT</version>
-  <packaging>pom</packaging>
-  <name>${project.artifactId}</name>
-
-  <parent>
-    <groupId>org.springframework.boot</groupId>
-    <artifactId>spring-boot-starter-parent</artifactId>
-    <version>2.1.9.RELEASE</version>
-    <relativePath />
-  </parent>
-
-  <properties>
-    <spring.boot.version>2.1.9.RELEASE</spring.boot.version>
-    <java.version>11</java.version>
-    <docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>
-  </properties>
-
-  <dependencyManagement>
-    <dependencies>
-      <dependency>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-dependencies</artifactId>
-        <version>${spring.boot.version}</version>
-        <type>pom</type>
-        <scope>import</scope>
-      </dependency>
-    </dependencies>
-  </dependencyManagement>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-context</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-web</artifactId>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <release>${java.version}</release>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/pom.xml b/pom.xml
index 840cb0f..facc920 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,6 @@
     <modules>
         <module>policy-agent</module>
         <module>sdnc-a1-controller</module>
-        <module>near-rt-ric-simulator</module>
     </modules>
     <build>
         <plugins>
similarity index 99%
rename from near-rt-ric-simulator/common/agent_api_functions.sh
rename to test/common/agent_api_functions.sh
index fbcf240..312eacb 100644 (file)
@@ -126,7 +126,7 @@ __do_curl_to_agent() {
             file=" --data-binary "$payload
         fi
                #urlencode the request url since it will be carried by send-request url
-               requestUrl=$(python -c "import urllib, sys; print urllib.quote(sys.argv[1])"  "$2")
+               requestUrl=$(python -c "from __future__ import print_function; import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))"  "$2")
         url=" "${ADAPTER}"/send-request?url="${requestUrl}"&operation="${oper}
         curlString="curl -X POST${timeout}${httpcode}${content}${url}${file}"
         echo " CMD: "$curlString >> $HTTPLOG
similarity index 100%
rename from near-rt-ric-simulator/cr/cr.py
rename to test/cr/cr.py