Lines 14-22
Link Here
|
14 |
package org.netbeans.modules.apisupport.project; |
14 |
package org.netbeans.modules.apisupport.project; |
15 |
|
15 |
|
16 |
import java.io.File; |
16 |
import java.io.File; |
17 |
import java.io.IOException; |
|
|
18 |
import java.util.Collections; |
17 |
import java.util.Collections; |
19 |
import java.util.jar.Manifest; |
|
|
20 |
import org.netbeans.api.project.ProjectManager; |
18 |
import org.netbeans.api.project.ProjectManager; |
21 |
import org.netbeans.junit.NbTestCase; |
19 |
import org.netbeans.junit.NbTestCase; |
22 |
import org.netbeans.modules.apisupport.project.suite.SuiteProject; |
20 |
import org.netbeans.modules.apisupport.project.suite.SuiteProject; |
Lines 55-78
Link Here
|
55 |
user.mkdirs(); |
53 |
user.mkdirs(); |
56 |
System.setProperty("netbeans.user", user.getAbsolutePath()); |
54 |
System.setProperty("netbeans.user", user.getAbsolutePath()); |
57 |
install = new File(getWorkDir(), "install"); |
55 |
install = new File(getWorkDir(), "install"); |
58 |
makePlatform(install); |
56 |
TestBase.makePlatform(install); |
59 |
// Now set up build.properties accordingly: |
57 |
// Now set up build.properties accordingly: |
60 |
InstalledFileLocatorImpl.registerDestDir(install); |
58 |
InstalledFileLocatorImpl.registerDestDir(install); |
61 |
((Install) SharedClassObject.findObject(Install.class, true)).restored(); |
59 |
((Install) SharedClassObject.findObject(Install.class, true)).restored(); |
62 |
assertEquals("set up run correctly", install.getAbsolutePath(), PropertyUtils.getGlobalProperties().getProperty("nbplatform.default.netbeans.dest.dir")); |
60 |
assertEquals("set up run correctly", install.getAbsolutePath(), PropertyUtils.getGlobalProperties().getProperty("nbplatform.default.netbeans.dest.dir")); |
63 |
install2 = new File(getWorkDir(), "install2"); |
61 |
install2 = new File(getWorkDir(), "install2"); |
64 |
makePlatform(install2); |
62 |
TestBase.makePlatform(install2); |
65 |
NbPlatform.addPlatform("install2", install2, "install2"); |
63 |
NbPlatform.addPlatform("install2", install2, "install2"); |
66 |
} |
64 |
} |
67 |
|
65 |
|
68 |
private static void makePlatform(File d) throws IOException { |
|
|
69 |
// To satisfy NbPlatform.defaultPlatformLocation and NbPlatform.isValid, and make at least one module: |
70 |
Manifest mani = new Manifest(); |
71 |
mani.getMainAttributes().putValue("OpenIDE-Module", "core"); |
72 |
TestBase.createJar(new File(new File(new File(d, "platform"), "core"), "core.jar"), Collections.EMPTY_MAP, mani); |
73 |
TestBase.dump(new File(new File(d, "harness"), "suite.xml"), ""); |
74 |
} |
75 |
|
76 |
/** Make sure everything is working as expected when there are no breakages. */ |
66 |
/** Make sure everything is working as expected when there are no breakages. */ |
77 |
public void testEverythingNormal() throws Exception { |
67 |
public void testEverythingNormal() throws Exception { |
78 |
// Try making a standalone module w/ default platform, confirm loaded OK. |
68 |
// Try making a standalone module w/ default platform, confirm loaded OK. |