|
6 | 6 | * %% |
7 | 7 | * Redistribution and use in source and binary forms, with or without |
8 | 8 | * modification, are permitted provided that the following conditions are met: |
9 | | - * |
| 9 | + * |
10 | 10 | * 1. Redistributions of source code must retain the above copyright notice, |
11 | 11 | * this list of conditions and the following disclaimer. |
12 | 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
13 | 13 | * this list of conditions and the following disclaimer in the documentation |
14 | 14 | * and/or other materials provided with the distribution. |
15 | | - * |
| 15 | + * |
16 | 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
17 | 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
18 | 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
27 | 27 | * #L% |
28 | 28 | */ |
29 | 29 |
|
30 | | -package net.imagej2.legacy.types; |
| 30 | +package org.scijava.imagej.types; |
31 | 31 |
|
32 | 32 | import java.lang.reflect.Type; |
33 | 33 | import java.util.ServiceLoader; |
34 | 34 |
|
| 35 | +import net.imagej.DefaultDataset; |
| 36 | +import net.imagej.ImgPlus; |
| 37 | +import net.imglib2.img.array.ArrayImgs; |
35 | 38 | import org.junit.jupiter.api.Assertions; |
36 | 39 | import org.junit.jupiter.api.Test; |
37 | | -import org.scijava.Context; |
38 | 40 | import org.scijava.discovery.Discoverer; |
39 | 41 | import org.scijava.types.Any; |
40 | 42 | import org.scijava.types.DefaultTypeReifier; |
41 | 43 | import org.scijava.types.Types; |
42 | 44 |
|
43 | | -import net.imagej.DefaultDataset; |
44 | | -import net.imagej.ImgPlus; |
45 | | -import net.imglib2.img.array.ArrayImgs; |
46 | | - |
47 | 45 | /** |
48 | 46 | * Tests {@link DatasetTypeExtractor} |
49 | | - * |
| 47 | + * |
50 | 48 | * @author Gabriel Selzer |
51 | 49 | */ |
52 | 50 | public class DatasetTypeExtractorTest { |
53 | 51 |
|
54 | | - @Test |
55 | | - public void testDatasetTypeExtractor() { |
| 52 | + @Test public void testDatasetTypeExtractor() { |
56 | 53 | // Create a TypeReifier |
57 | | - var reifier = new DefaultTypeReifier(Discoverer.all( |
58 | | - ServiceLoader::load)); |
| 54 | + var reifier = new DefaultTypeReifier(Discoverer.all(ServiceLoader::load)); |
59 | 55 | // Create a Dataset |
60 | | - var ctx = new Context(); |
61 | 56 | var img = ArrayImgs.unsignedBytes(10, 10); |
62 | 57 | var imgPlus = new ImgPlus<>(img); |
63 | | - var ds = new DefaultDataset(ctx, imgPlus); |
| 58 | + // NB we pass a null context to avoid a SciJava Common dependency |
| 59 | + var ds = new DefaultDataset(null, imgPlus); |
64 | 60 | // Assert correct reification |
65 | 61 | // NB without a dependency on imagej-ops2 we cannot reify |
66 | 62 | // the ImgPlus, but asserting an ImgPlus is the reified type |
|
0 commit comments