Skip to content

Commit 63960bf

Browse files
changes Tycho version [4.0.0 --> 4.0.6] (#303)
1 parent bc982d5 commit 63960bf

File tree

4 files changed

+68
-6
lines changed

4 files changed

+68
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
</profile>
5050
</profiles>
5151
<properties>
52-
<tycho-version>4.0.0</tycho-version>
52+
<tycho-version>4.0.6</tycho-version>
5353
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5454
</properties>
5555
<build>

test/org.abapgit.adt.ui.test/src/org/abapgit/adt/ui/internal/wizards/TestPdeAbapGitSwitchBranchWizard.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.junit.Before;
2626
import org.junit.Test;
2727

28-
import com.sap.adt.tools.core.base.test.services.AdtPdeTestProjectUtil;
2928
import com.sap.adt.tools.core.model.adtcore.IAdtObjectReference;
3029
import com.sap.adt.tools.core.project.AdtProjectServiceFactory;
3130
import com.sap.adt.tools.core.ui.packages.IAdtPackageServiceUI;
@@ -43,11 +42,12 @@ public class TestPdeAbapGitSwitchBranchWizard {
4342
private IAdtPackageServiceUI mockPackageServiceUI;
4443
private IExternalRepositoryInfoService mockExternalRepoInfoService;
4544
private IRepositoryService mockRepoService;
46-
45+
4746
@Before
4847
public void setUp() throws CoreException {
4948
// Create project and test data
50-
mockProject = AdtPdeTestProjectUtil.createTestProject(this.getClass().getName());
49+
TestPdeAbapGitWizardUtil util = new TestPdeAbapGitWizardUtil();
50+
mockProject = util.createDummyAbapProject(this.getClass().getName());
5151
testDestination = AdtProjectServiceFactory.createProjectService().getDestinationId(mockProject);
5252

5353
// Create fresh mocks for each test

test/org.abapgit.adt.ui.test/src/org/abapgit/adt/ui/internal/wizards/TestPdeAbapGitSwitchBranchWizardPackageValidations.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
import org.eclipse.jface.wizard.IWizardContainer;
2121
import org.eclipse.osgi.util.NLS;
2222
import org.junit.Before;
23+
import org.junit.After;
2324
import org.junit.Test;
2425

25-
import com.sap.adt.tools.core.base.test.services.AdtPdeTestProjectUtil;
26+
2627
import com.sap.adt.tools.core.model.adtcore.IAdtObjectReference;
2728
import com.sap.adt.tools.core.project.AdtProjectServiceFactory;
2829
import com.sap.adt.tools.core.ui.packages.IAdtPackageServiceUI;
@@ -44,10 +45,12 @@ public class TestPdeAbapGitSwitchBranchWizardPackageValidations {
4445
private IWizardContainer mockWizardContainer;
4546
private IExternalRepositoryInfo mockExtRepoInfoFromSetup;
4647
private IAdtObjectReference mockAdtObjectRefFromSetup;
48+
4749

4850
@Before
4951
public void setUp() throws CoreException {
50-
mockProject = AdtPdeTestProjectUtil.createTestProject(this.getClass().getName());
52+
TestPdeAbapGitWizardUtil util = new TestPdeAbapGitWizardUtil();
53+
mockProject = util.createDummyAbapProject(this.getClass().getName());
5154
testDestination = AdtProjectServiceFactory.createProjectService().getDestinationId(mockProject);
5255
mockSelRepo = createNiceMock(IRepository.class);
5356
mockPackageServiceUI = createMock(IAdtPackageServiceUI.class);
@@ -84,6 +87,13 @@ public void setUp() throws CoreException {
8487

8588
reset(mockPackageServiceUI, mockExternalRepoInfoService, mockWizardContainer);
8689
}
90+
91+
@After
92+
public void tearDown() throws Exception {
93+
if (mockProject != null && mockProject.exists()) {
94+
mockProject.delete(true, true, null);
95+
}
96+
}
8797

8898
@Test
8999
public void getPackageRef_whenPackageDoesNotExist_throwsPackageRefNotFoundException() {
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package org.abapgit.adt.ui.internal.wizards;
2+
3+
import org.eclipse.core.resources.IProject;
4+
import org.eclipse.core.resources.IWorkspace;
5+
import org.eclipse.core.resources.IWorkspaceRunnable;
6+
import org.eclipse.core.resources.ResourcesPlugin;
7+
import org.eclipse.core.runtime.CoreException;
8+
import org.eclipse.core.runtime.IProgressMonitor;
9+
import org.eclipse.core.runtime.NullProgressMonitor;
10+
11+
import com.sap.adt.destinations.model.AdtDestinationDataFactory;
12+
import com.sap.adt.destinations.model.IDestinationData;
13+
import com.sap.adt.destinations.model.IDestinationDataWritable;
14+
import com.sap.adt.tools.core.internal.AbapProject;
15+
import com.sap.adt.tools.core.project.AdtProjectServiceFactory;
16+
import com.sap.adt.tools.core.project.IAbapProjectService;
17+
18+
public class TestPdeAbapGitWizardUtil {
19+
20+
public IProject createDummyAbapProject(String projectName) throws CoreException {
21+
String destinationId = projectName;
22+
IDestinationDataWritable data = AdtDestinationDataFactory.newDestinationData(destinationId);
23+
data.setUser("TEST_DUMMY_USER");
24+
data.setClient("777");
25+
data.setLanguage("DE");
26+
data.setPassword("TEST_DUMMY_PW");
27+
28+
String projectDestinationId = AdtProjectServiceFactory.createProjectService().createDestinationId(projectName);
29+
final IDestinationData destinationData = data.getReadOnlyClone(projectDestinationId);
30+
31+
32+
33+
final IAbapProjectService abapProjectService = AdtProjectServiceFactory.createProjectService();
34+
IWorkspace workspace = ResourcesPlugin.getWorkspace();
35+
final AbapProject[] projects = new AbapProject[1];
36+
37+
// Clean up if project already exists
38+
IProject project = workspace.getRoot().getProject(projectName);
39+
if (project.exists()) {
40+
project.delete(true, true, null);
41+
}
42+
43+
workspace.run(new IWorkspaceRunnable() {
44+
@Override
45+
public void run(IProgressMonitor monitor) throws CoreException {
46+
projects[0] = (AbapProject) abapProjectService.createAbapProject(projectName, destinationData, monitor);
47+
}
48+
}, new NullProgressMonitor());
49+
return projects[0].getProject();
50+
}
51+
52+
}

0 commit comments

Comments
 (0)