Search in sources :

Example 1 with ImportExportHandlersManager

use of org.talend.repository.items.importexport.handlers.ImportExportHandlersManager in project tdi-studio-se by Talend.

the class BigDataEeImportTest method importEeDemo.

@Before
public void importEeDemo() throws Exception {
    initDemo(BIG_DATA_EE_DEMO_PLUGIN_ID);
    Assert.assertNotNull(currentDemo);
    initTestPaths();
    initTempPro();
    eeResManager = DemoImportTestUtil.getResourceManager(currentDemo);
    Assert.assertNotNull(eeResManager);
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    List<ImportItem> projectRecords = importManager.populateImportingItems(eeResManager, true, new NullProgressMonitor());
    Assert.assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), eeResManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) Before(org.junit.Before)

Example 2 with ImportExportHandlersManager

use of org.talend.repository.items.importexport.handlers.ImportExportHandlersManager in project tdi-studio-se by Talend.

the class BigdataCeImportTest method importCeDemo.

@Before
public void importCeDemo() throws Exception {
    initDemo(BIG_DATA_CE_DEMO_PLUGIN_ID);
    if (currentDemo == null) {
        // maybe license problem, the demo plugin is not loaded.
        return;
    }
    initTestPaths();
    initTempPro();
    Assert.assertNotNull(currentDemo);
    ceResManager = DemoImportTestUtil.getResourceManager(currentDemo);
    Assert.assertNotNull(ceResManager);
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    List<ImportItem> projectRecords = importManager.populateImportingItems(ceResManager, true, new NullProgressMonitor());
    Assert.assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), ceResManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) Before(org.junit.Before)

Example 3 with ImportExportHandlersManager

use of org.talend.repository.items.importexport.handlers.ImportExportHandlersManager in project tdi-studio-se by Talend.

the class BuildJobHandlerTest method setUp.

@Before
public void setUp() throws Exception {
    // Fix the NPE for org.talend.designer.core.ui.editor.process.Process.createMainParameters(Process.java:401)
    bridgeProject = ReponsitoryContextBridge.getProject();
    ReponsitoryContextBridge.setProject(ProjectManager.getInstance().getCurrentProject().getEmfProject());
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    // job with tdm and tdq component.
    URL testJobURL = FileLocator.find(Platform.getBundle("org.talend.repository.test"), new Path("/resources/testBuildJob.zip"), null);
    if (testJobURL != null) {
        testJobURL = FileLocator.toFileURL(testJobURL);
    }
    File srcFile = new File(testJobURL.getFile());
    FileResourcesUnityManager fileUnityManager = ResourcesManagerFactory.getInstance().createFileUnityManager(srcFile);
    ResourcesManager resManager = fileUnityManager.doUnify();
    List<ImportItem> projectRecords = importManager.populateImportingItems(resManager, true, new NullProgressMonitor());
    assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), resManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
    IRepositoryViewObject obj = ProxyRepositoryFactory.getInstance().getLastVersion("_bWyBUAYbEeapTZ0aKwL_YA");
    Item item = obj.getProperty().getItem();
    assertTrue(item instanceof ProcessItem);
    processItem = (ProcessItem) item;
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) Path(org.eclipse.core.runtime.Path) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) ProcessItem(org.talend.core.model.properties.ProcessItem) Item(org.talend.core.model.properties.Item) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) ProcessItem(org.talend.core.model.properties.ProcessItem) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) FileResourcesUnityManager(org.talend.repository.items.importexport.ui.managers.FileResourcesUnityManager) ResourcesManager(org.talend.repository.items.importexport.manager.ResourcesManager) ZipFile(java.util.zip.ZipFile) File(java.io.File) URL(java.net.URL) Before(org.junit.Before)

Example 4 with ImportExportHandlersManager

use of org.talend.repository.items.importexport.handlers.ImportExportHandlersManager in project tdi-studio-se by Talend.

the class DqDemoImportTest method importDqDemo.

@Before
public void importDqDemo() throws Exception {
    initDemo(DQ_DEMO_PLUGIN_ID);
    Assert.assertNotNull(currentDemo);
    initTestPaths();
    initTempPro();
    // For DQ,has special structure to create for temp project before test
    initDQStructure();
    dqResManager = DemoImportTestUtil.getResourceManager(currentDemo);
    Assert.assertNotNull(dqResManager);
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    List<ImportItem> projectRecords = importManager.populateImportingItems(dqResManager, true, new NullProgressMonitor());
    Assert.assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), dqResManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) Before(org.junit.Before)

Example 5 with ImportExportHandlersManager

use of org.talend.repository.items.importexport.handlers.ImportExportHandlersManager in project tdi-studio-se by Talend.

the class EsbDemoImportTest method importEsbDemo.

@Before
public void importEsbDemo() throws Exception {
    initDemo(ESB_DEMO_PLUGIN_ID);
    Assert.assertNotNull(currentDemo);
    initTestPaths();
    initTempPro();
    esbResManager = DemoImportTestUtil.getResourceManager(currentDemo);
    Assert.assertNotNull(esbResManager);
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    List<ImportItem> projectRecords = importManager.populateImportingItems(esbResManager, true, new NullProgressMonitor());
    Assert.assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), esbResManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) Before(org.junit.Before)

Aggregations

ImportExportHandlersManager (org.talend.repository.items.importexport.handlers.ImportExportHandlersManager)8 ImportItem (org.talend.repository.items.importexport.handlers.model.ImportItem)8 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)7 Before (org.junit.Before)7 ZipFile (java.util.zip.ZipFile)2 Item (org.talend.core.model.properties.Item)2 ProcessItem (org.talend.core.model.properties.ProcessItem)2 ResourcesManager (org.talend.repository.items.importexport.manager.ResourcesManager)2 File (java.io.File)1 IOException (java.io.IOException)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 Path (org.eclipse.core.runtime.Path)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 ERepositoryStatus (org.talend.commons.runtime.model.repository.ERepositoryStatus)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 FileResourcesUnityManager (org.talend.repository.items.importexport.ui.managers.FileResourcesUnityManager)1 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)1