Cochran–Armitage test is appropriate for testing of trend in contingency table 2 x k, k>2. E.g. testing that percentage at categories 'low', 'medium', and 'high' of one variables is increasing with female gender.
Jonckheere–Terpstra test is a test for an ordered alternative hypothesis. It is similar to the Kruskal–Wallis test, but the Kruskal–Wallis test has no ordering in alternative hypothesis. Some people are surprised that the Jonckheere–Terpstra test is impletemtned as option of proc FREQ even if it is appropriate also for continuous dependent variable.
Wikipedia: The Cochran–Armitage test for trend named for William Cochran and Peter Armitage, is used in categorical data analysis when the aim is to assess for the presence of an association between a variable with two categories and a variable with k categories.
The Jonkheere-Terpstra Test can be used with two variables each having k categories (not just 2). It is a nonparametric test for trend.
The Cochran–Armitage test is a test of association for one nominal variable and one ordinal variable. The data are arranged as counts in a contingency table. This is similar to a chi-square test of association, except that one variable is ordinal. The original test could have only two levels of the nominal variable, but generalizations of the test exist for greater than two levels.
I am less familiar with the Jonkheere–Terpstra test. It tests for an association between an ordinal variable and a measured interval/ratio variable. This is similar to a Kruskal–Wallis test, except that the grouping variable is an ordered category variable. So, in effect, it is like a test of correlation between an ordinal variable and an interval/ratio variable.
Because the test uses ranks on the interval/ratio variable, it might be okay if the measured variable is ordinal, but I don't know how the test handles ties. To test the association between two ordinal variables, it is probably better to use the linear-by-linear test.