  The next generation of galaxy surveys will allow us to test one of the most
fundamental assumptions of the standard cosmology, i.e., that gravity is
governed by the general theory of relativity (GR). In this paper we investigate
the ability of the Javalambre Physics of the Accelerating Universe
Astrophysical Survey (J-PAS) to constrain GR and its extensions. Based on the
J-PAS information on clustering and gravitational lensing, we perform a Fisher
matrix forecast on the effective Newton constant, $\mu$, and the gravitational
slip parameter, $\eta$, whose deviations from unity would indicate a breakdown
of GR. Similar analysis is also performed for the DESI and Euclid surveys and
compared to J-PAS with two configurations providing different areas, namely an
initial expectation with 4000 $\mathrm{deg}^2$ and the future best case
scenario with 8500 $\mathrm{deg}^2$. We show that J-PAS will be able to measure
the parameters $\mu$ and $\eta$ at a sensitivity of $2\% - 7\%$, and will
provide the best constraints in the interval $z = 0.3 - 0.6$, thanks to the
large number of ELGs detectable in that redshift range. We also discuss the
constraining power of J-PAS for dark energy models with a time-dependent
equation-of-state parameter of the type $w(a)=w_0+w_a(1-a)$, obtaining $\Delta
w_0=0.058$ and $\Delta w_a=0.24$ for the absolute errors of the dark energy
parameters.
