use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class GenerateSelectSQLAction method getPrePostfix.
/**
* Get Prepostfix.
*
* @param node the selected node
* @return PrePostfix
*/
private String getPrePostfix(IRepositoryNode node) {
RepositoryNode root = SQLBuilderRepositoryNodeManager.getRoot((RepositoryNode) node);
DatabaseConnection connection = (DatabaseConnection) ((ConnectionItem) root.getObject().getProperty().getItem()).getConnection();
if (TextUtil.isDoubleQuotesNeededDbType(connection.getDatabaseType())) {
//$NON-NLS-1$
return "\"";
}
//$NON-NLS-1$
return "";
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class MetadataRefreshAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*
*/
@Override
public void run() {
SQLBuilderRepositoryNodeManager.saveMetadataColumn(repositorynodes, columnNodes);
for (RepositoryNode node : repositorynodes) {
dialog.refreshNode(node);
}
dialog.refreshNode(SQLBuilderRepositoryNodeManager.getRoot(repositorynodes.get(0)));
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class JobVersionUtilsTest method testGetCurrentVersion.
/**
* Test method for
* {@link org.talend.repository.utils.JobVersionUtils#getCurrentVersion(org.talend.repository.model.RepositoryNode)}
* .
*
* @throws PersistenceException
*/
@Test
public void testGetCurrentVersion() throws PersistenceException {
repositoryObject = createRepositoryObject("job1");
RepositoryNode childrenNode = mock(RepositoryNode.class);
when(childrenNode.getObject()).thenReturn(repositoryObject);
when(childrenNode.getId()).thenReturn(repositoryObject.getProperty().getId());
List<IRepositoryNode> children = new ArrayList<IRepositoryNode>();
children.add(childrenNode);
RepositoryNode folderNode = mock(RepositoryNode.class);
when(folderNode.getObject()).thenReturn(folder);
when(folderNode.getId()).thenReturn(folder.getId());
when(folderNode.getChildren()).thenReturn(children);
// test,one situation
String vesion = JobVersionUtils.getCurrentVersion(folderNode);
assertEquals(vesion, "0.1");
// test,two situation
repositoryObject.getProperty().setVersion("0.2");
String vesion2 = JobVersionUtils.getCurrentVersion(folderNode);
assertEquals(vesion2, "0.2");
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class AbstractRootNodeContentProviderTest method testTopNodeLoad.
@Test
public void testTopNodeLoad() {
if (contentProvider == null) {
return;
}
final ERepositoryObjectType testType = getTestType();
assertNotNull(testType);
RepositoryNode testNode = ProjectRepositoryNode.getInstance().getRootRepositoryNode(testType);
assertNotNull(testNode);
Object[] elements = null;
if (isRoot()) {
elements = contentProvider.getElements(root);
} else {
elements = contentProvider.getChildren(root);
}
assertNotNull(elements);
// must children
assert (elements.length > 0);
assert (Arrays.asList(elements).contains(testNode));
}
use of org.talend.repository.model.RepositoryNode in project tdi-studio-se by Talend.
the class JobTopNodesPropertyTesterTest method testIsJobDesignsNode4WrongType.
@Test
public void testIsJobDesignsNode4WrongType() {
RepositoryNode node = new RepositoryNode(null, null, ENodeType.SYSTEM_FOLDER);
node.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.CONTEXT);
assertFalse(tester.isJobDesignsNode(node));
}
Aggregations