SessionState { public void setCommandText(String commandText) { this.commandText = stripNonValidXMLCharacters(commandText); } private  SessionState();  SessionState(SessionState ss); static SessionState get(); Odps getOdps(); void setOdps(Odps odps); JobConf getDefaultJob(); boolean isLocalRun(); void setLocalRun(boolean b); void setCostMode(boolean b); boolean isCostMode(); void setDefaultJob(JobConf defaultJob); void setAliases(Map<String, String> aliases); Map<String, String> getAliases(); String getTunnelEndpoint(); void setTunnelEndpoint(String tunnelEndpoint); String getCommandText(); void setCommandText(String commandText); boolean isSqlMode(); static final String LOCAL_DOWNLOAD_MODE; static final String LOCAL_SECURITY_ENABLE; static final String LOCAL_SECURITY_JNI_ENABLE; static final String LOCAL_USER_DEFINE_POLICY; static final String COST; static final String ODPS_JOB_COST_ESTIMATE; static final String MR_EXECUTION_MODE; static final String MR_EXECUTION_SQL_QUERY; static final String MR_EXECUTION_SQL_ERROR; static final String MR_EXECUTION_SESSION_RESOURCES; }
@Test public void testSetCommandText() throws InterruptedException { SessionState ss = SessionState.get(); ss.setCommandText("jar -resources oyz_test.jar -Dds=\005 -classpath oyz_test.jar wc.WordCount wc_in wc_out;"); assertEquals("jar -resources oyz_test.jar -Dds= -classpath oyz_test.jar wc.WordCount wc_in wc_out;", ss.getCommandText()); ss.setCommandText("jar -resources oyz_test.jar -Dds=$ -classpath oyz_test.jar wc.WordCount wc_in wc_out;"); assertEquals("jar -resources oyz_test.jar -Dds=$ -classpath oyz_test.jar wc.WordCount wc_in wc_out;", ss.getCommandText()); ss.setCommandText("jar -resources oyz_test.jar -classpath oyz_test.jar wc.WordCount wc_in wc_out;"); assertEquals("jar -resources oyz_test.jar -classpath oyz_test.jar wc.WordCount wc_in wc_out;", ss.getCommandText()); }