LAB-29: restore features encoding tests
authorSvetlana.Zemlyanskaya <Svetlana.Zemlyanskaya@jetbrains.com>
Thu, 13 Aug 2020 13:57:17 +0000 (15:57 +0200)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 13 Aug 2020 14:05:25 +0000 (14:05 +0000)
GitOrigin-RevId: 53a2bac76e8617ab25b38d16e05ef2657699a506

plugins/filePrediction/test/com/intellij/filePrediction/predictor/FilePredictionFeatureEncodingTest.kt

index 9592da936241d1f94ceb8809d2509542b526fa3e..7bfd5f579456eb06aef86d667d1fdb3277659993 100644 (file)
@@ -6,6 +6,8 @@ import com.intellij.filePrediction.predictor.FilePredictionFeatureEncoder.encode
 import com.intellij.filePrediction.predictor.FilePredictionFeatureEncoder.encodeCategorical
 import com.intellij.filePrediction.predictor.model.FilePredictionDecisionFunction
 import com.intellij.filePrediction.predictor.model.FilePredictionModelProvider
+import com.intellij.filePrediction.predictor.model.getFilePredictionModel
+import com.intellij.filePrediction.predictor.model.setCustomTestFilePredictionModel
 import com.intellij.internal.ml.DecisionFunction
 import com.intellij.internal.ml.FeaturesInfo
 import com.intellij.internal.ml.ResourcesMetadataReader
@@ -30,9 +32,9 @@ class FilePredictionFeatureEncodingTest : CodeInsightFixtureTestCase<ModuleFixtu
     myFixture.addFileToProject("test.txt", "CURRENT FILE")
 
     val encoder = TestFilePredictionModelProvider(metadataDir)
-    //setCustomTestFilePredictionModel(testRootDisposable, encoder)
+    setCustomTestFilePredictionModel(testRootDisposable, encoder)
 
-    /*val model = getFilePredictionModel()
+    val model = getFilePredictionModel()
     assertNotNull("Cannot find prediction model", model)
 
     model!!.predict(features)
@@ -43,7 +45,7 @@ class FilePredictionFeatureEncodingTest : CodeInsightFixtureTestCase<ModuleFixtu
     assertEquals("Size of encoded features array is different from expected", expected.size, actual!!.size)
     for (i in actual.indices) {
       assertEquals("Encoded feature at position $i is different from expected", expected[i], actual[i])
-    }*/
+    }
   }
 
   fun `test binary features encoding`() {