|
Lines 148-153
Link Here
|
| 148 |
} |
148 |
} |
| 149 |
} |
149 |
} |
| 150 |
|
150 |
|
|
|
151 |
public void testCreateLocation05() { |
| 152 |
Location configLocation = LocationManager.getConfigurationLocation(); |
| 153 |
File testLocationFile = OSGiTestsActivator.getContext().getDataFile("testLocations/testCreateLocation01"); |
| 154 |
Location testLocation = configLocation.createLocation(null, null, false); |
| 155 |
try { |
| 156 |
testLocation.set(testLocationFile.toURL(), false); |
| 157 |
} catch (Throwable t) { |
| 158 |
fail("Failed to set location", t); |
| 159 |
} |
| 160 |
try { |
| 161 |
assertTrue("Could not lock location", testLocation.lock()); |
| 162 |
assertFalse("Could lock a secend time", testLocation.lock()); |
| 163 |
assertFalse("Could lock a third time", testLocation.lock()); |
| 164 |
} catch (IOException e) { |
| 165 |
fail("Failed to lock location", e); |
| 166 |
} finally { |
| 167 |
testLocation.release(); |
| 168 |
} |
| 169 |
try { |
| 170 |
assertTrue("Could not lock location", testLocation.lock()); |
| 171 |
} catch (IOException e) { |
| 172 |
fail("Failed to lock location", e); |
| 173 |
} finally { |
| 174 |
testLocation.release(); |
| 175 |
} |
| 176 |
} |
| 177 |
|
| 151 |
public void testSetLocationWithEmptyLockFile() { |
178 |
public void testSetLocationWithEmptyLockFile() { |
| 152 |
Location configLocation = LocationManager.getConfigurationLocation(); |
179 |
Location configLocation = LocationManager.getConfigurationLocation(); |
| 153 |
File testLocationFile = OSGiTestsActivator.getContext().getDataFile("testLocations/testSetLocationWithEmptyLockFile"); //$NON-NLS-1$ |
180 |
File testLocationFile = OSGiTestsActivator.getContext().getDataFile("testLocations/testSetLocationWithEmptyLockFile"); //$NON-NLS-1$ |