D.C. Mayor Barry testified under subpoena in Superior Court yesterday in the case of a former contender for Barry's post who is charged with simple assault on a Barry campaign worker.

In his appearance, Barry denied that he had instructed his campaign workers to challenge the qualifying petitions of James Clark in an effort to have Clark's name removed from the first line on the primary election ballot last year.

Clark is accused of striking campaign worker Philip Oglesby on the head with a metal chair during a meeting on Aug. 9, 1978 at which Clark's petitions were being challenged.

Clark testified yesterday that he approached Barry in July 1978 following a forum at Dupont Circle and threatened to expose Barry to the voters "as an Uncle Tom." Clark testified that he also told Barry he would raise the issue of wrongdoing at Youth Pride Inc., a black self-help organization once run by Barry, during the campaign.

"Barry told me that he would make arrangements to have me taken off the ballot completely and that I wouldn't be around to make anything a political issue," Clark told the court.

Clark said he had won first position on the primary ballot by drawing lots with seven other mayoral candidates. Barry wanted to be first on the ballot, Clark told the jury, because of the obvious advantage of that position to a candidate. At the time of the drawing, Clark testified, Barry won the second spot.

During his testimony Barry asserted that name positions had no relevance during the mayoral campaign.

At a meeting of the D.C. Board of Elections and Ethics, Oglesby and other Barry workers argued that Clark was more than 600 signatures short of qualifying as a candidte for mayor. Their challenge of Clark's petitions was upheld by the board and later by the D.C. Court of Appeals.

Clark, who testified he was seated across the table from Oglesby at that meeting, said that Oglesby kicked him twice under the table. Clark said that when he asked for an apology Oglesby struck out at him. In an attempt to deflect Oglesby's blow, Clark testified that he accidentally struck Oglesby in the jaw.

David J. Gaines, an official reporter for the meeting who said he witnessed the incident, testified that Clark "all of a sudden and without warning" picked up a metal chair with both hands and "lowered it over Oglesby's head," causing extensive bleeding.