Compare commits

..

1 Commits

Author SHA1 Message Date
cbadillo1603
ac27d7763f fix(TBD-12184):Password field missing for tImpalaRow (#4520) (#4928)
* Revert "Revert "fix(TBD-12184):Password field missing for tImpalaRow (#4472)" (#4507)"

This reverts commit f7fb174301.

* fix(TBD-12184):Password field missing for tImpalaRow

* fix(TBD-12184):Password field missing for tImpalaRow

* fix(TBD-12184):Password field missing for tImpalaRow

* fix(TBD-12184):Password field missing for tImpalaRow
2022-01-04 15:17:24 +01:00
51 changed files with 110 additions and 1638 deletions

View File

@@ -95,10 +95,11 @@
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
</dependency>
</dependencies>
<build>

View File

@@ -57,8 +57,6 @@ 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() {
@@ -125,35 +123,6 @@ 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.

View File

@@ -142,7 +142,6 @@ 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;
@@ -2468,15 +2467,6 @@ 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;

View File

@@ -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-2.1.210.jar")), //$NON-NLS-1$
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-1.4.198.jar")), //$NON-NLS-1$
//
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby.jar")), //$NON-NLS-1$
@@ -71,10 +71,9 @@ 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", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "org.apache.log4j_1.2.15.v201012070815.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
"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" })),
"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$
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$
@@ -88,7 +87,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", "reload4j-1.2.19.jar",
"json-smart-2.4.7.jar", "nimbus-jose-jwt-8.11.jar", "javax.mail-1.6.2.jar", "log4j-1.2.17.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$
@@ -169,9 +168,9 @@ public enum EDatabaseVersion4Drivers {
MAPRDB(new DbVersion4Drivers(EDatabaseTypeName.MAPRDB, new String[] {})),
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
new String[]{ "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"redshift-jdbc42-no-awssdk-1.2.37.1061.jar")), //$NON-NLS-1$
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.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$
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$
"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$

View File

@@ -69,8 +69,6 @@ public interface IMetadataTable {
public boolean sameMetadataAs(IMetadataTable other, int options);
public boolean sameMetadataAs(List<IMetadataColumn> otherMetadataTableColumns, int options);
public void sortCustomColumns();
public boolean isReadOnly();

View File

@@ -252,13 +252,8 @@ public class MetadataTable implements IMetadataTable, Cloneable {
if (!(input instanceof IMetadataTable)) {
return false;
}
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);
List<IMetadataColumn> inputColumnListWithUnselected = input.getListColumns(true);
if (thisColumnListWithUnselected == null) {
if (inputColumnListWithUnselected != null) {
return false;
@@ -300,6 +295,9 @@ 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)) {

View File

@@ -58,11 +58,6 @@ 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();

View File

@@ -1086,18 +1086,6 @@ 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;

View File

@@ -2023,8 +2023,8 @@ public abstract class RepositoryUpdateManager {
};
repositoryUpdateManager.checkAddContextGroup = detectAddContextGroup;
repositoryUpdateManager.isConfigContextGroup = repositoryContextManager.isConfigContextGroup();
if (repositoryContextManager != null) {
repositoryUpdateManager.isConfigContextGroup = repositoryContextManager.isConfigContextGroup();
// add for bug 9119 context group
Map<ContextItem, List<IContext>> repositoryContextGroupMap = new HashMap<ContextItem, List<IContext>>();
List<IContext> addGroupContext = repositoryContextManager.getAddGroupContext();

View File

@@ -310,8 +310,8 @@ public enum UpdateManagerProviderDetector {
Item item = node.getObject().getProperty().getItem();
List<Relation> allRelations = new ArrayList<Relation>();
if (node.getObject() != null) {
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsHaveRelationWith(item.getProperty().getId(),
RelationshipItemBuilder.LATEST_VERSION);
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(item.getProperty().getId(),
RelationshipItemBuilder.LATEST_VERSION, RelationshipItemBuilder.PROPERTY_RELATION);
if (relations != null && relations.size() > 0) {
allRelations.addAll(relations);
}

View File

@@ -337,6 +337,7 @@ 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));

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/log4j-api-2.17.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/log4j-core-2.17.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="lib/log4j-api-2.16.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/log4j-core-2.16.0.jar"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -55,6 +55,6 @@ Export-Package: org.talend.core,
org.talend.core.views,
org.talend.designer.runprocess
Import-Package: org.apache.commons.collections4.map
Bundle-ClassPath: .,
lib/log4j-api-2.17.1.jar,
lib/log4j-core-2.17.1.jar
Bundle-ClassPath: lib/log4j-api-2.16.0.jar,
lib/log4j-core-2.16.0.jar,
.

View File

@@ -13,7 +13,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
</dependencies>
<build>

View File

@@ -101,7 +101,6 @@ 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;
@@ -706,6 +705,7 @@ 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,8 +721,6 @@ public class ProcessorUtilities {
*/
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
handelDQComponents(selectedProcessItem, currentProcess);
copyDependenciedResources(currentProcess, progressMonitor);
return processor;
@@ -1251,6 +1249,8 @@ public class ProcessorUtilities {
processor.setArguments(argumentsMap);
handelDQComponents(selectedProcessItem, currentProcess);
generateContextInfo(jobInfo, selectedContextName, statistics, trace, needContext, progressMonitor,
currentProcess, currentJobName, processor, isMainJob, codeGenerationNeeded);
@@ -1266,8 +1266,6 @@ public class ProcessorUtilities {
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
TimeMeasure.step(idTimer, "generateBuildInfo");
handelDQComponents(selectedProcessItem, currentProcess);
copyDependenciedResources(currentProcess, progressMonitor);
return processor;
@@ -2522,13 +2520,6 @@ 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);

View File

@@ -19,10 +19,6 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
</exclusions>
</dependency>

View File

@@ -14,22 +14,22 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
</dependencies>
<build>

View File

@@ -20,7 +20,7 @@
<module>zip/pom.xml</module>
</modules>
<properties>
<m2.fasterxml.jackson.version>2.13.2</m2.fasterxml.jackson.version>
<m2.fasterxml.jackson.version>2.11.4</m2.fasterxml.jackson.version>
<jackson-codehaus.version>1.9.16-TALEND</jackson-codehaus.version>
</properties>
</project>

View File

@@ -10,7 +10,7 @@
<artifactId>studio-tacokit-dependencies</artifactId>
<packaging>pom</packaging>
<properties>
<tacokit.components.version>1.27.8</tacokit.components.version>
<tacokit.components.version>1.27.0</tacokit.components.version>
</properties>
<repositories>
<repository>

View File

@@ -11,10 +11,9 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.38.6</tcomp.version>
<tcomp.version>1.38.5</tcomp.version>
<slf4j.version>1.7.32</slf4j.version>
<log4j2.version>2.17.1</log4j2.version>
<reload4j.version>1.2.19</reload4j.version>
<log4j2.version>2.16.0</log4j2.version>
</properties>
<repositories>
@@ -142,17 +141,6 @@
<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>

View File

@@ -33,7 +33,7 @@
<artifactItem>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository</artifactId>
<version>7.3.1.v20220325</version>
<version>7.3.1.v20211025</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}/../repository</outputDirectory>

View File

@@ -206,11 +206,6 @@
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@@ -14,7 +14,6 @@ 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;
@@ -25,7 +24,6 @@ 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;
@@ -35,7 +33,6 @@ 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;
@@ -57,7 +54,6 @@ 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;
@@ -79,7 +75,6 @@ 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;
@@ -147,7 +142,8 @@ public class AggregatorPomsHelper {
public void installRootPom(boolean force) throws Exception {
IFile pomFile = getProjectRootPom();
if (pomFile.exists()) {
if (force || needInstallRootPom(pomFile)) {
Model model = MavenPlugin.getMaven().readModel(pomFile.getLocation().toFile());
if (force || !isPomInstalled(model.getGroupId(), model.getArtifactId(), model.getVersion())) {
MavenPomCommandLauncher launcher =
new MavenPomCommandLauncher(pomFile, TalendMavenConstants.GOAL_INSTALL);
Map<String, Object> argumentsMap = new HashMap<>();
@@ -159,40 +155,9 @@ public class AggregatorPomsHelper {
}
}
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 boolean isPomInstalled(String groupId, String artifactId, String version) {
String mvnUrl = MavenUrlHelper.generateMvnUrl(groupId, artifactId, version, MavenConstants.PACKAGING_POM, null);
return PomUtil.isAvailable(mvnUrl);
}
public IFolder getProjectPomsFolder() {

View File

@@ -324,8 +324,7 @@ public class BuildCacheManager {
Parent parent = new Parent();
parent.setGroupId(PomIdsHelper.getProjectGroupId());
parent.setArtifactId(PomIdsHelper.getProjectArtifactId());
parent.setVersion(PomIdsHelper.getProjectVersion());
parent.setRelativePath(".");
parent.setVersion(PomIdsHelper.getProjectVersion());
model.setParent(parent);
PomUtil.savePom(null, model, pomFile);
}

View File

@@ -105,11 +105,12 @@ public class ProcessorDependenciesManager {
Dependency dependency = PomUtil.createModuleDependency(mavenUri);
if (dependency != null) {
((SortableDependency) dependency).setAssemblyOptional(optional);
Exclusion exclusion = new Exclusion();
exclusion.setGroupId("*"); //$NON-NLS-1$
exclusion.setArtifactId("*"); //$NON-NLS-1$
dependency.addExclusion(exclusion);
if (module.isExcludeDependencies()) {
Exclusion exclusion = new Exclusion();
exclusion.setGroupId("*"); //$NON-NLS-1$
exclusion.setArtifactId("*"); //$NON-NLS-1$
dependency.addExclusion(exclusion);
}
neededDependencies.add(dependency);
}
}

View File

@@ -10,26 +10,20 @@
<artifactId>org.talend.libraries.apache</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<reload4j.version>1.2.19</reload4j.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.25</slf4j.version>
<log4j2.version>2.17.1</log4j2.version>
<log4j2.version>2.16.0</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>${reload4j.version}</version>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.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>
@@ -94,7 +88,7 @@
<excludeTypes>pom</excludeTypes>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<includeGroupIds>ch.qos.reload4j,org.slf4j,org.apache.logging.log4j</includeGroupIds>
<includeGroupIds>log4j,org.slf4j,org.apache.logging.log4j</includeGroupIds>
</configuration>
</execution>
</executions>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="lib" kind="lib" path="lib/h2-2.1.210.jar"/>
<classpathentry exported="true" kind="lib" path="lib/h2-1.4.198.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -4,7 +4,7 @@ Bundle-Name: H2
Bundle-SymbolicName: org.talend.libraries.jdbc.h2
Bundle-Version: 7.3.1.qualifier
Bundle-ClassPath: .,
lib/h2-2.1.210.jar
lib/h2-1.4.198.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,6 +35,7 @@ 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,

View File

@@ -1,4 +1,4 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/h2-2.1.210.jar
lib/h2-1.4.198.jar

View File

@@ -28,7 +28,7 @@
<artifactItem>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.210</version>
<version>1.4.198</version>
</artifactItem>
</artifactItems>
</configuration>

View File

@@ -49,7 +49,7 @@ public class ExportCustomSettingsAction extends Action {
public void run() {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
FileDialog dialog = new FileDialog(shell, SWT.SAVE);
dialog.setText(Messages.getString("ExportCustomSettingsAction.title"));
dialog.setText(Messages.getString("ImportCustomSettingsAction.title"));
String selectedFile = dialog.open();
if (selectedFile != null) {
CustomUriManager.getInstance().exportSettings(dialog.getFilterPath(), dialog.getFileName());

View File

@@ -57,32 +57,12 @@ 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 {
Date result = null;
try {
if(rs.getTimestamp(index) != null) {
result = new Date(rs.getTimestamp(index).getTime());
return result;
}
} catch (java.sql.SQLException e) {
if(rs.getTimestamp(index) != null) {
return new Date(rs.getTimestamp(index).getTime());
}
try {
if(rs.getDate(index) != null) {
result = new Date(rs.getDate(index).getTime());
return result;
}
} catch (java.sql.SQLException e) {
}
return result;
return null;
}
//decrease the get method call number

View File

@@ -313,13 +313,10 @@ 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;
}

View File

@@ -140,7 +140,7 @@ public class ModulesNeededProvider {
private static volatile boolean installModuleForRountine = false;
private static Set<ModuleNeeded> missingModulesForRountine = new HashSet<>();
private static Set<ModuleNeeded> modulesForRountine = new HashSet<>();
private static List<ModuleNeeded> systemModules = null;
@@ -513,7 +513,6 @@ public class ModulesNeededProvider {
/**
* @deprecated
*/
@Deprecated
public static List<ModuleNeeded> getModulesNeededForJobs() {
IProxyRepositoryFactory repositoryFactory = repositoryService.getProxyRepositoryFactory();
List<ModuleNeeded> importNeedsList = new ArrayList<ModuleNeeded>();
@@ -1203,37 +1202,30 @@ public class ModulesNeededProvider {
return mvnPath;
}
static void checkInstallStatus(Collection<ModuleNeeded> importNeedsList) {
private static void checkInstallStatus(Collection<ModuleNeeded> importNeedsList) {
if (!importNeedsList.isEmpty()) {
for (ModuleNeeded mod : importNeedsList) {
if (ELibraryInstallStatus.NOT_INSTALLED == mod.getStatus()) {
missingModulesForRountine.add(mod);
if (ELibraryInstallStatus.INSTALLED != mod.getStatus()) {
installModuleForRountine = true;
}
}
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() {
installModuleForRountine = false;
Iterator<ModuleNeeded> iterator = missingModulesForRountine.iterator();
while (iterator.hasNext()) {
ModuleNeeded mod = iterator.next();
if (ELibraryInstallStatus.NOT_INSTALLED != mod.getStatus()) {
iterator.remove();
boolean allSet = true;
for (ModuleNeeded mod : modulesForRountine) {
if (ELibraryInstallStatus.INSTALLED != mod.getStatus()) {
allSet = false;
}
}
if (allSet) {
installModuleForRountine = false;
}
}
}

View File

@@ -1035,9 +1035,6 @@ 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) {

View File

@@ -22,7 +22,6 @@ 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;
@@ -85,13 +84,6 @@ 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);
}

View File

@@ -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;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">
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">
</classloader>
<classloader
index="HIVE:CLOUDERA:Cloudera_CDH3:STANDALONE"
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">
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">
</classloader>
<classloader
index="HIVE:AMAZON_EMR:MapR_EMR:STANDALONE"
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">
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">
</classloader>
<!-- -->
<classloader

View File

@@ -576,16 +576,6 @@ 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) {

View File

@@ -654,9 +654,8 @@ public class ImportExportHandlersManager {
importItemRecordsWithRelations(monitor, resManager, checkedItemRecords, overwrite,
allImportItemRecords, destinationPath);
if (!CommonsPlugin.isTUJTest()) {
RelationshipItemBuilder.getInstance().buildAndSaveIndex();
}
RelationshipItemBuilder.getInstance().buildAndSaveIndex();
} catch (Exception e) {
if (Platform.inDebugMode()) {
ExceptionHandler.process(e);

View File

@@ -31,10 +31,10 @@
<version>1.9.12</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
@@ -54,12 +54,6 @@
<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>

View File

@@ -38,9 +38,10 @@
<version>1.9.12</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
@@ -71,12 +72,6 @@
<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>

View File

@@ -38,9 +38,10 @@
<version>1.9.12</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
@@ -71,12 +72,6 @@
<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>

View File

@@ -1,170 +0,0 @@
// ============================================================================
//
// 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);
}
}
}
}

View File

@@ -24,7 +24,6 @@ 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;
@@ -39,7 +38,6 @@ 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;
@@ -50,7 +48,6 @@ 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;
@@ -61,7 +58,6 @@ 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;
@@ -108,44 +104,6 @@ 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();

View File

@@ -37,14 +37,14 @@ public class CreateMavenJobPomTest {
@Test
public void testNormalizeSpaces() throws Exception {
String inputSh = "#!/bin/sh\n" + "cd `dirname $0`\n" + "ROOT_PATH=`pwd`\n"
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.17.1.jar:$ROOT_PATH/../lib/log4j-api-2.17.1.jar:$ROOT_PATH/../lib/log4j-core-2.17.1.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.16.0.jar:$ROOT_PATH/../lib/log4j-api-2.16.0.jar:$ROOT_PATH/../lib/log4j-core-2.16.0.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
String expectSh = "#!/bin/sh\n" + "cd `dirname $0`\n" + "ROOT_PATH=`pwd`\n"
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.17.1.jar:$ROOT_PATH/../lib/log4j-api-2.17.1.jar:$ROOT_PATH/../lib/log4j-core-2.17.1.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.16.0.jar:$ROOT_PATH/../lib/log4j-api-2.16.0.jar:$ROOT_PATH/../lib/log4j-core-2.16.0.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
String inputBat = "%~d0\n" + "cd %~dp0\n"
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.17.1.jar;../lib/log4j-api-2.17.1.jar;../lib/log4j-core-2.17.1.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.16.0.jar;../lib/log4j-api-2.16.0.jar;../lib/log4j-core-2.16.0.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
String expectBat = "%~d0\n" + "cd %~dp0\n"
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.17.1.jar;../lib/log4j-api-2.17.1.jar;../lib/log4j-core-2.17.1.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.16.0.jar;../lib/log4j-api-2.16.0.jar;../lib/log4j-core-2.16.0.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
String actualSh = CreateMavenJobPom.normalizeSpaces(inputSh);
assertEquals(expectSh, actualSh);

View File

@@ -12,7 +12,6 @@
// ============================================================================
package org.talend.librariesmanager.model;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -20,8 +19,6 @@ 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;
@@ -96,26 +93,4 @@ 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);
}
}
}

View File

@@ -60,7 +60,6 @@ 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;
@@ -533,22 +532,6 @@ 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 {