NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Difficulties understanding Teststand - JAVA Adapter.

First of all, I want to introduce myself, as I am new to this forum and to NI Teststand.
 
As I Am also a rookie to the field of SW testing, my first task with my new employer is to analyse the Java Adapter of Teststand 4.0.1.
 
Now , I have some questions concerning the adapter.
 
- Is there a way, maybe a workaround, to securly close the jvm?
  It is quite annyoing to closee Terststand for every minor change in the JAVA-class.
- I encountered difficulties in instantiating a JAVA Object and accessing its member attributes via getter methods.
  Are the object persistent between my init call with the suggested start method and the following getName() meth for  example
thx
Marcos V. Bischoff
0 Kudos
Message 1 of 2
(3,851 Views)

Somehow the message got posted while writing it and the edit option quited while editing. So here the complete question.

First of all, I want to introduce myself, as I am new to this forum and to NI Teststand.
 
As I Am also a rookie to the field of SW testing, my first task with my new employer is to analyse the Java Adapter of Teststand 4.0.1.
 
Now , I have some questions concerning the adapter.
 
  • - Is there a way, maybe a workaround, to securly close the jvm? It is quite annyoing to closee Teststand for every minor change in the JAVA-class.
  • - I encountered difficulties in instantiating a JAVA Object and accessing its member attributes via getter methods.   Are the object persistent between my init call with the suggested start() method and the following getName() meth for example. Because i cannot access the value of getName()? see example
public class JTest {

    public static String staticString = "Maxi Musterfrau";
    public static int staticID = 9000001;
    /**
     * @param args the command line arguments
     */
    public String name = "";
    public int id = 0;
   
    public JTest(){

        name = "Max Mustermann";
        id = 9000002;
    }    
    public String getName(){
        return this.name;
    }    
    public int getID(){
        return id;
    }   
    public void setName(String _name){
        name = _name;
    }    
    public void setID(int _id){
        id = _id;
    }       
    
public static void start() {
        new JTest();
    }
}

          If I give the two attributes the modifier "static" ther naturrally accessable again, but it seems rather incorrect.

  • -  Also I've noticed that it is "easier" for the adpater to access methods that have parameters, even if there dummies. It is rather unexplainable to me but I got NULL pointer refencations in the JavaCall.dll, using parameterless methods.
  • -  My last question is a bit of a hard one. The called JAVA object should instantiate a listener object on which the response for a given request is expected. Is there a way to implement that with the given teststand - Java adapter implementation?

So I hope i wrote this understandable, for I am completly out of practice with my english. Of course I will explain my questions more detailed on request.

greets

marcos

thx
Marcos V. Bischoff
0 Kudos
Message 2 of 2
(3,841 Views)