1 package com.atlassian.plugin.loaders.classloading;
2
3 import java.io.File;
4 import java.util.Collection;
5
6 import org.junit.After;
7 import org.junit.Before;
8 import org.junit.Test;
9
10 import static org.hamcrest.MatcherAssert.assertThat;
11 import static org.hamcrest.Matchers.empty;
12
13 public class TestEmptyScanner
14 {
15 private EmptyScanner emptyScanner;
16
17 @Before
18 public void setUp()
19 {
20 emptyScanner = new EmptyScanner();
21 }
22
23 @After
24 public void tearDown()
25 {
26 emptyScanner = null;
27 }
28
29 @Test
30 public void scanReturnsEmpty()
31 {
32 final Collection<DeploymentUnit> deploymentUnits = emptyScanner.scan();
33 assertThat(deploymentUnits, empty());
34 }
35
36 @Test
37 public void getDeploymentUnitsReturnsEmpty()
38 {
39 final Collection<DeploymentUnit> deploymentUnits = emptyScanner.getDeploymentUnits();
40 assertThat(deploymentUnits, empty());
41 }
42
43 @Test
44 public void resetDoesNotThrow()
45 {
46 emptyScanner.reset();
47 }
48
49 @Test
50 public void removeDoesNotThrow()
51 {
52 final DeploymentUnit deploymentUnit = new DeploymentUnit(new File("unit"));
53 emptyScanner.remove(deploymentUnit);
54 }
55 }