<commit_before>/*
Copyright 2008-2011 Opera Software ASA

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.opera.core.systems;

import com.google.common.io.Files;

import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.io.TemporaryFilesystem;

import java.io.File;
import java.io.IOException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.fail;

public class OperaPreferencesTest extends OperaDriverTestCase {

  public OperaPreferences preferences;
  public File temporaryProfile;
  public File iniFile;

  // Replace OperaDriverTestCase setup and teardown so that we don't launch Opera
  @BeforeClass
  public static void setUpBeforeClass() {
    initFixtures();
  }

  @AfterClass
  public static void tearDownAfterClass() {
  }

  @Before
  public void setUp() {
    temporaryProfile =
        TemporaryFilesystem.getDefaultTmpFS().createTempDir("operadriver", "profile");
    iniFile = new File(temporaryProfile + File.separator + "opera.ini");

    try {
      Files.copy(fixtureFile("opera.ini"), iniFile);<commit_msg>Look for opera.ini in test/fixtures/profile<commit_after>/*
Copyright 2008-2011 Opera Software ASA

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.opera.core.systems;

import com.google.common.io.Files;

import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.io.TemporaryFilesystem;

import java.io.File;
import java.io.IOException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.fail;

public class OperaPreferencesTest extends OperaDriverTestCase {

  public OperaPreferences preferences;
  public File temporaryProfile;
  public File iniFile;

  // Replace OperaDriverTestCase setup and teardown so that we don't launch Opera
  @BeforeClass
  public static void setUpBeforeClass() {
    initFixtures();
  }

  @AfterClass
  public static void tearDownAfterClass() {
  }

  @Before
  public void setUp() {
    temporaryProfile =
        TemporaryFilesystem.getDefaultTmpFS().createTempDir("operadriver", "profile");
    iniFile = new File(temporaryProfile + File.separator + "opera.ini");

    try {
      Files.copy(fixtureFile("profile" + File.separator + "opera.ini"), iniFile);
{'fraction_non_alphanumeric': 0.0812124678295682, 'fraction_numerical': 0.006863025450386045, 'mean_word_length': 4.56120826709062, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5212818', 'n_tokens_mistral': 999, 'n_tokens_neox': 949, 'n_words': 335}