diff options
| author | 2014-09-07 22:30:28 -0400 | |
|---|---|---|
| committer | 2014-09-07 22:30:28 -0400 | |
| commit | 730238f3bab1c680424e0ac74178c33b15b43eb5 (patch) | |
| tree | 4cc1075993b63d0066d5d4325c20bf49a3b88209 /test/cuchaz/enigma/EntryFactory.java | |
| parent | added proguard to the gradle config to create obfuscated jars for testing (diff) | |
| download | enigma-fork-730238f3bab1c680424e0ac74178c33b15b43eb5.tar.gz enigma-fork-730238f3bab1c680424e0ac74178c33b15b43eb5.tar.xz enigma-fork-730238f3bab1c680424e0ac74178c33b15b43eb5.zip | |
added some basic tests for the deobufscator and the jar index
Diffstat (limited to 'test/cuchaz/enigma/EntryFactory.java')
| -rw-r--r-- | test/cuchaz/enigma/EntryFactory.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/cuchaz/enigma/EntryFactory.java b/test/cuchaz/enigma/EntryFactory.java new file mode 100644 index 0000000..b275719 --- /dev/null +++ b/test/cuchaz/enigma/EntryFactory.java | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2014 Jeff Martin.\ | ||
| 3 | * | ||
| 4 | * All rights reserved. This program and the accompanying materials | ||
| 5 | * are made available under the terms of the GNU Public License v3.0 | ||
| 6 | * which accompanies this distribution, and is available at | ||
| 7 | * http://www.gnu.org/licenses/gpl.html | ||
| 8 | * | ||
| 9 | * Contributors: | ||
| 10 | * Jeff Martin - initial API and implementation | ||
| 11 | ******************************************************************************/ | ||
| 12 | package cuchaz.enigma; | ||
| 13 | |||
| 14 | import cuchaz.enigma.analysis.EntryReference; | ||
| 15 | import cuchaz.enigma.mapping.BehaviorEntry; | ||
| 16 | import cuchaz.enigma.mapping.ClassEntry; | ||
| 17 | import cuchaz.enigma.mapping.ConstructorEntry; | ||
| 18 | import cuchaz.enigma.mapping.FieldEntry; | ||
| 19 | import cuchaz.enigma.mapping.MethodEntry; | ||
| 20 | |||
| 21 | public class EntryFactory | ||
| 22 | { | ||
| 23 | public static ClassEntry newClass( String name ) | ||
| 24 | { | ||
| 25 | return new ClassEntry( name ); | ||
| 26 | } | ||
| 27 | |||
| 28 | public static FieldEntry newField( String className, String fieldName ) | ||
| 29 | { | ||
| 30 | return new FieldEntry( newClass( className ), fieldName ); | ||
| 31 | } | ||
| 32 | |||
| 33 | public static MethodEntry newMethod( String className, String methodName, String methodSignature ) | ||
| 34 | { | ||
| 35 | return new MethodEntry( newClass( className ), methodName, methodSignature ); | ||
| 36 | } | ||
| 37 | |||
| 38 | public static ConstructorEntry newConstructor( String className, String signature ) | ||
| 39 | { | ||
| 40 | return new ConstructorEntry( newClass( className ), signature ); | ||
| 41 | } | ||
| 42 | |||
| 43 | public static EntryReference<FieldEntry,BehaviorEntry> newFieldReferenceByMethod( String fieldClassName, String fieldName, String callerClassName, String callerName, String callerSignature ) | ||
| 44 | { | ||
| 45 | return new EntryReference<FieldEntry,BehaviorEntry>( newField( fieldClassName, fieldName ), newMethod( callerClassName, callerName, callerSignature ) ); | ||
| 46 | } | ||
| 47 | |||
| 48 | public static EntryReference<FieldEntry,BehaviorEntry> newFieldReferenceByConstructor( String fieldClassName, String fieldName, String callerClassName, String callerSignature ) | ||
| 49 | { | ||
| 50 | return new EntryReference<FieldEntry,BehaviorEntry>( newField( fieldClassName, fieldName ), newConstructor( callerClassName, callerSignature ) ); | ||
| 51 | } | ||
| 52 | } | ||