MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_extract_abstract_class

Function test_extract_abstract_class

atomic-semantic/src/parsers/java.rs:929–960  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

927
928 #[test]
929 fn test_extract_abstract_class() {
930 let mut parser = JavaParser::new();
931 let source = r#"
932public abstract class AbstractService {
933 public abstract void process();
934 public void log(String msg) {}
935}
936"#;
937 let entities = parser.extract(source, "AbstractService.java");
938
939 let service = entities.iter().find(|e| e.name == "AbstractService");
940 assert!(service.is_some(), "Should find AbstractService");
941 assert!(
942 service
943 .unwrap()
944 .signature
945 .as_ref()
946 .unwrap()
947 .contains("abstract"),
948 "Should contain abstract in signature: {:?}",
949 service.unwrap().signature
950 );
951
952 assert!(
953 entities.iter().any(|e| e.name == "process"),
954 "Should find abstract method process"
955 );
956 assert!(
957 entities.iter().any(|e| e.name == "log"),
958 "Should find concrete method log"
959 );
960 }
961
962 #[test]
963 fn test_extract_class_with_extends() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected