<commit_before>package au.com.southsky.jfreesane;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.util.List;
import java.util.logging.Logger;

import javax.imageio.ImageIO;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.io.Closeables;

/**
 * Tests JFreeSane's interactions with the backend.
 *
 * <p>
 * This test is ignored right now because it requires a real SANE backend to talk to. If you remove
 * the {@code "@Ignore"} annotation and point this test at a real SANE backend, it should pass.
 *
 * @author <NAME> (<EMAIL>)
 */
public class SaneSessionTest {

  private static final Logger log = Logger.getLogger(SaneSessionTest.class.getName());
  private SaneSession session;

  @Before
  public void initSession() throws Exception {
    this.session = SaneSession.withRemoteSane(InetAddress.getByName("sirius"));
  }

  @After
  public void closeSession() throws Exception {
    Closeables.close(session, false);
  }

  @Test
  public void listDevicesSucceeds() throws Exception {
    List<SaneDevice> devices = session.listDevices();
    log.info("Got " + devices.size() + " device(s): " + devices);
    Assert.assertTrue(devices.size() > 0);
  }

  @Test
  public void openDeviceSucceeds() throws Exception {
    SaneDevice device = session.getDevice("test");<commit_msg>Add ignore back to test<commit_after>package au.com.southsky.jfreesane;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.awt.image.Raster;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.util.List;
import java.util.logging.Logger;

import javax.imageio.ImageIO;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import com.google.common.base.Charsets;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.io.Closeables;

/**
 * Tests JFreeSane's interactions with the backend.
 *
 * <p>
 * This test is ignored right now because it requires a real SANE backend to talk to. If you remove
 * the {@code "@Ignore"} annotation and point this test at a real SANE backend, it should pass.
 *
 * @author <NAME> (<EMAIL>)
 */
@Ignore
public class SaneSessionTest {

  private static final Logger log = Logger.getLogger(SaneSessionTest.class.getName());
  private SaneSession session;

  @Before
  public void initSession() throws Exception {
    this.session = SaneSession.withRemoteSane(InetAddress.getByName("sirius"));
  }

  @After
  public void closeSession() throws Exception {
    Closeables.close(session, false);
  }

  @Test
  public void listDevicesSucceeds() throws Exception {
    List<SaneDevice> devices = session.listDevices();
    log.info("Got " + devices.size() + " device(s): " + devices);
    Assert.assertTrue(devices.size() > 0);
  }

  @Test
  public void openDeviceSucceeds() throws Exception {
    SaneDevice device = session.getDevice("test");
{'fraction_non_alphanumeric': 0.11160831797841538, 'fraction_numerical': 0.0005264543300868649, 'mean_word_length': 4.688622754491018, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '136236', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1149, 'n_words': 304}