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

Function test_extract_abstract_class

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

Source from the content-addressed store, hash-verified

904
905 #[test]
906 fn test_extract_abstract_class() {
907 let mut parser = JavaParser::new();
908 let source = r#"
909public abstract class AbstractService {
910 public abstract void process();
911 public void log(String msg) {}
912}
913"#;
914 let entities = parser.extract(source, "AbstractService.java");
915
916 let service = entities.iter().find(|e| e.name == "AbstractService");
917 assert!(service.is_some(), "Should find AbstractService");
918 assert!(
919 service
920 .unwrap()
921 .signature
922 .as_ref()
923 .unwrap()
924 .contains("abstract"),
925 "Should contain abstract in signature: {:?}",
926 service.unwrap().signature
927 );
928
929 assert!(
930 entities.iter().any(|e| e.name == "process"),
931 "Should find abstract method process"
932 );
933 assert!(
934 entities.iter().any(|e| e.name == "log"),
935 "Should find concrete method log"
936 );
937 }
938
939 #[test]
940 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