Compare commits
35 Commits
patch/8.0.
...
release/7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
862dac4a94 | ||
|
|
bf855a7bb1 | ||
|
|
f3b2637867 | ||
|
|
e405558bd4 | ||
|
|
915701e64b | ||
|
|
4038574557 | ||
|
|
69a2741416 | ||
|
|
e43cc1f85b | ||
|
|
250ff496ba | ||
|
|
c99b037c7b | ||
|
|
810b694e5d | ||
|
|
7e66cf70d2 | ||
|
|
0285fdc191 | ||
|
|
59990aa2ca | ||
|
|
2eff81da52 | ||
|
|
13a40cfda7 | ||
|
|
e5ada32a75 | ||
|
|
cdfd2170ba | ||
|
|
5a7f0e8fe9 | ||
|
|
cacdff8623 | ||
|
|
e462ba015b | ||
|
|
8223b8f650 | ||
|
|
489c28c19f | ||
|
|
22f764d543 | ||
|
|
6c48bc0f4e | ||
|
|
5256afcd57 | ||
|
|
38f32f5d5e | ||
|
|
43b4b220d5 | ||
|
|
c476f7bfbd | ||
|
|
448217029f | ||
|
|
a046c641b0 | ||
|
|
982e319f9d | ||
|
|
48ab34ef4a | ||
|
|
b52c6e53e9 | ||
|
|
ae6b3f729b |
@@ -95,11 +95,10 @@
|
||||
<version>2.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
<type>bundle</type>
|
||||
</dependency>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
<artifactId>reload4j</artifactId>
|
||||
<version>1.2.19</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -57,6 +57,8 @@ public class CommonsPlugin implements BundleActivator {
|
||||
// TESB-17856: For commandline builds ESB Micorservice bundle
|
||||
private static boolean isESBMicorservice = false;
|
||||
|
||||
private static Boolean isJunitWorking;
|
||||
|
||||
private static ServiceTracker proxyTracker;
|
||||
|
||||
public static boolean isWorkbenchCreated() {
|
||||
@@ -123,6 +125,35 @@ public class CommonsPlugin implements BundleActivator {
|
||||
return "org.talend.rcp.branding.tuj.product".equals(Platform.getProduct().getId()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static boolean isJunitWorking() {
|
||||
if (isJunitWorking == null) {
|
||||
try {
|
||||
String[] args = Platform.getCommandLineArgs();
|
||||
String applicationId = null;
|
||||
|
||||
for (int i = 0; i < args.length - 1; i++) {
|
||||
if (args[i].equalsIgnoreCase("-application")) { //$NON-NLS-1$
|
||||
applicationId = args[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
if (applicationId != null
|
||||
&& (applicationId.equals("org.eclipse.swtbot.eclipse.junit.headless.swtbottestapplication") //$NON-NLS-1$
|
||||
|| applicationId.equals("org.eclipse.pde.junit.runtime.uitestapplication"))) { //$NON-NLS-1$
|
||||
isJunitWorking = true;
|
||||
} else {
|
||||
isJunitWorking = false;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
isJunitWorking = false;
|
||||
}
|
||||
}
|
||||
if (isJunitWorking == null) {
|
||||
isJunitWorking = false;
|
||||
}
|
||||
return isJunitWorking;
|
||||
}
|
||||
|
||||
/**
|
||||
* Answer the file associated with name. This handles the case of running as a plugin and running standalone which
|
||||
* happens during testing.
|
||||
|
||||
@@ -142,6 +142,7 @@ import org.talend.core.runtime.util.ItemDateParser;
|
||||
import org.talend.core.runtime.util.SharedStudioUtils;
|
||||
import org.talend.core.service.ICoreUIService;
|
||||
import org.talend.core.service.IUpdateService;
|
||||
import org.talend.core.service.IDetectCVEService;
|
||||
import org.talend.core.utils.CodesJarResourceCache;
|
||||
import org.talend.cwm.helper.SubItemHelper;
|
||||
import org.talend.cwm.helper.TableHelper;
|
||||
@@ -2467,6 +2468,15 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
if (runProcessService != null) {
|
||||
runProcessService.clearProjectRelatedSettings();
|
||||
}
|
||||
|
||||
// clear detect CVE cache
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDetectCVEService.class)) {
|
||||
IDetectCVEService detectCVESvc = GlobalServiceRegister.getDefault().getService(IDetectCVEService.class);
|
||||
if (detectCVESvc != null) {
|
||||
detectCVESvc.clearCache();
|
||||
}
|
||||
}
|
||||
|
||||
ReferenceProjectProvider.clearTacReferenceList();
|
||||
ReferenceProjectProblemManager.getInstance().clearAll();
|
||||
fullLogonFinished = false;
|
||||
|
||||
@@ -58,7 +58,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
HSQLDB_SERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_SERVER, "hsqldb.jar")), //$NON-NLS-1$
|
||||
HSQLDB_WEBSERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_WEBSERVER, "hsqldb.jar")), //$NON-NLS-1$
|
||||
|
||||
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-1.4.198.jar")), //$NON-NLS-1$
|
||||
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-2.1.210.jar")), //$NON-NLS-1$
|
||||
|
||||
//
|
||||
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby.jar")), //$NON-NLS-1$
|
||||
@@ -71,9 +71,10 @@ public enum EDatabaseVersion4Drivers {
|
||||
INFORMIX(new DbVersion4Drivers(EDatabaseTypeName.INFORMIX, "ifxjdbc.jar")), //$NON-NLS-1$
|
||||
|
||||
SAS_9_1(new DbVersion4Drivers(EDatabaseTypeName.SAS, "SAS 9.1", "SAS_9.1", new String[] { "sas.core.jar", //$NON-NLS-1$
|
||||
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "org.apache.log4j_1.2.15.v201012070815.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
|
||||
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "org.apache.log4j_1.2.15.v201012070815.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"SAS 9.2", "SAS_9.2", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.19jar" })),
|
||||
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
|
||||
// MYSQL, add for 9594
|
||||
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
@@ -87,7 +88,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.25.jar", "slf4j-log4j12-1.7.25.jar", "adal4j-1.6.7.jar", //$NON-NLS-1$
|
||||
"commons-lang3-3.10.jar", "commons-codec-1.14.jar", "gson-2.8.6.jar", "oauth2-oidc-sdk-9.7.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-8.11.jar", "javax.mail-1.6.2.jar", "log4j-1.2.17.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-8.11.jar", "javax.mail-1.6.2.jar", "reload4j-1.2.19.jar",
|
||||
"accessors-smart-2.4.7.jar", "asm-9.1.jar", "content-type-2.1.jar" })),
|
||||
|
||||
VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
@@ -168,9 +169,9 @@ public enum EDatabaseVersion4Drivers {
|
||||
MAPRDB(new DbVersion4Drivers(EDatabaseTypeName.MAPRDB, new String[] {})),
|
||||
|
||||
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"redshift-jdbc42-no-awssdk-1.2.37.1061.jar")), //$NON-NLS-1$
|
||||
new String[]{ "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "redshift-jdbc42-no-awssdk-1.2.37.1061.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.10.1.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.10.1.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
"jackson-databind-2.10.1.jar", "jackson-annotations-2.10.1.jar", "httpcore-4.4.11.jar", "httpclient-4.5.9.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
|
||||
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.11.jar" })), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
|
||||
@@ -69,6 +69,8 @@ public interface IMetadataTable {
|
||||
|
||||
public boolean sameMetadataAs(IMetadataTable other, int options);
|
||||
|
||||
public boolean sameMetadataAs(List<IMetadataColumn> otherMetadataTableColumns, int options);
|
||||
|
||||
public void sortCustomColumns();
|
||||
|
||||
public boolean isReadOnly();
|
||||
|
||||
@@ -252,8 +252,13 @@ public class MetadataTable implements IMetadataTable, Cloneable {
|
||||
if (!(input instanceof IMetadataTable)) {
|
||||
return false;
|
||||
}
|
||||
List<IMetadataColumn> thisColumnListWithUnselected = this.getListColumns(true);
|
||||
List<IMetadataColumn> inputColumnListWithUnselected = input.getListColumns(true);
|
||||
return sameMetadataAs(inputColumnListWithUnselected, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameMetadataAs(List<IMetadataColumn> inputColumnListWithUnselected, int options) {
|
||||
List<IMetadataColumn> thisColumnListWithUnselected = this.getListColumns(true);
|
||||
if (thisColumnListWithUnselected == null) {
|
||||
if (inputColumnListWithUnselected != null) {
|
||||
return false;
|
||||
@@ -295,9 +300,6 @@ public class MetadataTable implements IMetadataTable, Cloneable {
|
||||
// no matter if this one is custom or not (all custom must be propagated too)
|
||||
for (int i = 0; i < inputColumnListWithUnselected.size(); i++) {
|
||||
IMetadataColumn inputColumn = inputColumnListWithUnselected.get(i);
|
||||
if(inputColumn.isCustom()) {
|
||||
continue;
|
||||
}
|
||||
IMetadataColumn myColumn = this.getColumn(inputColumn.getLabel());
|
||||
outputColumnsNotTested.remove(myColumn);
|
||||
if (!inputColumn.sameMetacolumnAs(myColumn, options)) {
|
||||
|
||||
@@ -58,6 +58,11 @@ public interface IProcess extends IElement {
|
||||
|
||||
public static final String SCREEN_OFFSET_Y = "SCREEN_OFFSET_Y"; //$NON-NLS-1$
|
||||
|
||||
public static final String PROP_ERR_ON_COMPONENT_MISSING = "error.on.component.missing";
|
||||
|
||||
public static final boolean ERR_ON_COMPONENT_MISSING = Boolean
|
||||
.valueOf(System.getProperty(PROP_ERR_ON_COMPONENT_MISSING, Boolean.TRUE.toString()));
|
||||
|
||||
public String getName();
|
||||
|
||||
public String getId();
|
||||
|
||||
@@ -1086,6 +1086,18 @@ public final class ProcessUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("cHttp".equals(node.getComponentName())) {
|
||||
for (Object elementParameter : node.getElementParameter()) {
|
||||
ElementParameterType elementParameterType = (ElementParameterType)elementParameter;
|
||||
|
||||
String name = elementParameterType.getName();
|
||||
String value = elementParameterType.getValue();
|
||||
|
||||
if ("SERVER".equals(name) && (value != null && "true".equals(value.toString()))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -337,7 +337,6 @@ public class ContextTreeTable {
|
||||
|
||||
private void attachCheckColumnTip(NatTable nt) {
|
||||
DefaultToolTip toolTip = new ContextNatTableToolTip(nt);
|
||||
toolTip.setBackgroundColor(natTable.getDisplay().getSystemColor(7));
|
||||
toolTip.setPopupDelay(500);
|
||||
toolTip.activate();
|
||||
toolTip.setShift(new Point(10, 10));
|
||||
|
||||
@@ -101,6 +101,7 @@ import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
import org.talend.core.model.process.ReplaceNodesInProcessProvider;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.relationship.RelationshipItemBuilder;
|
||||
@@ -705,7 +706,6 @@ public class ProcessorUtilities {
|
||||
|
||||
processor.setArguments(argumentsMap);
|
||||
|
||||
handelDQComponents(selectedProcessItem, currentProcess);
|
||||
// generate the code of the father after the childrens
|
||||
// so the code won't have any error during the check, and it will help to check
|
||||
// if the generation is really needed.
|
||||
@@ -721,6 +721,8 @@ public class ProcessorUtilities {
|
||||
*/
|
||||
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
|
||||
|
||||
handelDQComponents(selectedProcessItem, currentProcess);
|
||||
|
||||
copyDependenciedResources(currentProcess, progressMonitor);
|
||||
|
||||
return processor;
|
||||
@@ -1249,8 +1251,6 @@ public class ProcessorUtilities {
|
||||
|
||||
processor.setArguments(argumentsMap);
|
||||
|
||||
handelDQComponents(selectedProcessItem, currentProcess);
|
||||
|
||||
generateContextInfo(jobInfo, selectedContextName, statistics, trace, needContext, progressMonitor,
|
||||
currentProcess, currentJobName, processor, isMainJob, codeGenerationNeeded);
|
||||
|
||||
@@ -1266,6 +1266,8 @@ public class ProcessorUtilities {
|
||||
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
|
||||
TimeMeasure.step(idTimer, "generateBuildInfo");
|
||||
|
||||
handelDQComponents(selectedProcessItem, currentProcess);
|
||||
|
||||
copyDependenciedResources(currentProcess, progressMonitor);
|
||||
|
||||
return processor;
|
||||
@@ -2520,6 +2522,13 @@ public class ProcessorUtilities {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
// TUP-35219 avoid resource unload
|
||||
if (property != null && property.getItem() != null
|
||||
&& property.getItem() instanceof JobletProcessItem) {
|
||||
((JobletProcessItem) property.getItem()).getJobletProcess();
|
||||
}
|
||||
|
||||
JobInfo jobInfo = new JobInfo(property, jobletProcess.getDefaultContext());
|
||||
if (!jobInfos.contains(jobInfo)) {
|
||||
jobInfos.add(jobInfo);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<module>zip/pom.xml</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<m2.fasterxml.jackson.version>2.11.4</m2.fasterxml.jackson.version>
|
||||
<m2.fasterxml.jackson.version>2.13.2</m2.fasterxml.jackson.version>
|
||||
<jackson-codehaus.version>1.9.16-TALEND</jackson-codehaus.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>studio-tacokit-dependencies</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<tacokit.components.version>1.27.7</tacokit.components.version>
|
||||
<tacokit.components.version>1.27.8</tacokit.components.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<tcomp.version>1.38.5</tcomp.version>
|
||||
<tcomp.version>1.38.6</tcomp.version>
|
||||
<slf4j.version>1.7.32</slf4j.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<reload4j.version>1.2.19</reload4j.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
@@ -141,6 +142,17 @@
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
<artifactId>reload4j</artifactId>
|
||||
<version>${reload4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<artifactItem>
|
||||
<groupId>org.talend.studio</groupId>
|
||||
<artifactId>studio-maven-repository</artifactId>
|
||||
<version>7.3.1.v20220129</version>
|
||||
<version>7.3.1.v20220325</version>
|
||||
<type>zip</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${project.basedir}/../repository</outputDirectory>
|
||||
|
||||
@@ -14,6 +14,7 @@ package org.talend.designer.maven.tools;
|
||||
|
||||
import static org.talend.designer.maven.model.TalendJavaProjectConstants.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
@@ -24,6 +25,7 @@ import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -33,6 +35,7 @@ import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||
import org.apache.maven.model.Activation;
|
||||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
@@ -54,6 +57,7 @@ import org.eclipse.m2e.core.MavenPlugin;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.MojoType;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.ILibraryManagerService;
|
||||
@@ -75,6 +79,7 @@ import org.talend.core.model.routines.CodesJarInfo;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.ItemResourceUtil;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
@@ -142,8 +147,7 @@ public class AggregatorPomsHelper {
|
||||
public void installRootPom(boolean force) throws Exception {
|
||||
IFile pomFile = getProjectRootPom();
|
||||
if (pomFile.exists()) {
|
||||
Model model = MavenPlugin.getMaven().readModel(pomFile.getLocation().toFile());
|
||||
if (force || !isPomInstalled(model.getGroupId(), model.getArtifactId(), model.getVersion())) {
|
||||
if (force || needInstallRootPom(pomFile)) {
|
||||
MavenPomCommandLauncher launcher =
|
||||
new MavenPomCommandLauncher(pomFile, TalendMavenConstants.GOAL_INSTALL);
|
||||
Map<String, Object> argumentsMap = new HashMap<>();
|
||||
@@ -155,9 +159,40 @@ public class AggregatorPomsHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPomInstalled(String groupId, String artifactId, String version) {
|
||||
String mvnUrl = MavenUrlHelper.generateMvnUrl(groupId, artifactId, version, MavenConstants.PACKAGING_POM, null);
|
||||
return PomUtil.isAvailable(mvnUrl);
|
||||
public boolean needInstallRootPom(IFile pomFile) {
|
||||
try {
|
||||
Model model = MavenPlugin.getMaven().readModel(pomFile.getLocation().toFile());
|
||||
String mvnUrl = MavenUrlHelper.generateMvnUrl(model.getGroupId(), model.getArtifactId(), model.getVersion(),
|
||||
MavenConstants.PACKAGING_POM, null);
|
||||
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
|
||||
if (artifact != null) {
|
||||
String artifactPath = PomUtil.getAbsArtifactPath(artifact);
|
||||
if (artifactPath == null) {
|
||||
return true;
|
||||
}
|
||||
Model installedModel = MavenPlugin.getMaven().readModel(new File(artifactPath));
|
||||
// check ci-builder
|
||||
String currentCIBuilderVersion = model.getBuild().getPlugins().stream()
|
||||
.filter(p -> p.getArtifactId().equals(MojoType.CI_BUILDER.getArtifactId())).findFirst().get()
|
||||
.getVersion();
|
||||
String installedCIBuilderVersion = installedModel.getBuild().getPlugins().stream()
|
||||
.filter(p -> p.getArtifactId().equals(MojoType.CI_BUILDER.getArtifactId())).findFirst().get()
|
||||
.getVersion();
|
||||
if (!currentCIBuilderVersion.equals(installedCIBuilderVersion)) {
|
||||
return true;
|
||||
}
|
||||
// check signer
|
||||
String currentSignerVersion = model.getProperties().getProperty(MojoType.SIGNER.getVersionKey());
|
||||
String installedSignerVersion = installedModel.getProperties().getProperty(MojoType.SIGNER.getVersionKey());
|
||||
if (!currentSignerVersion.equals(installedSignerVersion)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public IFolder getProjectPomsFolder() {
|
||||
|
||||
@@ -324,7 +324,8 @@ public class BuildCacheManager {
|
||||
Parent parent = new Parent();
|
||||
parent.setGroupId(PomIdsHelper.getProjectGroupId());
|
||||
parent.setArtifactId(PomIdsHelper.getProjectArtifactId());
|
||||
parent.setVersion(PomIdsHelper.getProjectVersion());
|
||||
parent.setVersion(PomIdsHelper.getProjectVersion());
|
||||
parent.setRelativePath(".");
|
||||
model.setParent(parent);
|
||||
PomUtil.savePom(null, model, pomFile);
|
||||
}
|
||||
|
||||
@@ -105,12 +105,11 @@ public class ProcessorDependenciesManager {
|
||||
Dependency dependency = PomUtil.createModuleDependency(mavenUri);
|
||||
if (dependency != null) {
|
||||
((SortableDependency) dependency).setAssemblyOptional(optional);
|
||||
if (module.isExcludeDependencies()) {
|
||||
Exclusion exclusion = new Exclusion();
|
||||
exclusion.setGroupId("*"); //$NON-NLS-1$
|
||||
exclusion.setArtifactId("*"); //$NON-NLS-1$
|
||||
dependency.addExclusion(exclusion);
|
||||
}
|
||||
Exclusion exclusion = new Exclusion();
|
||||
exclusion.setGroupId("*"); //$NON-NLS-1$
|
||||
exclusion.setArtifactId("*"); //$NON-NLS-1$
|
||||
dependency.addExclusion(exclusion);
|
||||
|
||||
neededDependencies.add(dependency);
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -10,20 +10,26 @@
|
||||
<artifactId>org.talend.libraries.apache</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<properties>
|
||||
<log4j.version>1.2.17</log4j.version>
|
||||
<reload4j.version>1.2.19</reload4j.version>
|
||||
<slf4j.version>1.7.25</slf4j.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>${log4j.version}</version>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
<artifactId>reload4j</artifactId>
|
||||
<version>${reload4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>${slf4j.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
@@ -88,7 +94,7 @@
|
||||
<excludeTypes>pom</excludeTypes>
|
||||
<excludeTransitive>true</excludeTransitive>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<includeGroupIds>log4j,org.slf4j,org.apache.logging.log4j</includeGroupIds>
|
||||
<includeGroupIds>ch.qos.reload4j,org.slf4j,org.apache.logging.log4j</includeGroupIds>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry exported="true" kind="lib" path="lib/h2-1.4.198.jar"/>
|
||||
<classpathentry kind="lib" kind="lib" path="lib/h2-2.1.210.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -4,7 +4,7 @@ Bundle-Name: H2
|
||||
Bundle-SymbolicName: org.talend.libraries.jdbc.h2
|
||||
Bundle-Version: 7.3.1.qualifier
|
||||
Bundle-ClassPath: .,
|
||||
lib/h2-1.4.198.jar
|
||||
lib/h2-2.1.210.jar
|
||||
Export-Package: org.h2,
|
||||
org.h2.api;uses:="org.h2.command.ddl,org.h2.table",
|
||||
org.h2.bnf;uses:="org.h2.server.web",
|
||||
@@ -35,7 +35,6 @@ Export-Package: org.h2,
|
||||
org.h2.value,
|
||||
org.h2.util",
|
||||
org.h2.compress,
|
||||
org.h2.constant,
|
||||
org.h2.constraint;
|
||||
uses:="org.h2.expression,
|
||||
org.h2.result,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
lib/h2-1.4.198.jar
|
||||
lib/h2-2.1.210.jar
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<artifactItem>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.4.198</version>
|
||||
<version>2.1.210</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
|
||||
@@ -57,12 +57,32 @@ public class JDBCUtil {
|
||||
throw new RuntimeException("Null value in non-Nullable column");
|
||||
}
|
||||
|
||||
/**
|
||||
* getDate can be called with the resultSet having either a java.sql.Timestamp or a java.sql.Date
|
||||
* the double try implementation is not something im proud of, but having two methods would require
|
||||
* a huge refactoring that in the end is the same as doing that
|
||||
* @param rs
|
||||
* @param index
|
||||
* @return java.util.Date converted from java.sql.Timestamp/Date
|
||||
* @throws java.sql.SQLException
|
||||
*/
|
||||
public static Date getDate(ResultSet rs, int index) throws java.sql.SQLException {
|
||||
if(rs.getTimestamp(index) != null) {
|
||||
return new Date(rs.getTimestamp(index).getTime());
|
||||
Date result = null;
|
||||
try {
|
||||
if(rs.getTimestamp(index) != null) {
|
||||
result = new Date(rs.getTimestamp(index).getTime());
|
||||
return result;
|
||||
}
|
||||
} catch (java.sql.SQLException e) {
|
||||
}
|
||||
|
||||
return null;
|
||||
try {
|
||||
if(rs.getDate(index) != null) {
|
||||
result = new Date(rs.getDate(index).getTime());
|
||||
return result;
|
||||
}
|
||||
} catch (java.sql.SQLException e) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//decrease the get method call number
|
||||
|
||||
@@ -313,10 +313,13 @@ public class ParserUtils {
|
||||
*/
|
||||
public static java.util.Date parseTo_Date(String dateString, String pattern) {
|
||||
// check the parameter for supporting " ","2007-09-13"," 2007-09-13 "
|
||||
if (dateString != null) {
|
||||
dateString = dateString.trim();
|
||||
}
|
||||
if (dateString == null || dateString.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
dateString = dateString.trim();
|
||||
|
||||
if (pattern == null) {
|
||||
pattern = Constant.dateDefaultPattern;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class ModulesNeededProvider {
|
||||
|
||||
private static volatile boolean installModuleForRountine = false;
|
||||
|
||||
private static Set<ModuleNeeded> modulesForRountine = new HashSet<>();
|
||||
private static Set<ModuleNeeded> missingModulesForRountine = new HashSet<>();
|
||||
|
||||
private static List<ModuleNeeded> systemModules = null;
|
||||
|
||||
@@ -513,6 +513,7 @@ public class ModulesNeededProvider {
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<ModuleNeeded> getModulesNeededForJobs() {
|
||||
IProxyRepositoryFactory repositoryFactory = repositoryService.getProxyRepositoryFactory();
|
||||
List<ModuleNeeded> importNeedsList = new ArrayList<ModuleNeeded>();
|
||||
@@ -1202,30 +1203,37 @@ public class ModulesNeededProvider {
|
||||
return mvnPath;
|
||||
}
|
||||
|
||||
private static void checkInstallStatus(Collection<ModuleNeeded> importNeedsList) {
|
||||
static void checkInstallStatus(Collection<ModuleNeeded> importNeedsList) {
|
||||
if (!importNeedsList.isEmpty()) {
|
||||
for (ModuleNeeded mod : importNeedsList) {
|
||||
if (ELibraryInstallStatus.INSTALLED != mod.getStatus()) {
|
||||
installModuleForRountine = true;
|
||||
if (ELibraryInstallStatus.NOT_INSTALLED == mod.getStatus()) {
|
||||
missingModulesForRountine.add(mod);
|
||||
}
|
||||
}
|
||||
modulesForRountine.addAll(importNeedsList);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean installModuleForRoutineOrBeans() {
|
||||
if (!installModuleForRountine) {
|
||||
for (ModuleNeeded mod : missingModulesForRountine) {
|
||||
if (ELibraryInstallStatus.NOT_INSTALLED != mod.getStatus()) {
|
||||
installModuleForRountine = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return installModuleForRountine;
|
||||
}
|
||||
|
||||
public static void setInstallModuleForRoutineOrBeans() {
|
||||
boolean allSet = true;
|
||||
for (ModuleNeeded mod : modulesForRountine) {
|
||||
if (ELibraryInstallStatus.INSTALLED != mod.getStatus()) {
|
||||
allSet = false;
|
||||
installModuleForRountine = false;
|
||||
Iterator<ModuleNeeded> iterator = missingModulesForRountine.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
ModuleNeeded mod = iterator.next();
|
||||
if (ELibraryInstallStatus.NOT_INSTALLED != mod.getStatus()) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
if (allSet) {
|
||||
installModuleForRountine = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1035,6 +1035,9 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
|
||||
if (localMavenUri == null) {
|
||||
localMavenUri = mvnUriStatusKey.replace("mvn:", "mvn:" + MavenConstants.LOCAL_RESOLUTION_URL + "!"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
if (!isResolveAllowed(localMavenUri)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
File resolvedJar = TalendMavenResolver.resolve(localMavenUri);
|
||||
if (resolvedJar != null) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.core.runtime.evaluator.AbstractPropertyValueEvaluator;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
import org.talend.core.runtime.util.GenericTypeUtils;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.daikon.properties.property.Property;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
@@ -84,6 +85,13 @@ public class MetadataContextPropertyValueEvaluator extends AbstractPropertyValue
|
||||
}
|
||||
|
||||
}
|
||||
if (GenericTypeUtils.isStringType(property)) {
|
||||
String val = String.valueOf(storedValue);
|
||||
if (property.isFlag(Property.Flags.ENCRYPT)) {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
return getTypedValue(property, currentStoredValue, storedValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
<!-- Seems those 3 are not useful -->
|
||||
<classloader
|
||||
index="HIVE:HORTONWORKS:HDP_1_0:EMBEDDED"
|
||||
libraries="hive-hbase-handler-0.9.0.jar;hbase-0.92.0.jar;hadoop-core-1.0.3.jar;commons-logging-1.0.4.jar;datanucleus-api-jdo-3.0.7.jar;datanucleus-core-3.0.9.jar;datanucleus-rdbms-3.0.8.jar;hive-builtins-0.9.0.jar;hive-exec-0.9.0_hdp.jar;hive-jdbc-0.9.0_hdp.jar;hive-metastore-0.9.0_hdp.jar;hive-service-0.9.0_hdp.jar;libfb303-0.7.0.jar;libthrift-0.7.0.jar;commons-lang-2.4.jar;antlr-runtime-3.0.1.jar;commons-dbcp-1.4.jar;commons-pool-1.5.4.jar;derby-10.4.2.0.jar;commons-configuration-1.6.jar;jdo2-api-2.3-ec.jar;log4j-1.2.17.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;jackson-core-asl-1.8.8.jar;jackson-mapper-asl-1.8.8.jar">
|
||||
libraries="hive-hbase-handler-0.9.0.jar;hbase-0.92.0.jar;hadoop-core-1.0.3.jar;commons-logging-1.0.4.jar;datanucleus-api-jdo-3.0.7.jar;datanucleus-core-3.0.9.jar;datanucleus-rdbms-3.0.8.jar;hive-builtins-0.9.0.jar;hive-exec-0.9.0_hdp.jar;hive-jdbc-0.9.0_hdp.jar;hive-metastore-0.9.0_hdp.jar;hive-service-0.9.0_hdp.jar;libfb303-0.7.0.jar;libthrift-0.7.0.jar;commons-lang-2.4.jar;antlr-runtime-3.0.1.jar;commons-dbcp-1.4.jar;commons-pool-1.5.4.jar;derby-10.4.2.0.jar;commons-configuration-1.6.jar;jdo2-api-2.3-ec.jar;reload4j-1.2.19.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;jackson-core-asl-1.8.8.jar;jackson-mapper-asl-1.8.8.jar">
|
||||
</classloader>
|
||||
<classloader
|
||||
index="HIVE:CLOUDERA:Cloudera_CDH3:STANDALONE"
|
||||
libraries="hadoop-core-0.20.203.0.jar;log4j-1.2.17.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
|
||||
libraries="hadoop-core-0.20.203.0.jar;reload4j-1.2.19.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
|
||||
</classloader>
|
||||
<classloader
|
||||
index="HIVE:AMAZON_EMR:MapR_EMR:STANDALONE"
|
||||
libraries="hadoop-core-0.20.203.0.jar;log4j-1.2.17.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
|
||||
libraries="hadoop-core-0.20.203.0.jar;reload4j-1.2.19.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
|
||||
</classloader>
|
||||
<!-- -->
|
||||
<classloader
|
||||
|
||||
@@ -576,6 +576,16 @@ public class MetadataConnectionUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isH2(DatabaseMetaData connectionMetadata) throws SQLException {
|
||||
if (connectionMetadata.getDriverName() != null && connectionMetadata.getDatabaseProductName() != null) {
|
||||
if (EDatabaseTypeName.H2.getDbType().equalsIgnoreCase(connectionMetadata.getDatabaseProductName().trim())) {
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isSybase16SA(IMetadataConnection connectionMetadata) throws SQLException {
|
||||
boolean isSybase16SA = false;
|
||||
if(connectionMetadata!=null) {
|
||||
|
||||
@@ -654,8 +654,9 @@ public class ImportExportHandlersManager {
|
||||
|
||||
importItemRecordsWithRelations(monitor, resManager, checkedItemRecords, overwrite,
|
||||
allImportItemRecords, destinationPath);
|
||||
|
||||
RelationshipItemBuilder.getInstance().buildAndSaveIndex();
|
||||
if (!CommonsPlugin.isTUJTest()) {
|
||||
RelationshipItemBuilder.getInstance().buildAndSaveIndex();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (Platform.inDebugMode()) {
|
||||
ExceptionHandler.process(e);
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
<version>1.9.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
</dependency>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
<artifactId>reload4j</artifactId>
|
||||
<version>1.2.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
@@ -54,6 +54,12 @@
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.10</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@@ -38,10 +38,9 @@
|
||||
<version>1.9.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
<type>bundle</type>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
<artifactId>reload4j</artifactId>
|
||||
<version>1.2.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
@@ -72,6 +71,12 @@
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.10</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -38,10 +38,9 @@
|
||||
<version>1.9.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
<type>bundle</type>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
<artifactId>reload4j</artifactId>
|
||||
<version>1.2.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
@@ -72,6 +71,12 @@
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.10</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.talend.daikon</groupId>
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.update.extension;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.talend.core.model.metadata.builder.connection.ConnectionFactory;
|
||||
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataTable;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
import org.talend.core.model.properties.DatabaseConnectionItem;
|
||||
import org.talend.core.model.properties.ItemState;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.PropertiesFactory;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.relationship.RelationshipItemBuilder;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.utils.ReflectionUtils;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.cwm.helper.PackageHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.IRepositoryNode.ENodeType;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
|
||||
import orgomg.cwm.resource.record.RecordFactory;
|
||||
import orgomg.cwm.resource.record.RecordFile;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class UpdateManagerProviderDetectorTest {
|
||||
|
||||
@Test
|
||||
public void testGetAllRelations() throws Exception {
|
||||
IProxyRepositoryFactory proxyRepositoryFactory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
|
||||
IRepositoryViewObject contextRepObject = null;
|
||||
IRepositoryViewObject metadataRepObject = null;
|
||||
ProcessItem item = null;
|
||||
ProcessItem item1 = null;
|
||||
try {
|
||||
Property property = PropertiesFactory.eINSTANCE.createProperty();
|
||||
ProcessType process = TalendFileFactory.eINSTANCE.createProcessType();
|
||||
item = PropertiesFactory.eINSTANCE.createProcessItem();
|
||||
item.setProperty(property);
|
||||
item.setProcess(process);
|
||||
property.setId(proxyRepositoryFactory.getNextId());
|
||||
property.setLabel("testjob");
|
||||
property.setVersion("0.1");
|
||||
ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
|
||||
itemState.setPath("");
|
||||
item.setState(itemState);
|
||||
|
||||
Property property1 = PropertiesFactory.eINSTANCE.createProperty();
|
||||
ProcessType process1 = TalendFileFactory.eINSTANCE.createProcessType();
|
||||
item1 = PropertiesFactory.eINSTANCE.createProcessItem();
|
||||
item1.setProperty(property1);
|
||||
item1.setProcess(process1);
|
||||
property1.setId(proxyRepositoryFactory.getNextId());
|
||||
property1.setLabel("testjob");
|
||||
property1.setVersion("0.1");
|
||||
ItemState itemState1 = PropertiesFactory.eINSTANCE.createItemState();
|
||||
itemState1.setPath("");
|
||||
item.setState(itemState1);
|
||||
|
||||
// test property
|
||||
Property metadataProperty = PropertiesFactory.eINSTANCE.createProperty();
|
||||
DatabaseConnectionItem metadataItem = PropertiesFactory.eINSTANCE.createDatabaseConnectionItem();
|
||||
ItemState metadataItemState = PropertiesFactory.eINSTANCE.createItemState();
|
||||
metadataItemState.setPath("");
|
||||
metadataItem.setProperty(metadataProperty);
|
||||
metadataProperty.setId(proxyRepositoryFactory.getNextId());
|
||||
metadataProperty.setLabel("testMetadata");
|
||||
metadataProperty.setVersion("0.1");
|
||||
DatabaseConnection connection = ConnectionFactory.eINSTANCE.createDatabaseConnection();
|
||||
connection.setName("mysql_1");
|
||||
connection.setId(proxyRepositoryFactory.getNextId());
|
||||
metadataItem.setConnection(connection);
|
||||
RecordFile record = (RecordFile) ConnectionHelper.getPackage(connection.getName(), connection, RecordFile.class);
|
||||
MetadataTable inputTable = ConnectionFactory.eINSTANCE.createMetadataTable();
|
||||
inputTable.setId(proxyRepositoryFactory.getNextId());
|
||||
inputTable.setLabel("Input");
|
||||
if (record != null) {
|
||||
PackageHelper.addMetadataTable(inputTable, record);
|
||||
} else {
|
||||
RecordFile newrecord = RecordFactory.eINSTANCE.createRecordFile();
|
||||
newrecord.setName(connection.getName());
|
||||
ConnectionHelper.addPackage(newrecord, connection);
|
||||
PackageHelper.addMetadataTable(inputTable, newrecord);
|
||||
}
|
||||
proxyRepositoryFactory.create(metadataItem, new Path(""));
|
||||
proxyRepositoryFactory.save(metadataItem);
|
||||
RelationshipItemBuilder.getInstance().addRelationShip(item, metadataProperty.getId(),
|
||||
RelationshipItemBuilder.LATEST_VERSION, RelationshipItemBuilder.PROPERTY_RELATION);
|
||||
|
||||
metadataRepObject = proxyRepositoryFactory.getSpecificVersion(metadataProperty.getId(), metadataProperty.getVersion(),
|
||||
true);
|
||||
RepositoryNode metadataNode = new RepositoryNode(metadataRepObject, null, ENodeType.REPOSITORY_ELEMENT);
|
||||
IStructuredSelection metadataSelection = new StructuredSelection(metadataNode);
|
||||
List relationList = (List) ReflectionUtils.invokeDeclaredMethod(UpdateManagerProviderDetector.INSTANCE,
|
||||
"getAllRelations", new Object[] { metadataSelection }, IStructuredSelection.class);
|
||||
Assert.assertEquals(relationList.size(), 1);
|
||||
|
||||
// test context
|
||||
Property contextProperty = PropertiesFactory.eINSTANCE.createProperty();
|
||||
ContextItem contextItem = PropertiesFactory.eINSTANCE.createContextItem();
|
||||
ItemState contextItemState = PropertiesFactory.eINSTANCE.createItemState();
|
||||
contextItemState.setPath("");
|
||||
contextItem.setProperty(contextProperty);
|
||||
contextItem.setState(contextItemState);
|
||||
contextProperty.setId(proxyRepositoryFactory.getNextId());
|
||||
contextProperty.setLabel("testContext");
|
||||
contextProperty.setVersion("0.1");
|
||||
proxyRepositoryFactory.create(contextItem, new Path(""));
|
||||
proxyRepositoryFactory.save(contextItem);
|
||||
RelationshipItemBuilder.getInstance().addRelationShip(item, contextProperty.getId(),
|
||||
RelationshipItemBuilder.LATEST_VERSION, RelationshipItemBuilder.CONTEXT_RELATION);
|
||||
|
||||
contextRepObject = proxyRepositoryFactory.getSpecificVersion(contextProperty.getId(), contextProperty.getVersion(),
|
||||
true);
|
||||
RepositoryNode contextNode = new RepositoryNode(contextRepObject, null, ENodeType.REPOSITORY_ELEMENT);
|
||||
IStructuredSelection contextSelection = new StructuredSelection(contextNode);
|
||||
relationList = (List) ReflectionUtils.invokeDeclaredMethod(UpdateManagerProviderDetector.INSTANCE, "getAllRelations",
|
||||
new Object[] { contextSelection }, IStructuredSelection.class);
|
||||
Assert.assertEquals(relationList.size(), 1);
|
||||
|
||||
RelationshipItemBuilder.getInstance().addRelationShip(item1, contextProperty.getId(),
|
||||
RelationshipItemBuilder.LATEST_VERSION, RelationshipItemBuilder.CONTEXT_RELATION);
|
||||
relationList = (List) ReflectionUtils.invokeDeclaredMethod(UpdateManagerProviderDetector.INSTANCE, "getAllRelations",
|
||||
new Object[] { contextSelection }, IStructuredSelection.class);
|
||||
Assert.assertEquals(relationList.size(), 2);
|
||||
|
||||
} finally {
|
||||
if (item !=null) {
|
||||
RelationshipItemBuilder.getInstance().removeItemRelations(item);
|
||||
}
|
||||
|
||||
if (item1 != null) {
|
||||
RelationshipItemBuilder.getInstance().removeItemRelations(item1);
|
||||
}
|
||||
|
||||
if (contextRepObject != null) {
|
||||
proxyRepositoryFactory.deleteObjectPhysical(contextRepObject);
|
||||
}
|
||||
|
||||
if (metadataRepObject != null) {
|
||||
proxyRepositoryFactory.deleteObjectPhysical(metadataRepObject);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
@@ -38,6 +39,7 @@ import org.eclipse.m2e.core.MavenPlugin;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.talend.commons.utils.MojoType;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Project;
|
||||
@@ -48,6 +50,7 @@ import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.nexus.TalendMavenResolver;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
@@ -58,6 +61,7 @@ import org.talend.designer.maven.DesignerMavenPlugin;
|
||||
import org.talend.designer.maven.model.TalendJavaProjectConstants;
|
||||
import org.talend.designer.maven.model.TalendMavenConstants;
|
||||
import org.talend.designer.maven.utils.PomIdsHelper;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
import org.talend.designer.runprocess.IRunProcessService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
@@ -104,6 +108,44 @@ public class AggregatorPomsHelperTest {
|
||||
defaultUseSnapshot = false;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNeedInstallRootPom() throws Exception {
|
||||
Model modelBak = null;
|
||||
File installedPomFile = null;
|
||||
try {
|
||||
IFile pomFile = helper.getProjectRootPom();
|
||||
assertFalse(helper.needInstallRootPom(pomFile));
|
||||
Model model = MavenPlugin.getMaven().readModel(pomFile.getLocation().toFile());
|
||||
String mvnUrl = MavenUrlHelper.generateMvnUrl(model.getGroupId(), model.getArtifactId(), model.getVersion(),
|
||||
MavenConstants.PACKAGING_POM, null);
|
||||
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
|
||||
String artifactPath = PomUtil.getAbsArtifactPath(artifact);
|
||||
|
||||
installedPomFile = new File(artifactPath);
|
||||
modelBak = MavenPlugin.getMaven().readModel(installedPomFile);
|
||||
Model installedModel = MavenPlugin.getMaven().readModel(installedPomFile);
|
||||
|
||||
// test ci-builder
|
||||
Plugin mojo = installedModel.getBuild().getPlugins().stream()
|
||||
.filter(p -> p.getArtifactId().equals(MojoType.CI_BUILDER.getArtifactId())).findFirst().get();
|
||||
String versionBak = mojo.getVersion();
|
||||
mojo.setVersion("1.1.1");
|
||||
PomUtil.savePom(null, installedModel, installedPomFile);
|
||||
assertTrue(helper.needInstallRootPom(pomFile));
|
||||
|
||||
// test signer
|
||||
mojo.setVersion(versionBak);
|
||||
installedModel.getProperties().setProperty(MojoType.SIGNER.getVersionKey(), "1.1.1");
|
||||
PomUtil.savePom(null, installedModel, installedPomFile);
|
||||
assertTrue(helper.needInstallRootPom(pomFile));
|
||||
} finally {
|
||||
// restore m2 project pom file
|
||||
if (modelBak != null && installedPomFile != null) {
|
||||
PomUtil.savePom(null, modelBak, installedPomFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddToAndRemoveFromParentModules() throws Exception {
|
||||
String projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
// ============================================================================
|
||||
package org.talend.librariesmanager.model;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -19,6 +20,8 @@ import java.util.Set;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
|
||||
import org.talend.core.model.general.ModuleStatusProvider;
|
||||
import org.talend.core.model.properties.PropertiesFactory;
|
||||
import org.talend.core.model.properties.RoutineItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
@@ -93,4 +96,26 @@ public class ModulesNeededProviderTest {
|
||||
Assert.assertEquals(module1.get(0).getContext(), "Global Routines " + routineItem.getProperty().getLabel());
|
||||
Assert.assertEquals(module2.get(0).getContext(), "Global Routines " + routineItem.getProperty().getLabel());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInstallModuleForRoutineOrBeans() throws Exception {
|
||||
ModuleNeeded module1 = new ModuleNeeded("", "ModulesNeededProviderTest", "description", false, null, null,
|
||||
"mvn:org.talend.librariesmanager.model/ModulesNeededProviderTest/8.0.1");
|
||||
try {
|
||||
ModuleStatusProvider.putStatus(module1.getMavenUri(), ELibraryInstallStatus.NOT_INSTALLED);
|
||||
ModulesNeededProvider.getModulesNeeded().add(module1);
|
||||
ModulesNeededProvider.checkInstallStatus(Arrays.asList(module1));
|
||||
Assert.assertTrue("Don't need to rebuild the codes project here",
|
||||
ModulesNeededProvider.installModuleForRoutineOrBeans() == false);
|
||||
ModuleStatusProvider.putStatus(module1.getMavenUri(), ELibraryInstallStatus.INSTALLED);
|
||||
Assert.assertTrue("Need to rebuild the codes project here",
|
||||
ModulesNeededProvider.installModuleForRoutineOrBeans() == true);
|
||||
ModulesNeededProvider.setInstallModuleForRoutineOrBeans();
|
||||
Assert.assertTrue("Don't need to rebuild the codes project here",
|
||||
ModulesNeededProvider.installModuleForRoutineOrBeans() == false);
|
||||
} finally {
|
||||
ModulesNeededProvider.getModulesNeeded().remove(module1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ import org.talend.core.language.ECodeLanguage;
|
||||
import org.talend.core.model.components.IComponentsService;
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
|
||||
import org.talend.core.model.general.ModuleStatusProvider;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.nexus.ArtifactRepositoryBean;
|
||||
import org.talend.core.nexus.NexusServerUtils;
|
||||
@@ -532,6 +533,22 @@ public class LocalLibraryManagerTest {
|
||||
assertFalse(lm.isResolveAllowed("a")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResolveLocallySnapshotNoUpdate() {
|
||||
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(NexusServerUtils.ORG_TALEND_DESIGNER_CORE);
|
||||
int bak = node.getInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, 0);
|
||||
String mvnUrl = "mvn:a.b.c/d/1.0/jar";
|
||||
try {
|
||||
ModuleStatusProvider.putDeployStatus(mvnUrl, ELibraryInstallStatus.DEPLOYED);
|
||||
node.putInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, -1);
|
||||
LocalLibraryManager lm = new LocalLibraryManager();
|
||||
assertNull(lm.resolveStatusLocally(mvnUrl));
|
||||
} finally {
|
||||
node.putInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, bak);
|
||||
ModuleStatusProvider.putDeployStatus(mvnUrl, ELibraryInstallStatus.NOT_INSTALLED);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testNexusUpdateJar() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user