|
3 | 3 | import com.google.common.eventbus.EventBus; |
4 | 4 | import com.google.inject.Guice; |
5 | 5 | import com.google.inject.Injector; |
6 | | -import com.google.inject.Key; |
7 | | -import com.google.inject.TypeLiteral; |
8 | | -import edu.wpi.grip.core.*; |
| 6 | +import edu.wpi.grip.core.GRIPCoreModule; |
| 7 | +import edu.wpi.grip.core.Pipeline; |
9 | 8 | import edu.wpi.grip.core.operations.Operations; |
10 | 9 | import edu.wpi.grip.core.settings.ProjectSettings; |
11 | | -import edu.wpi.grip.core.sources.ImageFileSource; |
12 | 10 | import edu.wpi.grip.generated.CVOperations; |
13 | 11 | import edu.wpi.grip.util.Files; |
14 | 12 | import org.junit.Before; |
15 | 13 | import org.junit.Test; |
16 | 14 |
|
17 | 15 | import java.io.*; |
18 | 16 | import java.net.URI; |
19 | | -import java.util.List; |
20 | | -import java.util.Optional; |
21 | 17 |
|
22 | 18 | import static junit.framework.TestCase.assertEquals; |
23 | 19 |
|
24 | 20 | /** |
25 | 21 | * This tests for backwards compatibility by opening a project file containing ALL the steps of GRIP |
26 | | - * at the time of this file's creation. |
| 22 | + * at the time of this file's creation. Please note that this test requires a webcam at position 0. |
27 | 23 | */ |
28 | 24 | public class CompatibilityTest { |
29 | 25 |
|
30 | 26 | private static final URI testphotoURI = Files.testphotoURI; //The location of the photo source for the test |
31 | 27 | private static final URI testprojectURI = Files.testprojectURI; //The location of the save file for the test |
32 | 28 |
|
33 | | - private Connection.Factory<Object> connectionFactory; |
34 | | - private ImageFileSource.Factory imageSourceFactory; |
35 | | - private Step.Factory stepFactory; |
36 | 29 | private Pipeline pipeline; |
37 | 30 | private Project project; |
38 | 31 | private ProjectSettings settings; |
39 | 32 |
|
40 | | - private List<Operation> operationList; |
41 | | - private Optional<Throwable> throwableOptional; |
42 | 33 | private EventBus eventBus; |
43 | 34 |
|
44 | 35 | @Before |
45 | 36 | public void setUp() throws Exception { |
46 | 37 |
|
47 | 38 | //Set up the stuff we need for the core functionality for GRIP |
48 | 39 | final Injector injector = Guice.createInjector(new GRIPCoreModule()); |
49 | | - connectionFactory = injector |
50 | | - .getInstance(Key.get(new TypeLiteral<Connection.Factory<Object>>() { |
51 | | - })); |
52 | | - imageSourceFactory = injector |
53 | | - .getInstance(ImageFileSource.Factory.class); |
| 40 | + |
54 | 41 | eventBus = injector.getInstance(EventBus.class); |
55 | 42 | pipeline = injector.getInstance(Pipeline.class); |
56 | 43 | project = injector.getInstance(Project.class); |
57 | 44 | settings = injector.getInstance(ProjectSettings.class); |
58 | | - stepFactory = injector.getInstance(Step.Factory.class); |
59 | 45 |
|
60 | 46 | //Add the operations so that GRIP will recognize them |
61 | 47 | Operations.addOperations(eventBus); |
|
0 commit comments