<commit_before>/*
 * Copyright 2015 <NAME>
 *
 * 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.acornui.test

import com.acornui.core.assets.AssetManager
import com.acornui.core.di.Injector
import com.acornui.core.di.InjectorImpl
import com.acornui.core.di.Owned
import com.acornui.core.di.OwnedImpl
import com.acornui.core.graphics.Camera
import com.acornui.core.graphics.Window
import com.acornui.core.input.InteractivityManager
import com.acornui.core.input.KeyState
import com.acornui.core.input.MouseState
import com.acornui.core.io.JSON_KEY
import com.acornui.core.io.file.Files
import com.acornui.core.time.Date
import com.acornui.core.time.TimeDriver
import com.acornui.core.time.TimeProvider
import com.acornui.core.time.time
import com.acornui.serialization.Serializer
import org.mockito.Mockito

object MockInjector {

	val owner: Owned by lazy { OwnedImpl(create()) }

	@Deprecated("", ReplaceWith("owner"))
	fun createOwner(): Owned {
		return OwnedImpl(create())
	}

	fun create(): Injector {

		@Suppress("UNCHECKED_CAST")
		val json = Mockito.mock(Serializer::class.java) as Serializer<String>

		val injector = InjectorImpl(null, listOf(
				TimeDriver to  Mockito.mock(TimeDriver::class.java),
				Window to  Mockito.mock(Window::class.java),
				MouseState to  Mockito.mock(MouseState::class.java),
				KeyState to  Mockito.mock(KeyState::class.java),
				Files to  Mockito.mock(Files::class.java),
				AssetManager to  Mockito.mock(AssetManager::class.java),
				InteractivityManager to  Mockito.mock(InteractivityManager::class.java),
				Camera to  Mockito.mock(Camera::class.java),
				JSON_KEY to json
		))
		time = MockTimeProvider()

		return injector

	}<commit_msg>FocusManager added to mock injector<commit_after>/*
 * Copyright 2015 <NAME>
 *
 * 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.acornui.test

import com.acornui.core.assets.AssetManager
import com.acornui.core.di.Injector
import com.acornui.core.di.InjectorImpl
import com.acornui.core.di.Owned
import com.acornui.core.di.OwnedImpl
import com.acornui.core.focus.FocusManager
import com.acornui.core.graphics.Camera
import com.acornui.core.graphics.Window
import com.acornui.core.input.InteractivityManager
import com.acornui.core.input.KeyState
import com.acornui.core.input.MouseState
import com.acornui.core.io.JSON_KEY
import com.acornui.core.io.file.Files
import com.acornui.core.time.Date
import com.acornui.core.time.TimeDriver
import com.acornui.core.time.TimeProvider
import com.acornui.core.time.time
import com.acornui.serialization.Serializer
import org.mockito.Mockito

object MockInjector {

	val owner: Owned by lazy { OwnedImpl(create()) }

	@Deprecated("", ReplaceWith("owner"))
	fun createOwner(): Owned {
		return OwnedImpl(create())
	}

	fun create(): Injector {

		@Suppress("UNCHECKED_CAST")
		val json = Mockito.mock(Serializer::class.java) as Serializer<String>

		val injector = InjectorImpl(null, listOf(
				TimeDriver to  Mockito.mock(TimeDriver::class.java),
				Window to  Mockito.mock(Window::class.java),
				MouseState to  Mockito.mock(MouseState::class.java),
				KeyState to  Mockito.mock(KeyState::class.java),
				Files to  Mockito.mock(Files::class.java),
				AssetManager to  Mockito.mock(AssetManager::class.java),
				InteractivityManager to  Mockito.mock(InteractivityManager::class.java),
				Camera to  Mockito.mock(Camera::class.java),
				FocusManager to  Mockito.mock(FocusManager::class.java),
				JSON_KEY to json
		))
		time = MockTimeProvider()

		return injector

	}
{'fraction_non_alphanumeric': 0.10294117647058823, 'fraction_numerical': 0.003511852502194908, 'mean_word_length': 4.564102564102564, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1881435', 'n_tokens_mistral': 1510, 'n_tokens_neox': 1417, 'n_words': 367}