Evolution of the Coronal Cavity From the Quiescent to Eruptive Phase Associated with Coronal Mass Ejection