When Jonathan Rivera testified in his own defense in his murder trial Thursday, he was a soft-spoken former honor student who had found himself, through no fault of his own, living in a tough Salem neighborhood. Rivera, 23, addressed the prosecutor as "ma'am" and even told jurors his first thought after stabbing Shaundell Turner, 30, outside a Salem park nearly two years ago was "Oh, my goodness" as the reputed gang member with the street name "Tyson" kept coming at him on April 7, 2010. Yesterday, jurors got to learn about another side of Rivera, after he was confronted with evidence that he too was a member of a violent street gang — that he even volunteered to be "jumped in," or beaten, by other gang members as an initiation into the Deuce Boyz/Soldiers — and that he also sold drugs. Prosecutor Kristen Buxton was hoping to undercut Rivera's claims that he acted solely in self-defense and that he was simply a frightened young man struggling to survive in The Point neighborhood. The information about Rivera's ties to the Deuce Boyz, a gang affiliated with the nationwide Bloods street gang, and rivals to Turner's Gangster Disciples, emerged only as the trial got under way this week. But the questioning of Rivera about gang activities was limited, after a strategic decision by the defense, during a hearing that was done outside of the jury's presence. Rivera's lawyer, Ed Hayden, sought to introduce evidence about Turner's involvement in a meeting of the Gangster Disciples in which the members discussed killing an informant in an unrelated case. Buxton, the prosecutor, opposed the introduction of that evidence, saying that it did not show how, exactly, Turner was involved in the decision or whether he played any role in carrying out the retaliation. Judge David Lowy decided that Hayden could introduce the evidence — but only if Buxton were then also allowed to introduce evidence of Rivera's gang activities, including punching a cooperating witness who was also in custody at the Middleton Jail while Rivera was awaiting trial, a phone call in which he laughed about stabbing someone else months before Turner's stabbing, and a "mission" he had been asked to do by a more senior "Deuce Boy" named "Mundy" the night before Turner's stabbing. And while Hayden told the judge he was willing to "roll the dice," Rivera was not, and most of the gang information never made it to jurors. The jury did hear Rivera being forced to acknowledge that despite his claims that he always carried his knife, out of fear, he left it back at his girlfriend's apartment before fleeing to Quincy after the stabbing. "After the stabbing, you're in fear of retaliation," Buxton suggested, "and you have said you never go out without your knife." Yet this time, he did. "Because you knew it was the murder weapon," Buxton suggested. "That's not true," Rivera answered. Buxton suggested that Rivera deliberately took steps to conceal his involvement, including leaving a key to his girlfriend Valerie Moraitis' apartment, then leaving his clothing and the knife there before getting a ride to the Wonderland MBTA station. Rivera continued to insist that he changed his clothing only to avoid detection by the Gangster Disciples. And when he got to the hotel, Rivera initially claimed, he had a few hundred dollars that his parents had given him. Buxton pointed out that when he was arrested, police found him with thousands of dollars, something that might enable him to easily leave the state. Rivera told jurors, "The truth is, I've sold drugs." Closing arguments in the case are scheduled for Thursday.