Lines 20-27
Link Here
|
20 |
import org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile; |
20 |
import org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile; |
21 |
import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo; |
21 |
import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo; |
22 |
import org.eclipse.equinox.internal.provisional.p2.core.Version; |
22 |
import org.eclipse.equinox.internal.provisional.p2.core.Version; |
23 |
import org.eclipse.equinox.p2.publisher.IPublisherInfo; |
23 |
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; |
24 |
import org.eclipse.equinox.p2.publisher.IPublisherResult; |
24 |
import org.eclipse.equinox.p2.publisher.*; |
25 |
import org.eclipse.equinox.p2.publisher.actions.RootIUAdvice; |
25 |
import org.eclipse.equinox.p2.publisher.actions.RootIUAdvice; |
26 |
import org.eclipse.equinox.p2.publisher.eclipse.*; |
26 |
import org.eclipse.equinox.p2.publisher.eclipse.*; |
27 |
import org.eclipse.equinox.p2.tests.TestData; |
27 |
import org.eclipse.equinox.p2.tests.TestData; |
Lines 74-79
Link Here
|
74 |
//TODO assert branding was done correctly |
74 |
//TODO assert branding was done correctly |
75 |
} |
75 |
} |
76 |
|
76 |
|
|
|
77 |
public void testLicense() throws Exception { |
78 |
ProductFile productFile = new ProductFile(TestData.getFile("ProductActionTest", "productWithLicense.product").toString()); |
79 |
PublisherInfo info = new PublisherInfo(); |
80 |
info.setConfigurations(new String[] {"win32.win32.x86"}); |
81 |
testAction = new ProductAction(source, productFile, flavorArg, executablesFeatureLocation); |
82 |
testAction.perform(info, publisherResult, null); |
83 |
Collection ius = publisherResult.getIUs("licenseIU.product", IPublisherResult.NON_ROOT); |
84 |
assertEquals("1.0", 1, ius.size()); |
85 |
IInstallableUnit iu = (IInstallableUnit) ius.iterator().next(); |
86 |
assertEquals("1.1", "http://www.example.com", iu.getLicense().getLocation().toString()); |
87 |
assertEquals("1.2", "This is the liCenSE.", iu.getLicense().getBody().trim()); |
88 |
} |
89 |
|
90 |
public void testLicenseNoURL() throws Exception { |
91 |
ProductFile productFile = new ProductFile(TestData.getFile("ProductActionTest", "licenseNoURL.product").toString()); |
92 |
PublisherInfo info = new PublisherInfo(); |
93 |
info.setConfigurations(new String[] {"win32.win32.x86"}); |
94 |
testAction = new ProductAction(source, productFile, flavorArg, executablesFeatureLocation); |
95 |
testAction.perform(info, publisherResult, null); |
96 |
Collection ius = publisherResult.getIUs("licenseIU.product", IPublisherResult.NON_ROOT); |
97 |
assertEquals("1.0", 1, ius.size()); |
98 |
IInstallableUnit iu = (IInstallableUnit) ius.iterator().next(); |
99 |
assertEquals("1.1", "", iu.getLicense().getLocation().toString()); |
100 |
assertEquals("1.2", "This is the liCenSE.", iu.getLicense().getBody().trim()); |
101 |
} |
102 |
|
103 |
public void testLicenseNoText() throws Exception { |
104 |
ProductFile productFile = new ProductFile(TestData.getFile("ProductActionTest", "licenseNoText.product").toString()); |
105 |
PublisherInfo info = new PublisherInfo(); |
106 |
info.setConfigurations(new String[] {"win32.win32.x86"}); |
107 |
testAction = new ProductAction(source, productFile, flavorArg, executablesFeatureLocation); |
108 |
testAction.perform(info, publisherResult, null); |
109 |
Collection ius = publisherResult.getIUs("licenseIU.product", IPublisherResult.NON_ROOT); |
110 |
assertEquals("1.0", 1, ius.size()); |
111 |
IInstallableUnit iu = (IInstallableUnit) ius.iterator().next(); |
112 |
assertEquals("1.1", "http://www.example.com", iu.getLicense().getLocation().toString()); |
113 |
assertEquals("1.2", "", iu.getLicense().getBody().trim()); |
114 |
} |
115 |
|
116 |
public void testMissingLicense() throws Exception { |
117 |
ProductFile productFile = new ProductFile(TestData.getFile("ProductActionTest", "productWithNoLicense.product").toString()); |
118 |
PublisherInfo info = new PublisherInfo(); |
119 |
info.setConfigurations(new String[] {"win32.win32.x86"}); |
120 |
testAction = new ProductAction(source, productFile, flavorArg, executablesFeatureLocation); |
121 |
testAction.perform(info, publisherResult, null); |
122 |
Collection ius = publisherResult.getIUs("licenseIU.product", IPublisherResult.NON_ROOT); |
123 |
assertEquals("1.0", 1, ius.size()); |
124 |
IInstallableUnit iu = (IInstallableUnit) ius.iterator().next(); |
125 |
assertNull("1.1", iu.getLicense()); |
126 |
} |
127 |
|
77 |
/** |
128 |
/** |
78 |
* Tests that a product file containing bundle configuration data produces appropriate |
129 |
* Tests that a product file containing bundle configuration data produces appropriate |
79 |
* IConfigAdvice (start levels, auto-start). |
130 |
* IConfigAdvice (start levels, auto-start). |