This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSS in junit test failure

Other Parts Discussed in Thread: CCSTUDIO

Hi,

           I am running a junit test in CCSv4 as the following:

package example.test.subpackage;

import org.junit.*;

import com.ti.ccstudio.scripting.IScriptSession;
import com.ti.ccstudio.scripting.environment.*;
import com.ti.debug.engine.scripting.*;
import com.ti.dvt.engine.scripting.*;


/**
 * Tests for ExampleClass.
 * @author testauthor
 * @version $Revision 1.10 11 Nov, 2008 First draft <br>
 */
public class ExampleClassTest{

    /**
     * Test for example method.
     * @throws ScriptingException
     */
    @Test
    public void testExampleMethod() throws ScriptingException {
        // Actual test definition

     
     // Create our scripting environment object - which is the main entry point into any script and
        // the factory for creating other Scriptable ervers and Sessions
        ScriptingEnvironment env = ScriptingEnvironment.instance();
       
        DebugServer debugServer = null;
     DebugSession debugSession = null;
    
    try     
    {
//         // Get the Debug Server and start a Debug Session
         debugServer = (DebugServer) env.getServer("DebugServer.1");
      //debugServer = (DebugServer) env.getServer("CCSServer.1");
         //debugServer.setConfig("C:/Program Files/Texas Instruments/ccsv4/scripting/examples/C64/tisim_c64xple.ccxml");
         debugServer.setConfig("../scripting/examples/C64/tisim_c64xple.ccxml");
         debugSession = debugServer.openSession(".*");
    
                // Load a program
       debugSession.memory.loadProgram("C:/Program Files/Texas Instruments/ccsv4/scripting/examples/C64/modem/Debug/modem.out");
    }
         catch (Exception e)
    {
         System.out.print(""+e+" Exception catched!!");
    }
        
    }

}
 

 

The failure trace tells that:

java.lang.ExceptionInInitializerError
 at com.ti.debug.engine.cce.CCEDebugEngine$Factory.createInstance(CCEDebugEngine.java:48)
 at com.ti.debug.engine.scripting.DebugServer.start(DebugServer.java:612)
 at com.ti.debug.engine.scripting.DebugServer$SessionFactory.<init>(DebugServer.java:141)
 at com.ti.debug.engine.scripting.DebugServer.openSession(DebugServer.java:1112)
 at example.test.subpackage.ExampleClassTest.testExampleMethod(ExampleClassTest.java:46)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
 at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
 at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
 at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
 at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
 at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
 at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
 at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
 at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
 at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.NullPointerException
 at java.io.File.<init>(Unknown Source)
 at com.ti.debug.engine.cce.DLLPreLoader.<init>(DLLPreLoader.java:20)
 at com.ti.debug.engine.cce.ADebugEngine.<clinit>(ADebugEngine.java:45)
 ... 25 more

 

What is wrong? The source codes are copied from the http://tiexpressdsp.com/index.php/DSS_from_Java. This prolem is frustrating me a lot.

 

Br,

AppleCat