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