| 1 |
|
package liquibase.integration.commandline; |
| 2 |
|
|
| 3 |
|
import liquibase.integration.commandline.CommandLineResourceAccessor; |
| 4 |
|
import liquibase.resource.AbstractFileOpenerTest; |
| 5 |
|
import liquibase.resource.ResourceAccessor; |
| 6 |
|
import static org.junit.Assert.*; |
| 7 |
|
import org.junit.Test; |
| 8 |
|
|
| 9 |
|
import java.io.IOException; |
| 10 |
|
import java.io.InputStream; |
| 11 |
|
import java.net.URL; |
| 12 |
|
import java.util.Enumeration; |
| 13 |
|
|
| 14 |
|
|
| 15 |
|
@link |
| 16 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
| 17 |
|
public class CommandLineFileOpenerTest extends AbstractFileOpenerTest { |
| 18 |
|
|
| 19 |
|
|
| 20 |
|
@see |
| 21 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 22 |
3
|
@Override... |
| 23 |
|
protected ResourceAccessor createFileOpener() { |
| 24 |
3
|
return new CommandLineResourceAccessor(Thread.currentThread().getContextClassLoader()); |
| 25 |
|
} |
| 26 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
| 27 |
1
|
@Test... |
| 28 |
|
public void getResourceAsStream() throws Exception { |
| 29 |
1
|
InputStream inputStream = resourceAccessor.getResourceAsStream("liquibase/integration/ant/AntFileOpenerTest.class"); |
| 30 |
1
|
assertNotNull(inputStream); |
| 31 |
|
} |
| 32 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
1
PASS
|
|
| 33 |
1
|
@Test(expected = IOException.class)... |
| 34 |
|
public void getResourceAsStreamNonExistantFile() throws Exception { |
| 35 |
1
|
resourceAccessor.getResourceAsStream("non/existant/file.txt"); |
| 36 |
|
} |
| 37 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1
PASS
|
|
| 38 |
1
|
@Test... |
| 39 |
|
public void getResources() throws Exception { |
| 40 |
1
|
Enumeration<URL> resources = resourceAccessor.getResources("liquibase/ant"); |
| 41 |
1
|
assertNotNull(resources); |
| 42 |
|
} |
| 43 |
|
} |