forked from bytemanproject/byteman
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
207 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 35 additions & 6 deletions
41
agent/src/test/java/org/jboss/byteman/tests/auxiliary/C3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,40 @@ | |||
/* | |||
* JBoss, Home of Professional Open Source | |||
* Copyright 2011, Red Hat and individual contributors | |||
* by the @authors tag. See the copyright.txt in the distribution for a | |||
* full listing of individual contributors. | |||
* | |||
* This is free software; you can redistribute it and/or modify it | |||
* under the terms of the GNU Lesser General Public License as | |||
* published by the Free Software Foundation; either version 2.1 of | |||
* the License, or (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public | |||
* License along with this software; if not, write to the Free | |||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |||
* | |||
* @authors Andrew Dinn | |||
*/ | |||
|
|||
package org.jboss.byteman.tests.auxiliary; | package org.jboss.byteman.tests.auxiliary; | ||
|
|
||
import org.jboss.byteman.tests.Test; | |||
|
|||
/** | /** | ||
* Created by IntelliJ IDEA. | * test class for fix to BYTEMAN-219 | ||
* User: adinn | |||
* Date: 26/11/12 | |||
* Time: 12:31 | |||
* To change this template use File | Settings | File Templates. | |||
*/ | */ | ||
public class C3 { | public abstract class C3 implements I5 | ||
{ | |||
// n.b. this class does not implement interfaceMethod() inherited from I5 | |||
// but it's instantiable subclasses always will! | |||
public void testMethod(Test test) | |||
{ | |||
test.log("inside C3.testMethod"); | |||
} | |||
} | } |
40 changes: 34 additions & 6 deletions
40
agent/src/test/java/org/jboss/byteman/tests/auxiliary/C4.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,39 @@ | |||
/* | |||
* JBoss, Home of Professional Open Source | |||
* Copyright 2011, Red Hat and individual contributors | |||
* by the @authors tag. See the copyright.txt in the distribution for a | |||
* full listing of individual contributors. | |||
* | |||
* This is free software; you can redistribute it and/or modify it | |||
* under the terms of the GNU Lesser General Public License as | |||
* published by the Free Software Foundation; either version 2.1 of | |||
* the License, or (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public | |||
* License along with this software; if not, write to the Free | |||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |||
* | |||
* @authors Andrew Dinn | |||
*/ | |||
|
|||
package org.jboss.byteman.tests.auxiliary; | package org.jboss.byteman.tests.auxiliary; | ||
|
|
||
import org.jboss.byteman.tests.Test; | |||
|
|||
/** | /** | ||
* Created by IntelliJ IDEA. | * test class for fix to BYTEMAN-219 | ||
* User: adinn | |||
* Date: 26/11/12 | |||
* Time: 12:33 | |||
* To change this template use File | Settings | File Templates. | |||
*/ | */ | ||
public class C4 { | public class C4 extends C3 | ||
{ | |||
// this non-abstract class has to implement interfaceMethod() inherited from I5 via C3 | |||
public void interfaceMethod(Test test) | |||
{ | |||
test.log("inside C4.interfaceMethod"); | |||
} | |||
} | } |
36 changes: 30 additions & 6 deletions
36
agent/src/test/java/org/jboss/byteman/tests/auxiliary/I5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,35 @@ | |||
/* | |||
* JBoss, Home of Professional Open Source | |||
* Copyright 2011, Red Hat and individual contributors | |||
* by the @authors tag. See the copyright.txt in the distribution for a | |||
* full listing of individual contributors. | |||
* | |||
* This is free software; you can redistribute it and/or modify it | |||
* under the terms of the GNU Lesser General Public License as | |||
* published by the Free Software Foundation; either version 2.1 of | |||
* the License, or (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public | |||
* License along with this software; if not, write to the Free | |||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |||
* | |||
* @authors Andrew Dinn | |||
*/ | |||
|
|||
package org.jboss.byteman.tests.auxiliary; | package org.jboss.byteman.tests.auxiliary; | ||
|
|
||
import org.jboss.byteman.tests.Test; | |||
|
|||
/** | /** | ||
* Created by IntelliJ IDEA. | * test class for fix to BYTEMAN-219 | ||
* User: adinn | |||
* Date: 26/11/12 | |||
* Time: 12:30 | |||
* To change this template use File | Settings | File Templates. | |||
*/ | */ | ||
public class I5 { | public interface I5 | ||
{ | |||
public void interfaceMethod(Test test); | |||
} | } |
70 changes: 63 additions & 7 deletions
70
agent/src/test/java/org/jboss/byteman/tests/bugfixes/TestAbstractInterfaceCall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,67 @@ | |||
/* | |||
* JBoss, Home of Professional Open Source | |||
* Copyright 2012, Red Hat and individual contributors | |||
* by the @authors tag. See the copyright.txt in the distribution for a | |||
* full listing of individual contributors. | |||
* | |||
* This is free software; you can redistribute it and/or modify it | |||
* under the terms of the GNU Lesser General Public License as | |||
* published by the Free Software Foundation; either version 2.1 of | |||
* the License, or (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public | |||
* License along with this software; if not, write to the Free | |||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |||
* | |||
* @authors Andrew Dinn | |||
*/ | |||
package org.jboss.byteman.tests.bugfixes; | package org.jboss.byteman.tests.bugfixes; | ||
|
|
||
import org.jboss.byteman.tests.Test; | |||
import org.jboss.byteman.tests.auxiliary.C3; | |||
import org.jboss.byteman.tests.auxiliary.C4; | |||
import org.jboss.byteman.tests.auxiliary.I5; | |||
|
|||
|
|||
/** | /** | ||
* Created by IntelliJ IDEA. | * Test for BYTEMAN-219 where a call to an interface method of an abstract class failed to typecheck | ||
* User: adinn | * because there was no implementation on the abstract class. | ||
* Date: 26/11/12 | |||
* Time: 12:26 | |||
* To change this template use File | Settings | File Templates. | |||
*/ | */ | ||
public class TestAbstractInterfaceCall { | public class TestAbstractInterfaceCall extends Test | ||
} | { | ||
private int run; | |||
|
|||
public TestAbstractInterfaceCall() | |||
{ | |||
super(TestAbstractInterfaceCall.class.getCanonicalName()); | |||
} | |||
|
|||
public void test() | |||
{ | |||
C4 c4 = new C4(); | |||
try { | |||
log("calling C4.testMethod"); | |||
c4.testMethod(this); | |||
log("called C4.testMethod"); | |||
} catch (Exception e) { | |||
log(e); | |||
} | |||
|
|||
checkOutput(true); | |||
} | |||
|
|||
@Override | |||
public String getExpected() { | |||
logExpected("calling C4.testMethod"); | |||
logExpected("inside C4.interfaceMethod"); | |||
logExpected("inside C3.testMethod"); | |||
logExpected("called C4.testMethod"); | |||
return super.getExpected(); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters