Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
WeatherTest.kt done
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Feb 24, 2020
1 parent b788559 commit 92816da
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/test/java/com/andromeda/araserver/test/WeatherTest.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
package com.andromeda.araserver.test

import com.andromeda.araserver.pages.ApiStart
import com.andromeda.araserver.skills.Weather
import com.andromeda.araserver.util.KeyWord
import opennlp.tools.parser.ParserFactory
import opennlp.tools.parser.ParserModel
import org.junit.Test
import java.net.URL

class WeatherTest {
@Test
fun test(){
val weather = Weather()
val apiStart = ApiStart()
val classloader = javaClass.classLoader
var `is` = classloader.getResourceAsStream("resources/parse.bin")
println("test")
if (`is` == null) {
val url =
URL("https://arafilestore.file.core.windows.net/ara-server-files/parse.bin?sv=2019-02-02&ss=bfqt&srt=sco&sp=rwdlacup&se=2024-04-01T22:11:11Z&st=2019-12-19T15:11:11Z&spr=https&sig=lfjMHSahA6fw8enCbx0hFTE1uAVJWvPmC4m6blVSuuo%3D")
`is` = url.openStream()
}
val model = ParserModel(`is`)
val parser = ParserFactory.create(model)
val keyWord = KeyWord(`is`!!)
weather.mainPart("/weather in portland oregon tomorrow&log=0.0=lat=0.0", keyWord, parser)
}
}

0 comments on commit 92816da

Please sign in to comment.