private void loadValue(IStringVariable var) throws CdtVariableException {
      if (var instanceof IDynamicVariable) {
        IDynamicVariable dynamicVar = (IDynamicVariable) var;
        if (fArgument == null || dynamicVar.supportsArgument()) {
          try {
            fStringValue = dynamicVar.getValue(fArgument);
          } catch (CoreException e) {
            fStringValue = null;
          }
        } else fStringValue = null;

      } else if (var instanceof IValueVariable) {
        if (fArgument == null) fStringValue = ((IValueVariable) var).getValue();
        else fStringValue = null;
      }
    }
  private void assertVariable(String expected, String variableName, String argument)
      throws CoreException {
    IResource findMember = project.findMember(TEST_FILE);

    SWTBotView explorerView = TestUtil.showExplorerView();
    final ISelectionProvider selectionProvider =
        explorerView.getViewReference().getView(true).getSite().getSelectionProvider();
    final StructuredSelection structuredSelection = new StructuredSelection(findMember);
    PlatformUI.getWorkbench()
        .getDisplay()
        .syncExec(
            new Runnable() {

              @Override
              public void run() {
                selectionProvider.setSelection(structuredSelection);
              }
            });

    IDynamicVariable dynamicVariable =
        VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable(variableName);
    String value = dynamicVariable.getValue(argument);
    assertEquals(expected, value);
  }