diff options
Diffstat (limited to 'cmso-service/src/test/resources')
-rw-r--r-- | cmso-service/src/test/resources/application-test.properties | 47 | ||||
-rw-r--r-- | cmso-service/src/test/resources/application.properties | 144 | ||||
-rw-r--r-- | cmso-service/src/test/resources/data-h2.sql | 8 | ||||
-rw-r--r-- | cmso-service/src/test/resources/schema-h2.sql | 233 | ||||
-rw-r--r-- | cmso-service/src/test/resources/testConfig.xml | 92 |
5 files changed, 524 insertions, 0 deletions
diff --git a/cmso-service/src/test/resources/application-test.properties b/cmso-service/src/test/resources/application-test.properties new file mode 100644 index 0000000..e32b8db --- /dev/null +++ b/cmso-service/src/test/resources/application-test.properties @@ -0,0 +1,47 @@ +#-------------------------------------------------------------------------------
+# Copyright 2017-2018 AT&T Intellectual Property.
+# Modifications Copyright 2018 IBM.
+#
+# 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.
+#
+#
+# Unless otherwise specified, all documentation contained herein is licensed
+# under the Creative Commons License, Attribution 4.0 Intl. (the ??License?);
+# you may not use this documentation except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://creativecommons.org/licenses/by/4.0/
+#
+# Unless required by applicable law or agreed to in writing, documentation
+# 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.
+#-------------------------------------------------------------------------------
+
+info.build.artifact=@project.artifactId@
+info.build.name=@project.name@
+info.build.description=@project.description@
+info.build.version=@project.version@
+
+spring.jersey.type=filter
+
+logging.level.root=info
+logging.level.org.glassfish=info
+logging.level.org.glassfish.jersey=info
+
+spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+
+logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex
+
+cmso.aaf.enabled=false
diff --git a/cmso-service/src/test/resources/application.properties b/cmso-service/src/test/resources/application.properties new file mode 100644 index 0000000..1ddf6c8 --- /dev/null +++ b/cmso-service/src/test/resources/application.properties @@ -0,0 +1,144 @@ +#-------------------------------------------------------------------------------
+# Copyright 2017-2018 AT&T Intellectual Property.
+# Modifications Copyright 2018 IBM.
+#
+# 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.
+#
+#
+# Unless otherwise specified, all documentation contained herein is licensed
+# under the Creative Commons License, Attribution 4.0 Intl. (the ??License?);
+# you may not use this documentation except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://creativecommons.org/licenses/by/4.0/
+#
+# Unless required by applicable law or agreed to in writing, documentation
+# 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.
+#-------------------------------------------------------------------------------
+
+info.build.artifact=@project.artifactId@
+info.build.name=@project.name@
+info.build.description=@project.description@
+info.build.version=@project.version@
+
+spring.jersey.type=filter
+
+logging.level.root=info
+logging.level.org.glassfish=info
+logging.level.org.glassfish.jersey=info
+
+spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+
+test.datasource.url=jdbc:h2:file:./h2db;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=true;MODE=MYSQL
+test.datasource.driver-class-name=org.h2.Driver
+test.datasource.username=sa
+test.datasource.password=sa
+
+test.datasource.initialize=false
+test.datasource.tomcat.max-wait=10000
+test.datasource.tomcat.initialSize=5
+test.datasource.tomcat.max-active=25
+test.datasource.tomcat.test-on-borrow=true
+
+test.jpa.show-sql=false
+test.jpa.hibernate.ddl-auto=none
+test.jpa.hibernate.naming.strategy=org.hibernate.cfg.EJB3NamingStrategy
+test.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
+test.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
+
+logging.pattern.console=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr($ threadId: {PID:- }){magenta} %clr(---){faint} %clr([ hostname: %X{hostname} serviceName: %X{serviceName} version: %X{version} transactionId: %X{transactionId} requestTimeStamp: %X{requestTimestamp} responseTimeStamp: %X{responseTimestamp} duration: %X{duration}]){yellow} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wex
+
+cmso.aaf.enabled=false
+
+# Enable swagger - Enable in development and test only
+cmso.swagger.enabled=true
+
+# Do not validate workflow name. Best effort will be used to create ticket
+# Expectation is that missing attributes will be provided in the DomainData
+cmso.allowUnknownWorkflowNames = true
+
+# Enable schedule immediate to be dispatched without ticket approvals
+# Has no effect when in vTM loopback mode as always approved.
+cmso.cm.dispatch.immediate.enabled = true
+
+# NUmber of seconds between sniro dispatch jobs
+cmso.sniro.job.interval.ms=10000
+
+# NUmber of seconds between change management cmso polling jobs
+# Controls frequenct of polling to the ChangeManagementScheduler table...
+cmso.cm.polling.job.interval.ms=10000
+# How many management cmso polling intervals to look ahead to dispatch
+# (To account for possible latency of the polling job)
+cmso.cm.polling.job.lookahead.intervals=5
+# Lead time before event time to enable dispatcher to
+# test that it is safe to dispatch (i.e. meeting reminder lead time)
+cmso.cm.dispatcher.lead.time.ms=5000
+# Lead time to prepare and call VID to dispatch work to MSO
+# Includes latency from VID call to the start of the workflow
+cmso.cm.dispatch.lead.time.ms=1000
+
+# sniro info
+cmso.sniro.maxAttempts=20
+#cmso.sniro.url=https://zldcmtc1njcoll01.homer.att.com:14699/sniro/api/v2/cmso
+#cmso.sniroCMSchedulerUsername=test1
+#cmso.sniroCMSchedulerPassword=enc:zZAbyhJhxJjqIrXNiXRl2g==
+#cmso.sniro.callbackurl=http://mtanjv9sdlg10.aic.cip.att.com:8089/cmso/v1/ChangeManagement/sniroCallback
+
+## loopback settings
+cmso.sniro.url=http://localhost:8089/cmso/v1/loopbacktest/sniro
+cmso.sniroCMSchedulerUsername=cmso@onap.org
+cmso.sniroCMSchedulerPassword=enc:bfodXf8qRfCqMvlxVBYNWQ==
+cmso.sniro.callbackurl=http://localhost:8089/cmso/v1/ChangeManagement/sniroCallback
+
+org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
+
+vid.loopback.mso.requestId=dummy123
+
+mso.polling.interval.ms=10000
+#mso.user=cmso@onap.org
+#mso.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==
+
+## loopback settings
+mso.url=http://localhost:8089/cmso/v1/loopbacktest/mso
+mso.user=cmso@onap.org
+mso.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==
+
+vtm.vnfs.per.ticket=1
+
+vtm.url=http://localhost:8089/cmso/v1/loopbacktest/
+vtm.listPath=30673/vtm/searchChangeRecord/v1/listChangeRecords
+vtm.fetchQuestionnairePath=30673/vtm/searchChangeRecord/v1/getCheckListQuestionnaires
+vtm.createPath=31219/vtm/createChangeRecord/v1/createChangeRecord
+vtm.closePath=31127/vtm/manageChangeRecord/v1/closeCancelChangeRecord
+vtm.updatePath=31127/vtm/manageChangeRecord/v1/updateChangeRecord
+vtm.updateQuestionnairePath=31127/vtm/manageChangeRecord/v1/updateCheckListQuestionnaires
+
+vtm.user=cmso@onap.org
+vtm.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==
+vtm.template.folder=data/templates/vtm
+
+####
+# configure the vTM ticket states that will allow a schedule to be dispatched
+# FOrmat:
+# <approvalStatus>|<status>,<approvalStatus>|<status>
+# Approval Required|Assigned is the state of a ticket when it is created by Scheduler
+vtm.approvalStatus=Approved|Scheduled,Approved|Assigned
+
+mechid.user=cmso@onap.org
+mechid.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==
+
+vid.user=cmso@onap.org
+vid.pass=enc:bfodXf8qRfCqMvlxVBYNWQ==
diff --git a/cmso-service/src/test/resources/data-h2.sql b/cmso-service/src/test/resources/data-h2.sql new file mode 100644 index 0000000..6c52d3b --- /dev/null +++ b/cmso-service/src/test/resources/data-h2.sql @@ -0,0 +1,8 @@ + +DELETE FROM DOMAINS; + +INSERT INTO DOMAINS (`domain`) VALUES ('ChangeManagement'); + +DELETE FROM APPROVAL_TYPES; + +INSERT INTO APPROVAL_TYPES (`domain`, `approval_type`, `approval_count`) VALUES ('ChangeManagement', 'Tier 2', '1');
\ No newline at end of file diff --git a/cmso-service/src/test/resources/schema-h2.sql b/cmso-service/src/test/resources/schema-h2.sql new file mode 100644 index 0000000..a9e5a04 --- /dev/null +++ b/cmso-service/src/test/resources/schema-h2.sql @@ -0,0 +1,233 @@ +DROP TABLE IF EXISTS CHANGE_MANAGEMENT_CHANGE_WINDOWS; +DROP TABLE IF EXISTS DOMAIN_DATA; +DROP TABLE IF EXISTS SCHEDULE_APPROVALS; +DROP TABLE IF EXISTS CHANGE_MANAGEMENT_RELATED_ASSETS; +DROP TABLE IF EXISTS CHANGE_MANAGEMENT_SCHEDULES; +DROP TABLE IF EXISTS CHANGE_MANAGEMENT_GROUPS; +DROP TABLE IF EXISTS SCHEDULE_EVENTS; +DROP TABLE IF EXISTS SCHEDULES; +DROP TABLE IF EXISTS APPROVAL_TYPES; +DROP TABLE IF EXISTS DOMAINS; + +-- ----------------------------------------------------- +-- Table DOMAINS +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS DOMAINS ( + domain VARCHAR(256) NOT NULL, + CONSTRAINT PK_DOMAINS PRIMARY KEY (domain) +) ENGINE=INNODB; + +CREATE UNIQUE INDEX DOMAIN_UNIQUE ON DOMAINS (domain ASC); + + +-- ----------------------------------------------------- +-- Table SCHEDULES +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS SCHEDULES ( + id INT NOT NULL AUTO_INCREMENT, + domain VARCHAR(256) NOT NULL, + schedule_id VARCHAR(256) NULL, + schedule_name VARCHAR(256) NULL, + user_id VARCHAR(45) NULL, + status VARCHAR(45) NOT NULL, + create_date_time BIGINT NULL, + schedule_info MEDIUMTEXT NOT NULL, + schedule MEDIUMTEXT NULL, + optimizer_status VARCHAR(45) NULL, + optimizer_message MEDIUMTEXT NULL, + optimizer_date_time BIGINT NULL, + optimizer_return_date_time BIGINT NULL, + optimizer_attempts_to_schedule INT NOT NULL DEFAULT 0, + optimizer_transaction_id VARCHAR(128) NULL, + delete_date_time BIGINT NULL, + CONSTRAINT PK_SCHEDULES PRIMARY KEY (id), + CONSTRAINT FK_SCHEDULES_DOMAIN FOREIGN KEY (domain) + REFERENCES DOMAINS (domain) + ON DELETE NO ACTION ON UPDATE CASCADE +) ENGINE=INNODB; +CREATE UNIQUE INDEX SCHEDULE_KEY ON SCHEDULES (domain ASC, schedule_id ASC); + +CREATE UNIQUE INDEX OPTIMIZER_TRANSACTION_ID_UNIQUE ON SCHEDULES (optimizer_transaction_id ASC); + + +-- ----------------------------------------------------- +-- Table SCHEDULE_EVENTS +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SCHEDULE_EVENTS ( + id INT(11) NOT NULL AUTO_INCREMENT, + schedules_id INT(11) NOT NULL, + event_time BIGINT(20) NOT NULL, + reminder_time BIGINT(20) NOT NULL, + domain VARCHAR(45) NULL DEFAULT NULL, + event_text MEDIUMTEXT NULL DEFAULT NULL, + status VARCHAR(45) NULL DEFAULT NULL, + CONSTRAINT PK_SCHEDULE_EVENTS PRIMARY KEY (id), + CONSTRAINT FK_SCHEDULE_EVENTS_SCHEDULES FOREIGN KEY (schedules_id) + REFERENCES SCHEDULES (id) + ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=INNODB; + +CREATE INDEX FK_SCHEDULE_EVENTS_SCHEDULES_IDX ON SCHEDULE_EVENTS (schedules_id ASC); + +CREATE INDEX SEQ_SVENTS ON SCHEDULE_EVENTS (reminder_time ASC); + + + +-- ----------------------------------------------------- +-- Table DOMAIN_DATA +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS DOMAIN_DATA ( + id INT NOT NULL AUTO_INCREMENT, + schedules_id INT NOT NULL, + name VARCHAR(128) NULL, + value MEDIUMTEXT NULL, + CONSTRAINT PK_DOMAIN_DATA PRIMARY KEY (id), + CONSTRAINT FK_DOMAIN_DATA_SCHEDULES FOREIGN KEY (schedules_id) + REFERENCES SCHEDULES (id) + ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=INNODB; + +CREATE UNIQUE INDEX ID_UNIQUE ON DOMAIN_DATA (id ASC); + +CREATE INDEX FK_DOMAIN_DATA_SCHEDULES_IDX ON DOMAIN_DATA (schedules_id ASC); + + +-- ----------------------------------------------------- +-- Table APPROVAL_TYPES +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS APPROVAL_TYPES ( + id INT NOT NULL AUTO_INCREMENT, + domain VARCHAR(256) NOT NULL, + approval_type VARCHAR(45) NOT NULL, + approval_count INT NOT NULL DEFAULT 1, + CONSTRAINT PK_APPROVAL_TYPES PRIMARY KEY (id), + CONSTRAINT FK_APPROVAL_TYPES_DOMAIN FOREIGN KEY (domain) + REFERENCES DOMAINS (domain) + ON DELETE NO ACTION ON UPDATE CASCADE +) ENGINE=INNODB; CREATE INDEX FK_DOMAIN_IDX ON APPROVAL_TYPES (domain ASC); + + +-- ----------------------------------------------------- +-- Table SCHEDULE_APPROVALS +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS SCHEDULE_APPROVALS ( + id INT NOT NULL AUTO_INCREMENT, + schedules_id INT NOT NULL, + user_id VARCHAR(45) NOT NULL, + approval_type_id INT NOT NULL, + status VARCHAR(45) NOT NULL DEFAULT 'Pending Approval', + approval_date_time BIGINT NULL, + CONSTRAINT PK_SCHEDULE_APPROVALS PRIMARY KEY (id), + CONSTRAINT FK_SCHEDULE_APPROVALS_SCHEDULES FOREIGN KEY (schedules_id) + REFERENCES SCHEDULES (id) + ON DELETE NO ACTION ON UPDATE NO ACTION, + CONSTRAINT FK_SCHEDULE_APPROVALS_APPROVAL_TYPES FOREIGN KEY (approval_type_id) + REFERENCES APPROVAL_TYPES (id) + ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=INNODB; + +CREATE INDEX FK_SCHEDULE_APPROVALS_SCHEDULES_IDX ON SCHEDULE_APPROVALS (schedules_id ASC); + +CREATE INDEX FK_APPROVAL_TYPES_IDX ON SCHEDULE_APPROVALS (approval_type_id ASC); + + +-- ----------------------------------------------------- +-- Table CHANGE_MANAGEMENT_GROUPS +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS CHANGE_MANAGEMENT_GROUPS ( + id INT NOT NULL AUTO_INCREMENT, + group_id VARCHAR(45) NULL, + schedules_id INT NULL, + start_time BIGINT NULL, + finish_time BIGINT NULL, + last_instance_start_time BIGINT NULL, + normal_duration_in_secs INT NULL, + additional_duration_in_secs INT NULL, + concurrency_limit INT NULL, + policy_id VARCHAR(256) NULL, + CONSTRAINT PK_CHANGE_MANAGEMENT_GROUPS PRIMARY KEY (id), + CONSTRAINT FK_CHANGE_MANAGEMENT_GROUPS_SCHEDULES FOREIGN KEY (schedules_id) + REFERENCES SCHEDULES (id) + ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=INNODB; + +CREATE INDEX FK_SCHEDULES_IDX ON CHANGE_MANAGEMENT_GROUPS (schedules_id ASC); + +CREATE UNIQUE INDEX CHANGE_MANAGEMENT_GROUP_ID_UNIQUE ON CHANGE_MANAGEMENT_GROUPS (schedules_id ASC, group_id ASC); + + +-- ----------------------------------------------------- +-- Table CHANGE_MANAGEMENT_SCHEDULES +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS CHANGE_MANAGEMENT_SCHEDULES ( + id INT NOT NULL AUTO_INCREMENT, + change_management_groups_id INT NULL, + vnf_name VARCHAR(256) NOT NULL, + vnf_id VARCHAR(256) NULL, + status VARCHAR(45) NOT NULL, + start_time BIGINT NULL, + finish_time BIGINT NULL, + mso_request_id VARCHAR(45) NULL, + mso_status VARCHAR(45) NULL, + mso_message MEDIUMTEXT NULL, + mso_time BIGINT NULL, + dispatcher_instance VARCHAR(128) NULL, + dispatch_time BIGINT NULL, + execution_completed_time BIGINT NULL, + status_message MEDIUMTEXT NULL, + tm_change_id VARCHAR(15) NULL, + tm_approval_status VARCHAR(45) NULL, + tm_status VARCHAR(45) NULL, + CONSTRAINT PK_CHANGE_MANAGEMENT_SCHEDULES PRIMARY KEY (id), + CONSTRAINT FK_CHANGE_MANAGEMENT_SCHEDULES_CHANGE_MANAGEMENT_GROUP FOREIGN KEY (change_management_groups_id) + REFERENCES CHANGE_MANAGEMENT_GROUPS (id) + ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=INNODB; + +CREATE INDEX FK_CHANGE_MANAGEMENT_GROUP_CHANGE_MANAGEMENT_SCHEDULES_IDX ON CHANGE_MANAGEMENT_SCHEDULES (change_management_groups_id ASC); + +CREATE UNIQUE INDEX CHANGE_MANAGEMENT_SCHEDULES_VNF_NAME_UNIQUE ON CHANGE_MANAGEMENT_SCHEDULES (change_management_groups_id ASC, vnf_name ASC); + + +-- ----------------------------------------------------- +-- Table CHANGE_MANAGEMENT_CHANGE_WINDOWS +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS CHANGE_MANAGEMENT_CHANGE_WINDOWS ( + id INT NOT NULL AUTO_INCREMENT, + change_management_groups_id INT NOT NULL, + start_time BIGINT NULL, + finish_time BIGINT NULL, + CONSTRAINT PK_CHANGE_MANAGEMENT_CHANGE_WINDOWS PRIMARY KEY (id), + CONSTRAINT FK_CHANGE_WINDOWS_CHANGE_MANAGEMENT_GROUPS1 FOREIGN KEY (change_management_groups_id) + REFERENCES CHANGE_MANAGEMENT_GROUPS (id) + ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=INNODB; + +CREATE INDEX FK_CHANGE_WINDOWS_CHANGE_MANAGEMENT_GROUPS1_IDX on CHANGE_MANAGEMENT_CHANGE_WINDOWS (change_management_groups_id ASC); + + +-- ----------------------------------------------------- +-- Table CHANGE_MANAGEMENT_RELATED_ASSETS +-- ----------------------------------------------------- + +CREATE TABLE IF NOT EXISTS CHANGE_MANAGEMENT_RELATED_ASSETS ( + id INT NOT NULL AUTO_INCREMENT, + change_management_schedule_id INT NULL, + asset_id VARCHAR(256) NULL, + asset_type VARCHAR(128) NULL, + CONSTRAINT PK_CHANGE_MANAGEMENT_RELATED_ASSETS PRIMARY KEY (id), + CONSTRAINT FK_CHANGE_MANAGEMENT_RELATED_ASSETS_CHANGE_MANAGEMENT_SCHEDULES FOREIGN KEY (change_management_schedule_id) + REFERENCES CHANGE_MANAGEMENT_SCHEDULES (id) + ON DELETE NO ACTION ON UPDATE NO ACTION +) ENGINE=INNODB; + +CREATE INDEX FK_CHANGE_MANAGEMENT_RELATED_ASSETS_CHANGE_MANAGEMENT_SCHED_IDX ON CHANGE_MANAGEMENT_RELATED_ASSETS (change_management_schedule_id ASC); + diff --git a/cmso-service/src/test/resources/testConfig.xml b/cmso-service/src/test/resources/testConfig.xml new file mode 100644 index 0000000..b1e930c --- /dev/null +++ b/cmso-service/src/test/resources/testConfig.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright © 2017-2018 AT&T Intellectual Property.
+ Modifications Copyright © 2018 IBM.
+
+ 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.
+
+
+ Unless otherwise specified, all documentation contained herein is licensed
+ under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ you may not use this documentation except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://creativecommons.org/licenses/by/4.0/
+
+ Unless required by applicable law or agreed to in writing, documentation
+ 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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:jdbc="http://www.springframework.org/schema/jdbc"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.1.xsd
+ http://www.springframework.org/schema/jdbc
+ http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
+ http://www.springframework.org/schema/tx
+ http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
+
+ <jdbc:initialize-database
+ data-source="test.dataSource">
+ <jdbc:script location="schema-h2.sql" />
+ <jdbc:script location="data-h2.sql" />
+ </jdbc:initialize-database>
+
+ <bean id="test.dataSource"
+ class="org.springframework.jdbc.datasource.DriverManagerDataSource"
+ lazy-init="false">
+ <property name="driverClassName" value="org.h2.Driver" />
+ <property name="url"
+ value="jdbc:h2:file:./h2db;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=true;MODE=MYSQL;USER=sa;PASSWORD=sa" />
+ </bean>
+
+ <!--
+ <context:component-scan
+ base-package="org.onap.optf.cmso.core.model" />
+ <context:component-scan
+ base-package="org.onap.optf.cmso.core.model.dao" />
+ <bean id="rm.jdbcTemplate"
+ class="org.springframework.jdbc.core.JdbcTemplate">
+ <property name="dataSource" ref="test.dataSource" />
+ </bean>
+ <bean id="myEmf"
+ class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+ <property name="dataSource" ref="test.dataSource" />
+ <property name="persistenceUnitName" value="core" />
+ <property name="packagesToScan"
+ value="org.onap.optf.cmso.core.model" />
+ <property name="jpaVendorAdapter">
+ <bean
+ class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
+ </property>
+ <property name="jpaProperties">
+ <props>
+ <prop key="hibernate.hbm2ddl.auto">create-drop</prop>
+ <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
+ </props>
+ </property>
+ </bean>
+ <bean id="transactionManager"
+ class="org.springframework.orm.jpa.JpaTransactionManager">
+ <property name="entityManagerFactory" ref="myEmf" />
+ </bean>
+ -->
+</beans>
|