-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
122 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 0 additions & 75 deletions
75
src/main/java/org/mastodon/mamut/tomancak/export/spotcounts/ui/ExportSpotCountsView.java
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
...test/java/org/mastodon/mamut/tomancak/export/ExportSpotCountsPerTimepointCommandTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/*- | ||
* #%L | ||
* mastodon-tomancak | ||
* %% | ||
* Copyright (C) 2018 - 2024 Tobias Pietzsch | ||
* %% | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* #L% | ||
*/ | ||
package org.mastodon.mamut.tomancak.export; | ||
|
||
import org.apache.commons.io.FileUtils; | ||
import org.junit.Test; | ||
import org.mastodon.mamut.feature.branch.exampleGraph.ExampleGraph2; | ||
import org.mastodon.mamut.model.Model; | ||
import org.mastodon.mamut.tomancak.export.ExportSpotCountsPerTimepointCommand; | ||
import org.scijava.Context; | ||
import org.scijava.app.StatusService; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
/** | ||
* Tests {@link ExportSpotCountsPerTimepointCommand} | ||
*/ | ||
public class ExportSpotCountsPerTimepointCommandTest | ||
{ | ||
|
||
@Test | ||
public void testWriteSpotCountsToFile() throws IOException | ||
{ | ||
try (Context context = new Context()) | ||
{ | ||
Model model = new ExampleGraph2().getModel(); | ||
File outputFile = File.createTempFile( "spotcounts", ".csv" ); | ||
outputFile.deleteOnExit(); | ||
StatusService service = context.service( StatusService.class ); | ||
|
||
ExportSpotCountsPerTimepointCommand.writeSpotCountsToFile( model, outputFile, service ); | ||
|
||
String content = FileUtils.readFileToString( outputFile ); | ||
String expected = "\"timepoint\",\"spots\"\n" | ||
+ "0,1\n" | ||
+ "1,1\n" | ||
+ "2,1\n" | ||
+ "3,2\n" | ||
+ "4,1\n" | ||
+ "5,3\n" | ||
+ "6,1\n" | ||
+ "7,2\n"; | ||
assertEquals( expected, content ); | ||
} | ||
} | ||
} |
Oops, something went wrong.