|
Lines 17-22
Link Here
|
| 17 |
import org.eclipse.core.runtime.*; |
17 |
import org.eclipse.core.runtime.*; |
| 18 |
import org.eclipse.pde.build.tests.BuildConfiguration; |
18 |
import org.eclipse.pde.build.tests.BuildConfiguration; |
| 19 |
import org.eclipse.pde.build.tests.PDETestCase; |
19 |
import org.eclipse.pde.build.tests.PDETestCase; |
|
|
20 |
import org.eclipse.pde.internal.build.IPDEBuildConstants; |
| 20 |
|
21 |
|
| 21 |
/** |
22 |
/** |
| 22 |
* These tests are not included in the main test suite unless the "pde.build.includeFetch" system property |
23 |
* These tests are not included in the main test suite unless the "pde.build.includeFetch" system property |
|
Lines 40-71
Link Here
|
| 40 |
|
41 |
|
| 41 |
public void testGetUnpack() throws Exception { |
42 |
public void testGetUnpack() throws Exception { |
| 42 |
IFolder buildFolder = newTest("testGetUnpack"); |
43 |
IFolder buildFolder = newTest("testGetUnpack"); |
| 43 |
|
44 |
|
| 44 |
StringBuffer buffer = new StringBuffer(); |
45 |
StringBuffer buffer = new StringBuffer(); |
| 45 |
buffer.append("plugin@javax.xml.rpc,1.1.0=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/bundles/javax.xml.rpc_1.1.0.v200905122109.zip,unpack=true\n"); |
46 |
buffer.append("plugin@javax.xml.rpc,1.1.0=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/bundles/javax.xml.rpc_1.1.0.v200905122109.zip,unpack=true\n"); |
| 46 |
buffer.append("plugin@com.ibm.icu.base,3.6.0=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/updateSite/plugins/com.ibm.icu.base_3.6.0.v20080530.jar,unpack=true,dest=${buildDirectory}/plugins/com.ibm.icu.base_3.6.0/.zip\n"); |
47 |
buffer.append("plugin@com.ibm.icu.base,3.6.0=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/updateSite/plugins/com.ibm.icu.base_3.6.0.v20080530.jar,unpack=true,dest=${buildDirectory}/plugins/com.ibm.icu.base_3.6.0/.zip\n"); |
| 47 |
buffer.append("plugin@com.ibm.icu.base,3.6.1=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/updateSite/plugins/com.ibm.icu.base_3.6.1.v20080530.jar,unpack=true\n"); |
48 |
buffer.append("plugin@com.ibm.icu.base,3.6.1=GET,http://download.eclipse.org/tools/orbit/downloads/drops/R20090825191606/updateSite/plugins/com.ibm.icu.base_3.6.1.v20080530.jar,unpack=true\n"); |
| 48 |
Utils.writeBuffer(buildFolder.getFile("directory.txt"), buffer); |
49 |
Utils.writeBuffer(buildFolder.getFile("directory.txt"), buffer); |
| 49 |
|
50 |
|
| 50 |
Utils.generateFeature(buildFolder, "org.eclipse.pde.build.container.feature", null, new String[] {"javax.xml.rpc", "com.ibm.icu.base;version=3.6.0.qualifier", "com.ibm.icu.base;version=3.6.1.qualifier"}); |
51 |
Utils.generateFeature(buildFolder, "org.eclipse.pde.build.container.feature", null, new String[] {"javax.xml.rpc", "com.ibm.icu.base;version=3.6.0.qualifier", "com.ibm.icu.base;version=3.6.1.qualifier"}); |
| 51 |
|
52 |
|
| 52 |
Properties fetchProperties = new Properties(); |
53 |
Properties fetchProperties = new Properties(); |
| 53 |
fetchProperties.put("buildDirectory", buildFolder.getLocation().toOSString()); |
54 |
fetchProperties.put("buildDirectory", buildFolder.getLocation().toOSString()); |
| 54 |
fetchProperties.put("type", "feature"); |
55 |
fetchProperties.put("type", "feature"); |
| 55 |
fetchProperties.put("id", "org.eclipse.pde.build.container.feature"); |
56 |
fetchProperties.put("id", "org.eclipse.pde.build.container.feature"); |
| 56 |
|
57 |
|
| 57 |
URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null); |
58 |
URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null); |
| 58 |
String buildXMLPath = FileLocator.toFileURL(resource).getPath(); |
59 |
String buildXMLPath = FileLocator.toFileURL(resource).getPath(); |
| 59 |
runAntScript(buildXMLPath, new String[] {"fetchElement"}, buildFolder.getLocation().toOSString(), fetchProperties); |
60 |
runAntScript(buildXMLPath, new String[] {"fetchElement"}, buildFolder.getLocation().toOSString(), fetchProperties); |
| 60 |
|
61 |
|
| 61 |
assertResourceFile(buildFolder.getFile("plugins/javax.xml.rpc_1.1.0.v200905122109/META-INF/MANIFEST.MF")); |
62 |
assertResourceFile(buildFolder.getFile("plugins/javax.xml.rpc_1.1.0.v200905122109/META-INF/MANIFEST.MF")); |
| 62 |
assertResourceFile(buildFolder.getFile("plugins/com.ibm.icu.base_3.6.0/META-INF/MANIFEST.MF")); |
63 |
assertResourceFile(buildFolder.getFile("plugins/com.ibm.icu.base_3.6.0/META-INF/MANIFEST.MF")); |
| 63 |
assertResourceFile(buildFolder.getFile("plugins/com.ibm.icu.base_3.6.1.v20080530/META-INF/MANIFEST.MF")); |
64 |
assertResourceFile(buildFolder.getFile("plugins/com.ibm.icu.base_3.6.1.v20080530/META-INF/MANIFEST.MF")); |
| 64 |
} |
65 |
} |
| 65 |
|
66 |
|
| 66 |
public void testFetchFeature() throws Exception { |
67 |
public void testFetchFeature() throws Exception { |
| 67 |
IFolder buildFolder = newTest("fetchFeature"); |
68 |
IFolder buildFolder = newTest("fetchFeature"); |
| 68 |
|
69 |
|
| 69 |
StringBuffer buffer = new StringBuffer(); |
70 |
StringBuffer buffer = new StringBuffer(); |
| 70 |
buffer.append("feature@org.eclipse.cvs=v20090619,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,,org.eclipse.cvs-feature\n"); |
71 |
buffer.append("feature@org.eclipse.cvs=v20090619,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,,org.eclipse.cvs-feature\n"); |
| 71 |
buffer.append("plugin@org.eclipse.cvs=v20090520,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,,org.eclipse.sdk-feature/plugins/org.eclipse.cvs\n"); |
72 |
buffer.append("plugin@org.eclipse.cvs=v20090520,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,,org.eclipse.sdk-feature/plugins/org.eclipse.cvs\n"); |
|
Lines 73-89
Link Here
|
| 73 |
buffer.append("plugin@org.eclipse.team.cvs.ssh2=I20090508-2000,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,\n"); |
74 |
buffer.append("plugin@org.eclipse.team.cvs.ssh2=I20090508-2000,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,\n"); |
| 74 |
buffer.append("plugin@org.eclipse.team.cvs.ui=I20090521-1750,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,\n"); |
75 |
buffer.append("plugin@org.eclipse.team.cvs.ui=I20090521-1750,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,\n"); |
| 75 |
Utils.writeBuffer(buildFolder.getFile("directory.txt"), buffer); |
76 |
Utils.writeBuffer(buildFolder.getFile("directory.txt"), buffer); |
| 76 |
|
77 |
|
| 77 |
Properties fetchProperties = new Properties(); |
78 |
Properties fetchProperties = new Properties(); |
| 78 |
fetchProperties.put("buildDirectory", buildFolder.getLocation().toOSString()); |
79 |
fetchProperties.put("buildDirectory", buildFolder.getLocation().toOSString()); |
| 79 |
fetchProperties.put("type", "feature"); |
80 |
fetchProperties.put("type", "feature"); |
| 80 |
fetchProperties.put("id", "org.eclipse.cvs"); |
81 |
fetchProperties.put("id", "org.eclipse.cvs"); |
| 81 |
|
82 |
|
| 82 |
URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null); |
83 |
URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null); |
| 83 |
String buildXMLPath = FileLocator.toFileURL(resource).getPath(); |
84 |
String buildXMLPath = FileLocator.toFileURL(resource).getPath(); |
| 84 |
runAntScript(buildXMLPath, new String[] {"fetchElement"}, buildFolder.getLocation().toOSString(), fetchProperties); |
85 |
runAntScript(buildXMLPath, new String[] {"fetchElement"}, buildFolder.getLocation().toOSString(), fetchProperties); |
|
|
86 |
|
| 87 |
IFile sourceRefsFile = buildFolder.getFile(IPDEBuildConstants.DEFAULT_SOURCE_REFERENCES_FILENAME_DESCRIPTOR); |
| 88 |
assertResourceFile(sourceRefsFile); |
| 89 |
Properties sourceRefs = Utils.loadProperties(sourceRefsFile); |
| 90 |
assertEquals(sourceRefs.get("org.eclipse.cvs,0.0.0"), "scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.sdk-feature/plugins/org.eclipse.cvs;project=org.eclipse.cvs,tag=v20090520"); |
| 91 |
assertEquals(sourceRefs.get("org.eclipse.team.cvs.core,0.0.0"), "scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.core:project=org.eclipse.team.cvs.core;tag=I20090430-0408"); |
| 92 |
assertEquals(sourceRefs.get("org.eclipse.team.cvs.ssh2,0.0.0"), "scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.team.cvs.ssh2:project=org.eclipse.team.cvs.ssh2;tag=I20090508-2000"); |
| 85 |
} |
93 |
} |
| 86 |
|
94 |
|
| 87 |
public void testBug248767_2() throws Exception { |
95 |
public void testBug248767_2() throws Exception { |
| 88 |
IFolder buildFolder = newTest("248767_2"); |
96 |
IFolder buildFolder = newTest("248767_2"); |
| 89 |
IFolder base = Utils.createFolder(buildFolder, "base"); |
97 |
IFolder base = Utils.createFolder(buildFolder, "base"); |
|
Lines 136-142
Link Here
|
| 136 |
assertResourceFile(buildFolder, "plugins/com.ibm.icu.base_3.6.1.v20080530.jar"); |
144 |
assertResourceFile(buildFolder, "plugins/com.ibm.icu.base_3.6.1.v20080530.jar"); |
| 137 |
assertResourceFile(buildFolder, "plugins/com.ibm.icu.base_3.6.0.v20080530.jar"); |
145 |
assertResourceFile(buildFolder, "plugins/com.ibm.icu.base_3.6.0.v20080530.jar"); |
| 138 |
} |
146 |
} |
| 139 |
|
147 |
|
| 140 |
public void testP2Get() throws Exception { |
148 |
public void testP2Get() throws Exception { |
| 141 |
IFolder buildFolder = newTest("p2.get"); |
149 |
IFolder buildFolder = newTest("p2.get"); |
| 142 |
Utils.createFolder(buildFolder, "plugins"); |
150 |
Utils.createFolder(buildFolder, "plugins"); |
|
Lines 148-154
Link Here
|
| 148 |
Map replacements = new HashMap(); |
156 |
Map replacements = new HashMap(); |
| 149 |
replacements.put("repoLocation", repoLocation.toExternalForm()); |
157 |
replacements.put("repoLocation", repoLocation.toExternalForm()); |
| 150 |
Utils.transferAndReplace(mapFile, buildFolder.getFile("directory.txt"), replacements); |
158 |
Utils.transferAndReplace(mapFile, buildFolder.getFile("directory.txt"), replacements); |
| 151 |
|
159 |
|
| 152 |
//org.eclipse.pde.build.container.feature is special in that the fetch won't try |
160 |
//org.eclipse.pde.build.container.feature is special in that the fetch won't try |
| 153 |
//to fetch it, and will just fetch everything it includes. |
161 |
//to fetch it, and will just fetch everything it includes. |
| 154 |
Properties fetchProperties = new Properties(); |
162 |
Properties fetchProperties = new Properties(); |