summaryrefslogtreecommitdiffstats
path: root/bundle-plugin/src/test/scala/com/yahoo/container/plugin/classanalysis/TestUtilities.scala
blob: fbc3554e9e974cee7ad440ace8a4010175222ef6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.plugin.classanalysis

import scala.reflect.ClassTag
import java.io.File

/**
 * @author  tonytv
 */
object TestUtilities {
  def analyzeClass[T](implicit m: ClassTag[T]) =
    Analyze.analyzeClass(classFile(name(m)))

  def classFile(className : String) =
    new File("target/test-classes/" + className.replace('.', '/') + ".class")

  def name[T](implicit m: ClassTag[T]) = m.runtimeClass.getName
}