Skip to content

Commit

Permalink
bugfix mview relevant only
Browse files Browse the repository at this point in the history
  • Loading branch information
llsand committed Dec 17, 2019
1 parent f19559a commit 218e44f
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package de.opitzconsulting.orcas.diff;

import java.net.URL;
import java.sql.CallableStatement;
import java.sql.SQLException;
import java.sql.Struct;
import java.util.List;
import java.net.URL;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;

import com.opitzconsulting.orcas.xslt.XsltExtractDirAccessClass;

import org.apache.commons.logging.Log;

import com.opitzconsulting.orcas.xslt.XsltExtractDirAccessClass;
import de.opitzconsulting.OrcasDslStandaloneSetup;
import de.opitzconsulting.orcas.diff.JdbcConnectionHandler.RunWithCallableStatementProvider;
import de.opitzconsulting.orcas.extensions.AllExtensions;
Expand All @@ -22,12 +21,12 @@
import de.opitzconsulting.orcas.syex.trans.TransformOrigSyex;
import de.opitzconsulting.orcas.syex.trans.TransformSyexOrig;
import de.opitzconsulting.orcas.syex.xml.XmlExport;
import de.opitzconsulting.orcasDsl.Mview;
import de.opitzconsulting.orcasDsl.OrcasDslPackage;
import de.opitzconsulting.orcasDsl.Sequence;
import de.opitzconsulting.orcasDsl.Table;
import de.opitzconsulting.orcasDsl.impl.ModelImpl;
import de.opitzconsulting.origOrcasDsl.Model;
import de.opitzconsulting.origOrcasDsl.Mview;

public class ExtensionHandlerImpl extends BaseExtensionHandlerImpl<de.opitzconsulting.orcasDsl.Model> {
protected de.opitzconsulting.orcasDsl.Model loadModelFromSqlplusTable() throws Exception {
Expand Down
1 change: 1 addition & 0 deletions orcas_integrationstest/parameter.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ minimizestatementcount = false
cleanupfkvaluesondropmode = false
mviewswithcolumns = false
schema_names = default
relevantFiles =

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import java.util.Properties;
import java.util.function.Consumer;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.emf.ecore.EObject;
import org.junit.Assume;
Expand Down Expand Up @@ -143,6 +145,7 @@ private static class TestSetup {
private String _extensionfolder;
private String _required_feature_list;
private String _dateformat;
private String relevantFiles;
private String _excludewheresequence;
private boolean _customExtensionFolder;
private boolean _availableFeatureRequirementMatched = true;
Expand Down Expand Up @@ -307,6 +310,7 @@ public TestSetup(String pTestName) {
_minimizeStatementCount = getBooleanProperty("minimizestatementcount", lDefaultProperties, lTestProperties);
_cleanupfkvaluesondropmode = getBooleanProperty("cleanupfkvaluesondropmode", lDefaultProperties, lTestProperties);
_mviewsWithColumns = getBooleanProperty("mviewswithcolumns", lDefaultProperties, lTestProperties);
relevantFiles = getProperty("relevantFiles", lDefaultProperties, lTestProperties);

if (_expectfailure != null && _expectfailure.trim().length() == 0) {
_expectfailure = null;
Expand Down Expand Up @@ -686,6 +690,13 @@ private void executeOrcasStatics(
lParametersCall.setMinimizeStatementCount(_testSetup._minimizeStatementCount);
lParametersCall.setCleanupFkValuesOnDropmode(_testSetup._cleanupfkvaluesondropmode);
lParametersCall.setViewExtractMode(_testSetup.isMviewsWithColumns() ? "full" : ParameterDefaults.viewextractmode);
List<File> lRelevantFileList = Stream.of(_testSetup.relevantFiles.split(","))
.filter(it -> !it.isEmpty())
.map(it -> new File(pModelFolder + "/" + it))
.collect(Collectors.toList());
if (!lRelevantFileList.isEmpty()) {
lParametersCall.setRelevantModelFiles(lRelevantFileList);
}

multiSchemaSetup(lParametersCall);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
create table tab_view
(
col_add_ix_1 number(15) not null,
col_add_ix_2 number(15) not null
);

create materialized view mview as select col_add_ix_1, col_add_ix_2 from tab_view;

create sequence seq increment by 15;



Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
create table tab_view
(
col_add_ix_1 number(15) not null,
col_add_ix_2 number(15) not null,
col_add_ix_3 number(15) not null
);

create materialized view mview as select col_add_ix_1, col_add_ix_2, col_add_ix_3 from tab_view;

create sequence seq;



Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dropmode = true
required_feature_list=materialized_views
test_extract = true
relevantFiles = mview.sql,seq.sql,tab_view.sql
test_extract = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


create materialized view mview as "select col_add_ix_1, col_add_ix_2, col_add_ix_3 from tab_view";


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


create materialized view mview_ignore as "select col_add_ix_1, col_add_ix_2, col_add_ix_3 from tab_view";


Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

create sequence seq;

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

create sequence seq_ignore;

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

create table tab_view
(
col_add_ix_1 number(15) not null,
col_add_ix_2 number(15) not null,
col_add_ix_3 number(15) not null
);

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

create table tab_view_ignore
(
col_add_ix_1 number(15) not null,
col_add_ix_2 number(15) not null,
col_add_ix_3 number(15) not null
);

0 comments on commit 218e44f

Please sign in to comment.