I'm trying to develop a Java Class that will be used on a RPG program on iSeries. This Class will manage files with IFSFile. The problem is that I don't know how can I test this (if possible) on my PC.
My code would be something like:
import java.io.BufferedReader;
import java.io.IOException;
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400SecurityException;
import com.ibm.as400.access.IFSFile;
import com.ibm.as400.access.IFSFileReader;
(...)
AS400 system = new AS400("AS400SystemName");
IFSFile file = new IFSFile(system, "/File1");
BufferedReader reader = null;
try {
reader = new BufferedReader(new IFSFileReader(file));
} catch (AS400SecurityException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
// Read one line of the file
String line1 = null;
try {
line1 = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
// Print line
System.out.println(line1);
// Close reader
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}</pre>
I don't know well iSeries and I have some doubts:
If I try to run this code on my PC it asks me to a user/password, when the class will be used on iSeries, it will ask also, or it will take the user that is running the application?
Is there any way in which I can test this part on my PC, in order to know if it will work on production? My idea is first use a mock for Unit testing, but later I would like to have some functional tests that don't use the mock, maybe some kind of emulator or similar...
Thanks in advance.