Codepro Analytix - JUnit - ClassNotFoundException - PullRequest
1 голос
/ 08 марта 2012

Я пытаюсь сгенерировать тестовые случаи JUnit с Codepro Analytix v7.1 в RAD 7.5.
Я получаю ClassNotFoundException даже за простой исходный код.

Исходный код:

package com.tmp;

public class General {  
  public  int getPriceRate(){

     Calculation calc = new CalculationImpl();
     return calc.getPrice(20);
    }
}

Сгенерированный тестовый код:

package com.tmp;

import org.junit.*;
import static org.junit.Assert.*;

/**
 * The class <code>GeneralTest</code> contains tests for the class <code>{@link   General}</code>.
 *
 * @generatedBy CodePro at 3/8/12 5:10 AM
 */
public class GeneralTest {
/**
 * Run the int getPriceRate() method test.
 *
 * @throws Exception
 *
 * @generatedBy CodePro at 3/8/12 5:10 AM
 */
@Test
public void testGetPriceRate_1()
    throws Exception {
    General fixture = new General();

    int result = fixture.getPriceRate();

    // add additional test code here
    // An unexpected exception was thrown in user code while executing this test:
    //    java.lang.ClassNotFoundException: com.tmp.General
    //       at java.net.URLClassLoader.findClass(Unknown Source)
    //       at java.lang.ClassLoader.loadClass(Unknown Source)
    //       at com.instantiations.assist.eclipse.junit.execution.core.UserDefinedClassLoader.loadClass(Unknown Source)
    //       at java.lang.ClassLoader.loadClass(Unknown Source)
    //       at com.instantiations.assist.eclipse.junit.execution.core.ExecutionContextImpl.getClass(Unknown Source)
    //       at com.instantiations.eclipse.analysis.expression.model.SimpleTypeExpression.execute(Unknown Source)
    //       at com.instantiations.eclipse.analysis.expression.model.MethodInvocationExpression.execute(Unknown Source)
    //       at com.instantiations.assist.eclipse.junit.execution.core.ExecutionRequest.execute(Unknown Source)
    //       at com.instantiations.assist.eclipse.junit.execution.communication.LocalExecutionClient$1.run(Unknown Source)
    //       at java.lang.Thread.run(Unknown Source)
    assertEquals(0, result);
}
}

Можете ли вы помочь мне решить эту ошибку?

...