Package com.google.test.metric.asm

Source Code of com.google.test.metric.asm.ClassInfoBuilderVisitorTest

// Copyright 2009 Google Inc. All Rights Reserved.

package com.google.test.metric.asm;

import junit.framework.TestCase;

import com.google.test.metric.ClassInfo;
import com.google.test.metric.JavaClassRepository;

/**
* @author alexeagle@google.com (Alex Eagle)
*/
public class ClassInfoBuilderVisitorTest extends TestCase {
  ClassInfoBuilderVisitor visitor = new ClassInfoBuilderVisitor(null);

  public void testGetOriginalFilePath() {
    assertEquals("java/lang/String.java", visitor.guessSourceFileName("java.lang.String"));
  }

  public void testPathInnerClassIsStripped() throws Exception {
    assertEquals("com/google/Foo.java", visitor.guessSourceFileName("com.google.Foo$1"));
  }

  public void testLoadingThisClassGivesRightFilename() throws Exception {
    ClassInfo aClass = new JavaClassRepository().getClass(this.getClass().getName());
    assertEquals("com/google/test/metric/asm/ClassInfoBuilderVisitorTest.java", aClass.getFileName());
  }
}
TOP

Related Classes of com.google.test.metric.asm.ClassInfoBuilderVisitorTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.