Measurements of dielectric constants and surface resistance for millimeter and submillimeter wavelength region using Josephson effect