Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
d95d268e
Commit
d95d268e
authored
Mar 19, 2016
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: test enum implementing interface
parent
b4930bc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
TestEnumsInterface.java
...java/jadx/tests/integration/enums/TestEnumsInterface.java
+52
-0
No files found.
jadx-core/src/test/java/jadx/tests/integration/enums/TestEnumsInterface.java
0 → 100644
View file @
d95d268e
package
jadx
.
tests
.
integration
.
enums
;
import
jadx.core.dex.nodes.ClassNode
;
import
jadx.tests.api.IntegrationTest
;
import
jadx.tests.api.utils.JadxMatchers
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
class
TestEnumsInterface
extends
IntegrationTest
{
public
static
class
TestCls
{
public
enum
Operation
implements
IOperation
{
PLUS
{
public
int
apply
(
int
x
,
int
y
)
{
return
x
+
y
;
}
},
MINUS
{
public
int
apply
(
int
x
,
int
y
)
{
return
x
-
y
;
}
};
}
public
interface
IOperation
{
int
apply
(
int
x
,
int
y
);
}
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
assertThat
(
code
,
JadxMatchers
.
containsLines
(
1
,
"public enum Operation implements IOperation {"
,
indent
(
1
)
+
"PLUS {"
,
indent
(
2
)
+
"public int apply(int x, int y) {"
,
indent
(
3
)
+
"return x + y;"
,
indent
(
2
)
+
"}"
,
indent
(
1
)
+
"},"
,
indent
(
1
)
+
"MINUS {"
,
indent
(
2
)
+
"public int apply(int x, int y) {"
,
indent
(
3
)
+
"return x - y;"
,
indent
(
2
)
+
"}"
,
indent
(
1
)
+
"}"
,
"}"
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment