This works, but probably only if your input is exactly as you described!
Code:
echo "Output from requirement 1"
echo "========================="
grep "<OKAY>.*RESOURCE" infile | sed -e "s/.*RESOURCE:.*\/\(.*\)>.*/\1/" | sort -u
echo
echo "Output from requirement 2"
echo "========================="
awk '
/^!ENTRY.*<INFO>/ { X = 1; sub( /.*RESOURCE: /, "", $0 ); sub( />.*/, "", $0 ); print }
(X == 1) && (/^!SUBENTRY/) { X++ }
(X > 1) && ($1 ~ /^!MESSAGE/) { sub( /!MESSAGE /, "", $0 ); print }
(X > 1) && ($1 ~ /^$/) { print ""; X = 0 }
' infile
Output:
Output from requirement 1
=========================
Test1.jpf
Test.java
Output from requirement 2
=========================
/fullpath/Test2.jpf
The Java 5 annotation Jpf.Controller needs to be added.
More annotation of Jpf.Action needs to be added.
/fullpath/Test3.jpf
The Java 5 annotation Jpf.Controller needs to be added.
Will add import of org.apache.beehive.netui.pageflow.annotations.Jpf for JPF annotation support.
ABC needs to be added.