rmannibucau edited a comment on issue #9:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/issues/9#issuecomment-753469631


   The test does not test what i described.
   Issue is that the fields of this class are qname so handled by ee regex so 
at runtile you get a nosuchfielderror (use a classloader to list field in javax 
and jakarta lands).
   Can help if you spend too much time on it - thought it was easy originally 
but can be faster to do a pr ;):
   
   ```
       @Test
       public void testXPathConstants() throws IOException {
           final Migration migration = new Migration();
           migration.setEESpecProfile(EESpecProfile.EE);
           final String name = XPathConstantClient.class.getName().replace('.', 
'/') + ".class";
           final File destination = new File(folder.getRoot(), name);
           migration.setSource(Paths.get("target/test-classes")
                   .resolve(name).toFile());
           migration.setDestination(destination);
           migration.execute();
           assertTrue(destination.exists());
   
           final byte[] bytecode = Files.readAllBytes(destination.toPath());
           final JavaClass javaClass = new ClassParser(new 
ByteArrayInputStream(bytecode), "unknown").parse();
           final String constantPool = javaClass.getConstantPool().toString();
           // but stay javax since it is the one from the jvm, not the jakarta 
one (from xpathconstants dep)
           assertTrue(constantPool, 
constantPool.contains("CONSTANT_Utf8[1](\"Ljavax/xml/namespace/QName;\")"));
           assertTrue(constantPool, 
constantPool.contains("CONSTANT_Utf8[1](\"javax/xml/xpath/XPathConstants\")"));
           assertFalse(constantPool, 
constantPool.contains("CONSTANT_Utf8[1](\"Ljakarta/xml/namespace/QName;\")"));
       }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to