<commit_before>package org.cytoscape.sbml.internal;

import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

import org.cytoscape.io.CyFileFilter;
import org.cytoscape.io.DataCategory;
import org.cytoscape.io.util.StreamUtil;
import org.junit.Before;
import org.junit.Test;

@SuppressWarnings("nls")
public class SBMLFileFilterTest {
	private CyFileFilter filter;

	@Before
	public void setUp() {
		StreamUtil streamUtil = new StreamUtil() {
			
			@Override
			public URLConnection getURLConnection(URL source) throws IOException {
				return null;
			}
			
			@Override
			public InputStream getInputStream(URL source) throws IOException {
				return source.openStream();
			}
			
			@Override
			public InputStream getBasicInputStream(URL source) throws IOException {
				return null;
			}
		};
		filter = new SBMLFileFilter("SBML", streamUtil);
	}
	
	@Test
	public void testAcceptSBMLLevel2() throws Exception {
		File file = new File("src/test/resources/BIOMD0000000003.xml");
		assertTrue(filter.accepts(new FileInputStream(file), DataCategory.NETWORK));
		assertTrue(filter.accepts(file.toURI(), DataCategory.NETWORK));
	}
}
<commit_msg>Removed unnecessary method in stream util.<commit_after>package org.cytoscape.sbml.internal;

import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

import org.cytoscape.io.CyFileFilter;
import org.cytoscape.io.DataCategory;
import org.cytoscape.io.util.StreamUtil;
import org.junit.Before;
import org.junit.Test;

@SuppressWarnings("nls")
public class SBMLFileFilterTest {
	private CyFileFilter filter;

	@Before
	public void setUp() {
		StreamUtil streamUtil = new StreamUtil() {
			
			@Override
			public URLConnection getURLConnection(URL source) throws IOException {
				return null;
			}
			
			@Override
			public InputStream getInputStream(URL source) throws IOException {
				return source.openStream();
			}
		};
		filter = new SBMLFileFilter("SBML", streamUtil);
	}
	
	@Test
	public void testAcceptSBMLLevel2() throws Exception {
		File file = new File("src/test/resources/BIOMD0000000003.xml");
		assertTrue(filter.accepts(new FileInputStream(file), DataCategory.NETWORK));
		assertTrue(filter.accepts(file.toURI(), DataCategory.NETWORK));
	}
}

{'fraction_non_alphanumeric': 0.10267678785457451, 'fraction_numerical': 0.008789452656811825, 'mean_word_length': 4.864168618266979, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2279175', 'n_tokens_mistral': 857, 'n_tokens_neox': 766, 'n_words': 172}