Both personification and metaphor are used in The Chocolate War by Robert Cormier. Personification and similes are types of metaphor. A metaphor directly compares an object to another object or action. Unlike similes, direct metaphors do not use "like" or "as."
With personification the object is being compared to a human, or the object is being given the traits and qualities of humans.
Below are some examples of metaphor (and simile) specifically from The Chocolate War:
“The coach looked like an old gangster: broken nose, a scar on his cheek like a stitched shoestring” (6). This is a simile that compares the coach’s appearance to that of an old gangster.
“Obie closed the notebook as if he were lowering a coffin lid” (14). In this simile Obie’s notebook is being compared to a coffin lid, because both Obie’s notebook and a coffin lid symbolize things that have been finalized.
“He was aware of the other players around him, helmeted and grotesque, creatures from an unknown world” (14). This example is a metaphor (it does not use "like" or "as") that is comparing the football players to aliens, or some other unknown creatures.
“A waterfall of blond hair splashed on her bare shoulders” (17). This is another example of metaphor (no "like" or "as") that compares the way the girl’s hair falls down her back to a waterfall.
Examples of personification from the story:
“Pain isn’t just one thing—it is cunning and vicious, sharp here and sickening there…” (4). In this example Cormier is stating that pain is vicious and cunning, which shows a comparison between pain and an individual who is vicious and cunning.
“The wind rose, kicking puffs of dust from the football field” (13). The wind is being given human characteristics in that it is being described as kicking the dust. Wind does not have legs; therefore, this is personification that is comparing the wind to a human kicking dust.