Skip to content
This repository was archived by the owner on Mar 2, 2020. It is now read-only.

Enable master/clone mode for Specmate #250

Open
wants to merge 73 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
fb68f27
wip: clone mode for cdo server
junkerm Jul 30, 2018
120a75a
wip: cdo server in master/clone config
junkerm Aug 1, 2018
b7fad7c
wip: make delete work in master/clone config
junkerm Aug 1, 2018
cdc3b07
wip
junkerm Aug 2, 2018
34b70bc
wip: clone works with delete
junkerm Aug 2, 2018
e550e52
update repo
junkerm Aug 2, 2018
85806a0
first working version of master/clone config
junkerm Aug 6, 2018
f711926
missing changes from previous commit
junkerm Aug 6, 2018
3b37ee5
fixed most tests (migrateAddObject) is missign
junkerm Aug 6, 2018
3b201f0
clone/master working with oracle except one restart is needed for clone
junkerm Aug 7, 2018
2d29c1e
update repo index
junkerm Aug 7, 2018
344237e
Merge branch 'develop' into cdo-master-cl
junkerm Aug 7, 2018
25c6805
Merge remote-tracking branch 'origin/develop' into cdo-master-cl
junkerm Aug 7, 2018
b2dae8e
Merge remote-tracking branch 'origin/develop' into cdo-master-cl
junkerm Aug 7, 2018
40d02a3
update run configs
junkerm Aug 8, 2018
404f8c0
Delete .log
munterkalmsteiner Aug 10, 2018
b6401bc
adapt master/clone configs
junkerm Aug 10, 2018
eff4c79
Oracle run config
munterkalmsteiner Aug 21, 2018
41fe802
Cleanup
munterkalmsteiner Aug 21, 2018
41d9e7d
wip
junkerm Aug 22, 2018
196c55d
wip
junkerm Aug 23, 2018
1a2ced4
Update AbstractMappingStrategy.java
junkerm Aug 23, 2018
096e44c
Merge branch 'cdo-master-cl' of github.com:junkerm/specmate into cdo-…
munterkalmsteiner Aug 23, 2018
145cae6
Merge branch 'develop' into cdo-master-cl
munterkalmsteiner Aug 31, 2018
11f56d3
Fix run configs
munterkalmsteiner Aug 31, 2018
8f2248d
Adaption to new CDO version
munterkalmsteiner Aug 31, 2018
72b2bbc
Committed by mistake old versions of packages... reverting.
munterkalmsteiner Aug 31, 2018
6b7ef72
Close transactions
munterkalmsteiner Aug 31, 2018
cc6a8a1
Shutting down persistency and CDO server
munterkalmsteiner Aug 31, 2018
ef64fe9
Increase timeouts
munterkalmsteiner Aug 31, 2018
ebe0ba0
Server needs to be activated before DB provider
munterkalmsteiner Aug 31, 2018
b191021
Config cleanup and use H2 for testing
munterkalmsteiner Sep 3, 2018
88e7aeb
Use relative paths for config
munterkalmsteiner Sep 3, 2018
9985cca
Use oracle DB
munterkalmsteiner Sep 4, 2018
c465fed
Merge branch 'cdo-master-cl' of https://github.com/junkerm/specmate.git
junkerm Sep 7, 2018
875c57a
Merge remote-tracking branch 'origin/develop' into cdo-master-cl
junkerm Sep 7, 2018
fbb5737
upate run configs
junkerm Sep 7, 2018
e47cc43
upate run configs
junkerm Sep 7, 2018
0cc505b
update run config
junkerm Sep 7, 2018
534bade
remove debug option from dev runconfig
junkerm Sep 7, 2018
0699d73
clean up repositories
junkerm Sep 7, 2018
d451a63
restore repositories
junkerm Sep 7, 2018
fe41b47
newly resolve auth-test
junkerm Sep 7, 2018
b2d6249
increase commit info timeout
junkerm Sep 7, 2018
a9c656c
wip
junkerm Sep 20, 2018
317a5a7
rebuild bundle index files
junkerm Nov 27, 2018
222bdf0
Merge branch 'cdo-master-cl' of https://github.com/junkerm/specmate.git
junkerm Nov 27, 2018
8c2e8b2
Merge remote-tracking branch 'origin/develop' into cdo-master-cl
junkerm Nov 27, 2018
e25bbc4
Fix test
munterkalmsteiner Nov 27, 2018
558d90e
Better error messages
munterkalmsteiner Nov 27, 2018
6dc424b
Update Oracle migration to CDO 4.6
munterkalmsteiner Nov 27, 2018
8303af2
Merge branch 'cdo-master-cl' of https://github.com/junkerm/specmate.git
junkerm Dec 1, 2018
0802bf7
wip
junkerm Dec 4, 2018
102134b
update to cdo 4.7
junkerm Dec 23, 2018
33cdb8f
wip
junkerm Dec 28, 2018
ec73d2c
wip: fix tests
junkerm Dec 28, 2018
987e1a1
wip: fix tests
junkerm Dec 29, 2018
c8495b1
address review comments
junkerm Dec 29, 2018
e60450e
master clone test projec
junkerm May 3, 2019
a89b7ee
Merge branch 'develop' into cdo-master-cl
junkerm May 3, 2019
c605a08
master clone test initial setup
junkerm May 3, 2019
fbd0273
testing clone/master functionality
junkerm May 8, 2019
dbdbe46
add launch config
junkerm May 15, 2019
27bc990
add gitignore
junkerm May 15, 2019
c7c2d4e
login test
junkerm May 15, 2019
3a225e4
add authorization header to login test
bliemelh May 22, 2019
c57e43e
initialize ceg creation test
bliemelh May 24, 2019
65f25b6
delete unused import
bliemelh May 24, 2019
ad5d91d
initialize create model test
bliemelh May 28, 2019
63b7810
minor refactoring
bliemelh Jun 7, 2019
dbd3735
wip
bliemelh Jun 13, 2019
e92d5d1
re-upload master clone test
bliemelh Jun 13, 2019
7b895f7
Merge branch 'cdo-master-cl' of https://github.com/junkerm/specmate.git
bliemelh Jun 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Oracle migration to CDO 4.6
These are analogous to the H2 implementation, but unverified.
munterkalmsteiner committed Nov 27, 2018
commit 6dc424ba513e763d57df8eb6932d493fa296281f
Original file line number Diff line number Diff line change
@@ -110,42 +110,43 @@ public void migrateNewDateAttribute(String objectName, String attributeName, Dat
public void migrateNewObjectReference(String objectName, String attributeName) throws SpecmateException {
migrateNewReference(objectName, attributeName, "NUMBER");
}

@Override
public void migrateNewStringReference(String objectName, String attributeName) throws SpecmateException {
migrateNewReference(objectName, attributeName, "VARCHAR2(4000)");
}

private void migrateNewReference(String objectName, String attributeName, String type) throws SpecmateException {
String failmsg = "Migration: Could not add column " + attributeName + " to table " + objectName + ".";
String tableNameList = getListTableName(objectName, attributeName);
List<String> queries = new ArrayList<>();

queries.add("ALTER TABLE " + objectName + " ADD " + attributeName + " NUMBER");
queries.add("CREATE TABLE " + tableNameList + " (" + "CDO_SOURCE NUMBER NOT NULL, "
+ "CDO_VERSION NUMBER NOT NULL, " + "CDO_IDX NUMBER NOT NULL, " + "CDO_VALUE " + type +")");
queries.add("CREATE TABLE " + tableNameList + " (" + "CDO_SOURCE VARCHAR2(255) NOT NULL, "
+ "CDO_BRANCH NUMBER NOT NULL, " + "CDO_VERSION NUMBER NOT NULL, " + "CDO_IDX NUMBER NOT NULL, "
+ "CDO_VALUE " + type + ")");
queries.add("CREATE UNIQUE INDEX " + SQLUtil.createTimebasedIdentifier("PK", OracleProviderConfig.MAX_ID_LENGTH)
+ " ON " + tableNameList + " (CDO_SOURCE ASC, CDO_VERSION ASC, CDO_IDX ASC)");
+ " ON " + tableNameList + " (CDO_SOURCE ASC, CDO_BRANCH ASC, CDO_VERSION ASC, CDO_IDX ASC)");
queries.add("ALTER TABLE " + tableNameList + " ADD CONSTRAINT "
+ SQLUtil.createTimebasedIdentifier("C", OracleProviderConfig.MAX_ID_LENGTH)
+ " PRIMARY KEY (CDO_SOURCE, CDO_VERSION, CDO_IDX)");
+ " PRIMARY KEY (CDO_SOURCE, CDO_BRANCH, CDO_VERSION, CDO_IDX)");
queries.add(insertExternalAttributeReference(objectName, attributeName));
SQLUtil.executeStatements(queries, connection, failmsg);
}
private String getListTableName(String objectName, String attributeName) throws SpecmateException{

private String getListTableName(String objectName, String attributeName) throws SpecmateException {
String firstShot = objectName + "_" + attributeName + "_LIST";
if(firstShot.length()<=ORACLE_MAX_TABLE_NAME_LENGTH){
if (firstShot.length() <= ORACLE_MAX_TABLE_NAME_LENGTH) {
return firstShot;
}
}
int id = Math.abs(getLatestId());
id++;
String idStr = Integer.toString(id);
String suffix = "_FLS"+idStr;
if(suffix.length()>attributeName.length()){
String suffix = "_FLS" + idStr;
if (suffix.length() > attributeName.length()) {
throw new SpecmateException("Could not shorten list table name for attribute " + attributeName);
}
String tableName = firstShot.substring(0,ORACLE_MAX_TABLE_NAME_LENGTH-suffix.length()) + suffix;
String tableName = firstShot.substring(0, ORACLE_MAX_TABLE_NAME_LENGTH - suffix.length()) + suffix;
return tableName;
}

Original file line number Diff line number Diff line change
@@ -22,16 +22,17 @@ public void newObject(String tableName) throws SpecmateException {
String failmsg = "Migration: Could not add table " + tableName + ".";
List<String> queries = new ArrayList<>();

queries.add("CREATE TABLE " + tableName + "(" + "CDO_ID NUMBER NOT NULL, " + "CDO_VERSION NUMBER NOT NULL, "
+ "CDO_CREATED NUMBER NOT NULL, " + "CDO_REVISED NUMBER NOT NULL, " + "CDO_RESOURCE NUMBER NOT NULL, "
+ "CDO_CONTAINER NUMBER NOT NULL, " + "CDO_FEATURE NUMBER NOT NULL)");
queries.add("CREATE TABLE " + tableName + "(" + "CDO_ID VARCHAR2(255) NOT NULL, "
+ "CDO_VERSION NUMBER NOT NULL, " + "CDO_BRANCH NUMBER NOT NULL, " + "CDO_CREATED NUMBER NOT NULL, "
+ "CDO_REVISED NUMBER NOT NULL, " + "CDO_RESOURCE VARCHAR2(255) NOT NULL, "
+ "CDO_CONTAINER VARCHAR2(255) NOT NULL, " + "CDO_FEATURE NUMBER NOT NULL)");
queries.add("CREATE UNIQUE INDEX " + SQLUtil.createTimebasedIdentifier("PK", OracleProviderConfig.MAX_ID_LENGTH)
+ " ON " + tableName + " (CDO_ID ASC, CDO_VERSION ASC)");
+ " ON " + tableName + " (CDO_ID ASC, CDO_VERSION ASC, CDO_BRANCH ASC)");
queries.add("CREATE INDEX " + SQLUtil.createTimebasedIdentifier("I", OracleProviderConfig.MAX_ID_LENGTH)
+ " ON " + tableName + " (CDO_REVISED ASC)");
queries.add("ALTER TABLE " + tableName + " ADD CONSTRAINT "
+ SQLUtil.createTimebasedIdentifier("C", OracleProviderConfig.MAX_ID_LENGTH)
+ " PRIMARY KEY (CDO_ID, CDO_VERSION)");
+ " PRIMARY KEY (CDO_ID, CDO_VERSION, CDO_BRANCH)");
SQLUtil.executeStatements(queries, connection, failmsg);
}