Sha256: 47530c881a513168d0ef91feef24d5454674a377e4ea359becd5490941642a86

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require 'test_helper'
require 'codemodels'
require 'codemodels/xml'
require 'codemodels/properties'
require 'codemodels/html'
require 'codemodels/js'

class TestSpotter < Test::Unit::TestCase

def setup
end

def test_models_loading
	models = CrossLanguageSpotter._load_models('./test/data/angular_puzzle')
    assert_equal 4,models.count
    assert models.has_key?('/app.js')
    assert models.has_key?('/index.html')
    assert models.has_key?('/slidingPuzzle.js')
    assert models.has_key?('/wordSearchPuzzle.js')
end

def test_features_calc
    dir = './test/data/angular_puzzle'
    spotter = CrossLanguageSpotter::Spotter.new()
    spotter.features_for_dir(dir)
end

def test_oracle
    dir = './test/data/angular_puzzle'
    oracle_loader = OracleLoader.new
    oracle_loader.to_train_data(dir,'./test/data/angular-puzzle.GS')
end

def test_full_behavior
    oracle_loader = OracleLoader.new
    classifier = oracle_loader.build_weka_classifier('./test/data/angular_puzzle','./test/data/angular-puzzle.GS')
    spotter = CrossLanguageSpotter::Spotter.new()
    project = Project.new('./test/data/services')
    results = spotter.classify_relations(project,classifier)
end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
crosslanguagespotter-0.0.3-java test/test_spotter.rb
crosslanguagespotter-0.0.2-java test/test_spotter.rb