From 730238f3bab1c680424e0ac74178c33b15b43eb5 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 7 Sep 2014 22:30:28 -0400 Subject: added some basic tests for the deobufscator and the jar index --- test/cuchaz/enigma/EntryFactory.java | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/cuchaz/enigma/EntryFactory.java (limited to 'test/cuchaz/enigma/EntryFactory.java') 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 @@ +/******************************************************************************* + * Copyright (c) 2014 Jeff Martin.\ + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Public License v3.0 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/gpl.html + * + * Contributors: + * Jeff Martin - initial API and implementation + ******************************************************************************/ +package cuchaz.enigma; + +import cuchaz.enigma.analysis.EntryReference; +import cuchaz.enigma.mapping.BehaviorEntry; +import cuchaz.enigma.mapping.ClassEntry; +import cuchaz.enigma.mapping.ConstructorEntry; +import cuchaz.enigma.mapping.FieldEntry; +import cuchaz.enigma.mapping.MethodEntry; + +public class EntryFactory +{ + public static ClassEntry newClass( String name ) + { + return new ClassEntry( name ); + } + + public static FieldEntry newField( String className, String fieldName ) + { + return new FieldEntry( newClass( className ), fieldName ); + } + + public static MethodEntry newMethod( String className, String methodName, String methodSignature ) + { + return new MethodEntry( newClass( className ), methodName, methodSignature ); + } + + public static ConstructorEntry newConstructor( String className, String signature ) + { + return new ConstructorEntry( newClass( className ), signature ); + } + + public static EntryReference newFieldReferenceByMethod( String fieldClassName, String fieldName, String callerClassName, String callerName, String callerSignature ) + { + return new EntryReference( newField( fieldClassName, fieldName ), newMethod( callerClassName, callerName, callerSignature ) ); + } + + public static EntryReference newFieldReferenceByConstructor( String fieldClassName, String fieldName, String callerClassName, String callerSignature ) + { + return new EntryReference( newField( fieldClassName, fieldName ), newConstructor( callerClassName, callerSignature ) ); + } +} -- cgit v1.2.3