01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
03: * program and the accompanying materials are made available under the terms of
04: * the Eclipse Public License v1.0 which accompanies this distribution, and is
05: * available at http://www.eclipse.org/legal/epl-v10.html
06: *
07: * Contributors: IBM Corporation - initial API and implementation
08: ******************************************************************************/package org.eclipse.pde.build.internal.tests;
09:
10: import java.util.Properties;
11: import org.eclipse.core.resources.IFile;
12: import org.eclipse.core.resources.IFolder;
13: import org.eclipse.pde.build.tests.PDETestCase;
14:
15: public class FetchTests extends PDETestCase {
16:
17: public void testBug174194() throws Exception {
18: IFolder buildFolder = newTest("174194");
19: IFile script = buildFolder.getFile("testbuild.xml");
20:
21: try {
22: runAntScript(script.getLocation().toOSString(),
23: new String[] { "default" }, buildFolder
24: .getLocation().toOSString(),
25: new Properties());
26: } catch (Exception e) {
27: assertTrue(e
28: .getMessage()
29: .endsWith(
30: "Could not retrieve feature.xml or build.properties for feature org.eclipse.rcp."));
31: }
32:
33: assertResourceFile(buildFolder, "log.log");
34: assertLogContainsLine(buildFolder.getFile("log.log"),
35: "[eclipse.fetch] Could not retrieve feature.xml and/or build.properties:");
36: }
37:
38: // public void testBug171869_Get() throws Exception {
39: // IFolder buildFolder = newTest("171869");
40: // Utils.createFolder(buildFolder, "plugins");
41: //
42: // //org.eclipse.pde.build.container.feature is special in that the fetch won't try
43: // //to fetch it, and will just fetch everything it includes.
44: // Properties fetchProperties = new Properties();
45: // fetchProperties.put("buildDirectory", buildFolder.getLocation().toOSString());
46: // fetchProperties.put("type", "feature");
47: // fetchProperties.put("id", "org.eclipse.pde.build.container.feature");
48: //
49: // URL resource = FileLocator.find(Platform.getBundle("org.eclipse.pde.build"), new Path("/scripts/genericTargets.xml"), null);
50: // String buildXMLPath = FileLocator.toFileURL(resource).getPath();
51: // runAntScript(buildXMLPath, new String[] {"fetchElement"}, buildFolder.getLocation().toOSString(), fetchProperties);
52: //
53: // assertResourceFile(buildFolder, "plugins/com.ibm.icu.base_3.6.1.v20070417.jar");
54: // assertResourceFile(buildFolder, "plugins/com.ibm.icu.base_3.6.0.20061215.jar");
55: // }
56: }
|