<commit_before>package core

import org.scalatest.junit.AssertionsForJUnit
import org.junit.Assert._
import org.junit.Test
import org.junit.Before
import org.junit.After

import java.io.File
import org.apache.commons.io.FileUtils

class SDKTest extends AssertionsForJUnit {
  import core.sdktools.sdk._
  
  @Before def initialize {
    start_adb
  }
  
  @After def tearDown {
    kill_adb
  }
  
  @Test def testAndroidAVDCreation { 
    assert(get_targets contains "android-17")
    assert(get_sdk contains
      "Intel x86 Atom System Image, Android API 17, revision 1")

    // Assume every target will have `armeabi-v7a`.
    val allTargetABIs = get_target_ABIs
    // println(allTargetABIs mkString " | ")
    for (targetABIs <- allTargetABIs) {
      assert(targetABIs contains "armeabi-v7a")
    }
    
    val avdName = "clasp-test"
    val avdNewName = avdName + "-new-name"
    assert(create_avd(avdName, "android-17", "armeabi-v7a", true))
    assert(!create_avd(avdName, "android-17", "armeabi-v7a"))
    val avds = get_avd_names
    assert(avds contains avdName)
    assertFalse(avds contains "not-clasp-test")
    
    val home = sys.env("HOME")
    assert(move_avd(avdName, home + "/" + avdName, avdNewName))
    
    assert(delete_avd(avdNewName))
    assert(!delete_avd(avdNewName))
  }
  
  @Test def testAndroidProjectCreation {
    assert(get_targets contains "android-17")
    
    val projDirStr = sys.env("HOME") + "/clasp-temp"
    val testProjDirStr = sys.env("HOME") + "/clasp-temp-test"
    val libProjDirStr = sys.env("HOME") + "/clasp-lib-test"
    val uiTestStr = sys.env("HOME") + "/clasp-uitest"
    val dirList = List(projDirStr, testProjDirStr, libProjDirStr, uiTestStr)
    <commit_msg>Clasp: Add extra check to test.<commit_after>package core

import org.scalatest.junit.AssertionsForJUnit
import org.junit.Assert._
import org.junit.Test
import org.junit.Before
import org.junit.After

import java.io.File
import org.apache.commons.io.FileUtils

class SDKTest extends AssertionsForJUnit {
  import core.sdktools.sdk._
  
  @Before def initialize {
    start_adb
  }
  
  @After def tearDown {
    kill_adb
  }
  
  @Test def testAndroidAVDCreation { 
    assert(get_targets contains "android-17")
    assert(get_sdk contains
      "Intel x86 Atom System Image, Android API 17, revision 1")

    // Assume every target will have `armeabi-v7a`.
    val allTargetABIs = get_target_ABIs
    // println(allTargetABIs mkString " | ")
    for (targetABIs <- allTargetABIs) {
      assert(targetABIs contains "armeabi-v7a"
        || targetABIs contains "armeabi")
    }
    
    val avdName = "clasp-test"
    val avdNewName = avdName + "-new-name"
    assert(create_avd(avdName, "android-17", "armeabi-v7a", true))
    assert(!create_avd(avdName, "android-17", "armeabi-v7a"))
    val avds = get_avd_names
    assert(avds contains avdName)
    assertFalse(avds contains "not-clasp-test")
    
    val home = sys.env("HOME")
    assert(move_avd(avdName, home + "/" + avdName, avdNewName))
    
    assert(delete_avd(avdNewName))
    assert(!delete_avd(avdNewName))
  }
  
  @Test def testAndroidProjectCreation {
    assert(get_targets contains "android-17")
    
    val projDirStr = sys.env("HOME") + "/clasp-temp"
    val testProjDirStr = sys.env("HOME") + "/clasp-temp-test"
    val libProjDirStr = sys.env("HOME") + "/clasp-lib-test"
    val uiTestStr = sys.env("HOME") + "/clasp-uitest"
    val dirList = List(projDirStr, testProjDirStr, libProjDirStr, uiTestStr)
    
{'fraction_non_alphanumeric': 0.11583452211126961, 'fraction_numerical': 0.009700427960057061, 'mean_word_length': 3.410062893081761, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7522765', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1249, 'n_words': 258}