153 }
154 else {
155 try {
156 if (currDesc == null)
157 currDesc = currTest.getDescription();
158 }
159 catch (TestResult.Fault e) {
160 JavaTestError.unexpectedException(e);
161 // ignore exception if can't find description ??
162 }
163
164 // always got a test description
165 tabs.setEnabledAt(tabs.indexOfComponent(descPanel), true);
166
167 // always got source files
168 tabs.setEnabledAt(tabs.indexOfComponent(filesPanel), true);
169
170 // check if there are any environment entries recorded
171 boolean hasEnv;
172 try {
173 Map map = currTest.getEnvironment();
174 hasEnv = (map != null && map.size() > 0);
175 }
176 catch (TestResult.Fault f) {
177 hasEnv = false;
178 }
179 tabs.setEnabledAt(tabs.indexOfComponent(envPanel), hasEnv);
180
181 // check if there are any result properties recorded
182 boolean hasResults = currTest.getPropertyNames().hasMoreElements();
183 tabs.setEnabledAt(tabs.indexOfComponent(resultPanel), hasResults);
184
185 // check if there is any output recorded
186 boolean hasOutput = (currTest.getSectionCount() > 0);
187 tabs.setEnabledAt(tabs.indexOfComponent(outputPanel), hasOutput);
188
189 for (int i = stdPanels.length; i < tabs.getTabCount(); i++) {
190 tabs.setEnabledAt(i, true);
191 }
192
193 updateStatus();
|
153 }
154 else {
155 try {
156 if (currDesc == null)
157 currDesc = currTest.getDescription();
158 }
159 catch (TestResult.Fault e) {
160 JavaTestError.unexpectedException(e);
161 // ignore exception if can't find description ??
162 }
163
164 // always got a test description
165 tabs.setEnabledAt(tabs.indexOfComponent(descPanel), true);
166
167 // always got source files
168 tabs.setEnabledAt(tabs.indexOfComponent(filesPanel), true);
169
170 // check if there are any environment entries recorded
171 boolean hasEnv;
172 try {
173 Map<String, String> map = currTest.getEnvironment();
174 hasEnv = (map != null && map.size() > 0);
175 }
176 catch (TestResult.Fault f) {
177 hasEnv = false;
178 }
179 tabs.setEnabledAt(tabs.indexOfComponent(envPanel), hasEnv);
180
181 // check if there are any result properties recorded
182 boolean hasResults = currTest.getPropertyNames().hasMoreElements();
183 tabs.setEnabledAt(tabs.indexOfComponent(resultPanel), hasResults);
184
185 // check if there is any output recorded
186 boolean hasOutput = (currTest.getSectionCount() > 0);
187 tabs.setEnabledAt(tabs.indexOfComponent(outputPanel), hasOutput);
188
189 for (int i = stdPanels.length; i < tabs.getTabCount(); i++) {
190 tabs.setEnabledAt(i, true);
191 }
192
193 updateStatus();
|