Experiments like the one above around 1845 helped to establish the 1st law beyond reasonable doubt. The temperature of the system can be raised either by doing of mechanical work on it or by adding of heat (where is the distance through which the weight falls and is the heat capacity of the fluid). Afterwards there is no way of deducing which method was used to increase the internal energy.
A photo of actual apparatus used by Joule can be found here, courtesy of the Science Museum in London. The text of one of his papers is here. In it he speculates about the temperature increase of water in a waterfall. During his honeymoon in the Alps in 1849 he attempted to verify his speculations, but inconclusively. Mrs Joule's reactions are not recorded. More about Joule here ©"Zephyrus".