id
int32
0
12.9k
code
sequencelengths
2
264k
10,800
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "resource", ";", "import", "java", ".", "text", ".", "MessageFormat", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "interface", "Messages", "{", "String", "get", "(", "String", "id", ",", "Object", "...", "args", ")", ";", "void", "add", "(", "Messages", "messages", ")", ";", "Map", "<", "String", ",", "String", ">", "getMessages", "(", ")", ";", "Messages", "newMessages", "(", "String", "name", ")", ";", "}", "</s>" ]
10,801
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "resource", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Locale", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "ResourceNotFoundException", ";", "public", "interface", "Locales", "{", "Locale", "getLocale", "(", ")", ";", "void", "setLocale", "(", "Locale", "locale", ")", ";", "Locale", "getLocale", "(", "String", "code", ")", ";", "List", "<", "Locale", ">", "getLocales", "(", ")", ";", "Messages", "getMessages", "(", ")", ";", "Messages", "getMessages", "(", "String", "name", ")", ";", "}", "</s>" ]
10,802
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "resource", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "javax", ".", "swing", ".", "ImageIcon", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "ResourceException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "ResourceNotFoundException", ";", "public", "interface", "Resources", "{", "InputStream", "getInputStream", "(", "String", "name", ")", ";", "URL", "getURL", "(", "String", "name", ")", ";", "String", "getString", "(", "String", "name", ")", ";", "String", "getString", "(", "String", "name", ",", "String", "defaultValue", ")", ";", "String", "getString", "(", "String", "name", ",", "String", "encoding", ",", "String", "defaultValue", ")", ";", "Object", "getObject", "(", "String", "name", ")", ";", "ImageIcon", "getImageIcon", "(", "String", "name", ",", "String", "...", "alternatives", ")", ";", "}", "</s>" ]
10,803
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "handler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "event", ".", "ProgressListener", ";", "@", "Deprecated", "public", "interface", "AbstractUIProgressHandler", "extends", "AbstractUIHandler", ",", "ProgressListener", "{", "}", "</s>" ]
10,804
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "handler", ";", "public", "interface", "AbstractUIHandler", "{", "public", "void", "emitNotification", "(", "String", "message", ")", ";", "public", "boolean", "emitWarning", "(", "String", "title", ",", "String", "message", ")", ";", "public", "void", "emitError", "(", "String", "title", ",", "String", "message", ")", ";", "@", "Deprecated", "public", "void", "emitErrorAndBlockNext", "(", "String", "title", ",", "String", "message", ")", ";", "public", "static", "final", "int", "ANSWER_CANCEL", "=", "45", ";", "public", "static", "final", "int", "ANSWER_YES", "=", "47", ";", "public", "static", "final", "int", "ANSWER_NO", "=", "49", ";", "public", "static", "final", "int", "CHOICES_YES_NO", "=", "37", ";", "public", "static", "final", "int", "CHOICES_YES_NO_CANCEL", "=", "38", ";", "public", "int", "askQuestion", "(", "String", "title", ",", "String", "question", ",", "int", "choices", ")", ";", "public", "int", "askQuestion", "(", "String", "title", ",", "String", "question", ",", "int", "choices", ",", "int", "default_choice", ")", ";", "}", "</s>" ]
10,805
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "handler", ";", "public", "interface", "Prompt", "{", "enum", "Type", "{", "INFORMATION", ",", "QUESTION", ",", "WARNING", ",", "ERROR", "}", "enum", "Option", "{", "OK", ",", "YES", ",", "NO", ",", "CANCEL", "}", "enum", "Options", "{", "OK_CANCEL", ",", "YES_NO", ",", "YES_NO_CANCEL", "}", "void", "message", "(", "Type", "type", ",", "String", "message", ")", ";", "void", "message", "(", "Type", "type", ",", "String", "title", ",", "String", "message", ")", ";", "Option", "confirm", "(", "Type", "type", ",", "String", "message", ",", "Options", "options", ")", ";", "Option", "confirm", "(", "Type", "type", ",", "String", "message", ",", "Options", "options", ",", "Option", "defaultOption", ")", ";", "Option", "confirm", "(", "Type", "type", ",", "String", "title", ",", "String", "message", ",", "Options", "options", ")", ";", "Option", "confirm", "(", "Type", "type", ",", "String", "title", ",", "String", "message", ",", "Options", "options", ",", "Option", "defaultOption", ")", ";", "}", "</s>" ]
10,806
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "rules", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "public", "abstract", "class", "ConditionWithMultipleOperands", "extends", "Condition", "{", "protected", "List", "<", "Condition", ">", "nestedConditions", "=", "new", "ArrayList", "<", "Condition", ">", "(", ")", ";", "public", "List", "<", "Condition", ">", "getOperands", "(", ")", "{", "return", "nestedConditions", ";", "}", "public", "void", "addOperands", "(", "Condition", "...", "operands", ")", "{", "Collections", ".", "addAll", "(", "nestedConditions", ",", "operands", ")", ";", "}", "}", "</s>" ]
10,807
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "rules", ";", "import", "java", ".", "util", ".", "EnumSet", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "enum", "ComparisonOperator", "{", "EQUAL", "(", "\"eq\"", ")", ",", "NOTEQUAL", "(", "\"ne\"", ")", ",", "LESSEQUAL", "(", "\"leq\"", ")", ",", "LESS", "(", "\"lt\"", ")", ",", "GREATEREQUAL", "(", "\"geq\"", ")", ",", "GREATER", "(", "\"gt\"", ")", ";", "private", "static", "Map", "<", "String", ",", "ComparisonOperator", ">", "lookup", ";", "private", "String", "attribute", ";", "ComparisonOperator", "(", "String", "attribute", ")", "{", "this", ".", "attribute", "=", "attribute", ";", "}", "static", "{", "lookup", "=", "new", "HashMap", "<", "String", ",", "ComparisonOperator", ">", "(", ")", ";", "for", "(", "ComparisonOperator", "op", ":", "EnumSet", ".", "allOf", "(", "ComparisonOperator", ".", "class", ")", ")", "{", "lookup", ".", "put", "(", "op", ".", "getAttribute", "(", ")", ",", "op", ")", ";", "}", "}", "public", "String", "getAttribute", "(", ")", "{", "return", "attribute", ";", "}", "public", "static", "ComparisonOperator", "getComparisonOperatorFromAttribute", "(", "String", "attribute", ")", "{", "if", "(", "attribute", "!=", "null", "&&", "lookup", ".", "containsKey", "(", "attribute", ")", ")", "{", "return", "lookup", ".", "get", "(", "attribute", ")", ";", "}", "return", "null", ";", "}", "}", "</s>" ]
10,808
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "rules", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "public", "abstract", "class", "Condition", "implements", "Serializable", "{", "private", "static", "final", "long", "serialVersionUID", "=", "507592103321711123L", ";", "private", "String", "id", ";", "private", "transient", "InstallData", "installData", ";", "public", "Condition", "(", ")", "{", "this", ".", "setId", "(", "\"UNKNOWN\"", ")", ";", "}", "public", "String", "getId", "(", ")", "{", "return", "this", ".", "id", ";", "}", "public", "void", "setId", "(", "String", "id", ")", "{", "this", ".", "id", "=", "id", ";", "}", "public", "abstract", "void", "readFromXML", "(", "IXMLElement", "xmlcondition", ")", "throws", "Exception", ";", "public", "abstract", "boolean", "isTrue", "(", ")", ";", "public", "InstallData", "getInstallData", "(", ")", "{", "return", "installData", ";", "}", "public", "void", "setInstallData", "(", "InstallData", "installData", ")", "{", "this", ".", "installData", "=", "installData", ";", "}", "public", "String", "getDependenciesDetails", "(", ")", "{", "return", "\"\"", ";", "}", "public", "abstract", "void", "makeXMLData", "(", "IXMLElement", "conditionRoot", ")", ";", "}", "</s>" ]
10,809
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "rules", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLElementImpl", ";", "public", "abstract", "class", "CompareCondition", "extends", "Condition", "{", "protected", "String", "operand1", ";", "protected", "String", "operand2", ";", "protected", "ComparisonOperator", "operator", "=", "ComparisonOperator", ".", "EQUAL", ";", "public", "CompareCondition", "(", "String", "op1", ",", "String", "op2", ")", "{", "super", "(", ")", ";", "operand1", "=", "op1", ";", "operand2", "=", "op2", ";", "}", "public", "CompareCondition", "(", ")", "{", "super", "(", ")", ";", "}", "public", "String", "getLeftOperand", "(", ")", "{", "return", "operand1", ";", "}", "public", "void", "setLeftOperand", "(", "String", "value", ")", "{", "operand1", "=", "value", ";", "}", "public", "String", "getRightOperand", "(", ")", "{", "return", "operand2", ";", "}", "public", "void", "setRightOperand", "(", "String", "value", ")", "{", "operand2", "=", "value", ";", "}", "public", "ComparisonOperator", "getOperator", "(", ")", "{", "return", "operator", ";", "}", "public", "void", "setOperator", "(", "ComparisonOperator", "operator", ")", "{", "this", ".", "operator", "=", "operator", ";", "}", "@", "Override", "public", "void", "readFromXML", "(", "IXMLElement", "xmlcondition", ")", "throws", "Exception", "{", "try", "{", "this", ".", "operand1", "=", "xmlcondition", ".", "getFirstChildNamed", "(", "\"arg1\"", ")", ".", "getContent", "(", ")", ";", "this", ".", "operand2", "=", "xmlcondition", ".", "getFirstChildNamed", "(", "\"arg2\"", ")", ".", "getContent", "(", ")", ";", "String", "operatorAttr", "=", "xmlcondition", ".", "getFirstChildNamed", "(", "\"operator\"", ")", ".", "getContent", "(", ")", ";", "if", "(", "operatorAttr", "!=", "null", ")", "{", "operator", "=", "ComparisonOperator", ".", "getComparisonOperatorFromAttribute", "(", "operatorAttr", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "Exception", "(", "\"\"", "+", "getClass", "(", ")", ".", "getSimpleName", "(", ")", "+", "\"\\\"/>\"", ")", ";", "}", "}", "@", "Override", "public", "String", "getDependenciesDetails", "(", ")", "{", "StringBuffer", "details", "=", "new", "StringBuffer", "(", ")", ";", "details", ".", "append", "(", "getId", "(", ")", ")", ";", "details", ".", "append", "(", "\"\"", ")", ";", "details", ".", "append", "(", "this", ".", "operand1", ")", ";", "details", ".", "append", "(", "\"</b>", "and", "<b>\"", ")", ";", "details", ".", "append", "(", "this", ".", "operand2", ")", ";", "details", ".", "append", "(", "\"</b>\"", ")", ";", "details", ".", "append", "(", "\"\"", "+", "this", ".", "operator", ")", ";", "details", ".", "append", "(", "\"</b><br/>\"", ")", ";", "return", "details", ".", "toString", "(", ")", ";", "}", "@", "Override", "public", "void", "makeXMLData", "(", "IXMLElement", "conditionRoot", ")", "{", "XMLElementImpl", "nameXml", "=", "new", "XMLElementImpl", "(", "\"arg1\"", ",", "conditionRoot", ")", ";", "nameXml", ".", "setContent", "(", "this", ".", "operand1", ")", ";", "conditionRoot", ".", "addChild", "(", "nameXml", ")", ";", "XMLElementImpl", "valueXml", "=", "new", "XMLElementImpl", "(", "\"arg2\"", ",", "conditionRoot", ")", ";", "valueXml", ".", "setContent", "(", "this", ".", "operand2", ")", ";", "conditionRoot", ".", "addChild", "(", "valueXml", ")", ";", "XMLElementImpl", "opXml", "=", "new", "XMLElementImpl", "(", "\"operator\"", ",", "conditionRoot", ")", ";", "opXml", ".", "setContent", "(", "this", ".", "operator", ".", "getAttribute", "(", ")", ")", ";", "conditionRoot", ".", "addChild", "(", "opXml", ")", ";", "}", "}", "</s>" ]
10,810
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "rules", ";", "import", "java", ".", "io", ".", "OutputStream", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Variables", ";", "public", "interface", "RulesEngine", "{", "Set", "<", "String", ">", "getKnownConditionIds", "(", ")", ";", "boolean", "isConditionTrue", "(", "String", "id", ",", "InstallData", "installData", ")", ";", "boolean", "isConditionTrue", "(", "Condition", "cond", ",", "InstallData", "installData", ")", ";", "boolean", "isConditionTrue", "(", "String", "id", ")", ";", "boolean", "isConditionTrue", "(", "Condition", "cond", ")", ";", "boolean", "canShowPanel", "(", "String", "panelid", ",", "Variables", "variables", ")", ";", "boolean", "canInstallPack", "(", "String", "packid", ",", "Variables", "variables", ")", ";", "boolean", "canInstallPackOptional", "(", "String", "packid", ",", "Variables", "variables", ")", ";", "void", "addCondition", "(", "Condition", "condition", ")", ";", "void", "writeRulesXML", "(", "OutputStream", "out", ")", ";", "Condition", "getCondition", "(", "String", "id", ")", ";", "void", "readConditionMap", "(", "Map", "<", "String", ",", "Condition", ">", "rules", ")", ";", "void", "analyzeXml", "(", "IXMLElement", "conditionsspec", ")", ";", "@", "Deprecated", "Condition", "instanciateCondition", "(", "IXMLElement", "condition", ")", ";", "Condition", "createCondition", "(", "IXMLElement", "condition", ")", ";", "void", "resolveConditions", "(", ")", "throws", "Exception", ";", "IXMLElement", "createConditionElement", "(", "Condition", "condition", ",", "IXMLElement", "root", ")", ";", "}", "</s>" ]
10,811
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "rules", ";", "public", "abstract", "class", "ConditionReference", "extends", "Condition", "{", "private", "Condition", "referencedCondition", ";", "public", "Condition", "getReferencedCondition", "(", ")", "{", "return", "referencedCondition", ";", "}", "public", "void", "setReferencedCondition", "(", "Condition", "referencedCondition", ")", "{", "this", ".", "referencedCondition", "=", "referencedCondition", ";", "}", "public", "abstract", "void", "resolveReference", "(", ")", ";", "}", "</s>" ]
10,812
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "ContainerException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "IzPackClassNotFoundException", ";", "public", "interface", "Container", "{", "<", "T", ">", "void", "addComponent", "(", "Class", "<", "T", ">", "componentType", ")", ";", "void", "addComponent", "(", "Object", "componentKey", ",", "Object", "implementation", ")", ";", "<", "T", ">", "T", "getComponent", "(", "Class", "<", "T", ">", "componentType", ")", ";", "Object", "getComponent", "(", "Object", "componentKeyOrType", ")", ";", "Container", "createChildContainer", "(", ")", ";", "boolean", "removeChildContainer", "(", "Container", "child", ")", ";", "void", "dispose", "(", ")", ";", "<", "T", ">", "Class", "<", "T", ">", "getClass", "(", "String", "className", ",", "Class", "<", "T", ">", "superType", ")", ";", "}", "</s>" ]
10,813
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ";", "import", "java", ".", "io", ".", "OutputStream", ";", "public", "interface", "IXMLWriter", "{", "void", "write", "(", "IXMLElement", "element", ")", ";", "void", "setOutput", "(", "OutputStream", "outputStream", ")", ";", "void", "setOutput", "(", "String", "systemId", ")", ";", "}", "</s>" ]
10,814
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "net", ".", "URL", ";", "public", "interface", "IXMLParser", "{", "public", "static", "final", "String", "XSL_FILE_NAME", "=", "\"\"", ";", "IXMLElement", "parse", "(", "InputStream", "inputStream", ")", ";", "IXMLElement", "parse", "(", "InputStream", "inputStream", ",", "String", "systemId", ")", ";", "IXMLElement", "parse", "(", "String", "inputString", ")", ";", "IXMLElement", "parse", "(", "URL", "inputURL", ")", ";", "}", "</s>" ]
10,815
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "Queue", ";", "import", "java", ".", "util", ".", "Stack", ";", "import", "javax", ".", "xml", ".", "transform", ".", "dom", ".", "DOMResult", ";", "import", "org", ".", "w3c", ".", "dom", ".", "Element", ";", "import", "org", ".", "w3c", ".", "dom", ".", "Node", ";", "import", "org", ".", "xml", ".", "sax", ".", "Attributes", ";", "import", "org", ".", "xml", ".", "sax", ".", "Locator", ";", "import", "org", ".", "xml", ".", "sax", ".", "SAXException", ";", "import", "org", ".", "xml", ".", "sax", ".", "XMLReader", ";", "import", "org", ".", "xml", ".", "sax", ".", "helpers", ".", "XMLFilterImpl", ";", "public", "class", "LineNumberFilter", "extends", "XMLFilterImpl", "{", "private", "Queue", "<", "Integer", ">", "lnQueue", ";", "private", "Locator", "locator", ";", "public", "LineNumberFilter", "(", "XMLReader", "xmlReader", ")", "{", "super", "(", "xmlReader", ")", ";", "}", "@", "Override", "public", "void", "startDocument", "(", ")", "throws", "SAXException", "{", "super", ".", "startDocument", "(", ")", ";", "lnQueue", "=", "new", "LinkedList", "<", "Integer", ">", "(", ")", ";", "}", "@", "Override", "public", "void", "startElement", "(", "String", "uri", ",", "String", "localName", ",", "String", "qName", ",", "Attributes", "atts", ")", "throws", "SAXException", "{", "super", ".", "startElement", "(", "uri", ",", "localName", ",", "qName", ",", "atts", ")", ";", "lnQueue", ".", "add", "(", "locator", ".", "getLineNumber", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "setDocumentLocator", "(", "Locator", "locator", ")", "{", "super", ".", "setDocumentLocator", "(", "locator", ")", ";", "this", ".", "locator", "=", "locator", ";", "}", "public", "Locator", "getDocumentLocator", "(", ")", "{", "return", "locator", ";", "}", "private", "Element", "getFirstFoundElement", "(", "Node", "elt", ")", "{", "while", "(", "elt", "!=", "null", "&&", "elt", ".", "getNodeType", "(", ")", "!=", "Node", ".", "ELEMENT_NODE", ")", "{", "elt", "=", "elt", ".", "getNextSibling", "(", ")", ";", "}", "return", "(", "Element", ")", "elt", ";", "}", "private", "Element", "getNextSibling", "(", "Node", "elt", ")", "{", "return", "getFirstFoundElement", "(", "elt", ".", "getNextSibling", "(", ")", ")", ";", "}", "private", "Element", "getFirstChild", "(", "Node", "elt", ")", "{", "return", "getFirstFoundElement", "(", "elt", ".", "getFirstChild", "(", ")", ")", ";", "}", "private", "boolean", "hasChildElements", "(", "Node", "elt", ")", "{", "return", "getFirstChild", "(", "elt", ")", "!=", "null", ";", "}", "private", "void", "applyLN", "(", "Element", "elt", ")", "{", "elt", ".", "setUserData", "(", "\"ln\"", ",", "lnQueue", ".", "poll", "(", ")", ",", "null", ")", ";", "}", "public", "void", "applyLN", "(", "DOMResult", "result", ")", "{", "Element", "elt", "=", "getFirstChild", "(", "result", ".", "getNode", "(", ")", ")", ";", "boolean", "end", "=", "false", ";", "Stack", "<", "Element", ">", "stack", "=", "new", "Stack", "<", "Element", ">", "(", ")", ";", "while", "(", "!", "end", ")", "{", "if", "(", "hasChildElements", "(", "elt", ")", ")", "{", "stack", ".", "push", "(", "elt", ")", ";", "applyLN", "(", "elt", ")", ";", "elt", "=", "getFirstChild", "(", "elt", ")", ";", "}", "else", "{", "applyLN", "(", "elt", ")", ";", "Element", "sibling", "=", "getNextSibling", "(", "elt", ")", ";", "if", "(", "sibling", "!=", "null", ")", "{", "elt", "=", "sibling", ";", "}", "else", "{", "do", "{", "if", "(", "stack", ".", "isEmpty", "(", ")", ")", "{", "end", "=", "true", ";", "}", "else", "{", "elt", "=", "stack", ".", "pop", "(", ")", ";", "elt", "=", "getNextSibling", "(", "elt", ")", ";", "}", "}", "while", "(", "!", "end", "&&", "elt", "==", "null", ")", ";", "}", "}", "}", "}", "}", "</s>" ]
10,816
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLWriter", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "XMLException", ";", "import", "javax", ".", "xml", ".", "transform", ".", "*", ";", "import", "javax", ".", "xml", ".", "transform", ".", "dom", ".", "DOMSource", ";", "import", "javax", ".", "xml", ".", "transform", ".", "stream", ".", "StreamResult", ";", "import", "java", ".", "io", ".", "OutputStream", ";", "public", "class", "XMLWriter", "implements", "IXMLWriter", "{", "private", "OutputStream", "outputStream", ";", "private", "String", "systemId", ";", "public", "XMLWriter", "(", ")", "{", "}", "public", "XMLWriter", "(", "OutputStream", "outputStream", ")", "{", "this", ".", "outputStream", "=", "outputStream", ";", "}", "public", "void", "write", "(", "IXMLElement", "element", ")", "{", "try", "{", "Source", "source", "=", "new", "DOMSource", "(", "element", ".", "getElement", "(", ")", ".", "getOwnerDocument", "(", ")", ")", ";", "TransformerFactory", "fabrique", "=", "TransformerFactory", ".", "newInstance", "(", ")", ";", "Transformer", "transformer", "=", "fabrique", ".", "newTransformer", "(", ")", ";", "transformer", ".", "setOutputProperty", "(", "OutputKeys", ".", "INDENT", ",", "\"yes\"", ")", ";", "transformer", ".", "setOutputProperty", "(", "OutputKeys", ".", "ENCODING", ",", "\"UTF-8\"", ")", ";", "Result", "result", ";", "if", "(", "outputStream", "!=", "null", ")", "{", "result", "=", "new", "StreamResult", "(", "outputStream", ")", ";", "}", "else", "{", "result", "=", "new", "StreamResult", "(", "systemId", ")", ";", "}", "transformer", ".", "transform", "(", "source", ",", "result", ")", ";", "}", "catch", "(", "TransformerException", "e", ")", "{", "throw", "new", "XMLException", "(", "e", ")", ";", "}", "}", "public", "void", "setOutput", "(", "OutputStream", "outputStream", ")", "{", "this", ".", "outputStream", "=", "outputStream", ";", "}", "public", "void", "setOutput", "(", "String", "systemId", ")", "{", "this", ".", "systemId", "=", "systemId", ";", "}", "}", "</s>" ]
10,817
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLParser", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "XMLException", ";", "import", "org", ".", "w3c", ".", "dom", ".", "Node", ";", "import", "org", ".", "xml", ".", "sax", ".", "InputSource", ";", "import", "org", ".", "xml", ".", "sax", ".", "Locator", ";", "import", "org", ".", "xml", ".", "sax", ".", "SAXException", ";", "import", "org", ".", "xml", ".", "sax", ".", "XMLReader", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "ParserConfigurationException", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "SAXParserFactory", ";", "import", "javax", ".", "xml", ".", "transform", ".", "Source", ";", "import", "javax", ".", "xml", ".", "transform", ".", "Transformer", ";", "import", "javax", ".", "xml", ".", "transform", ".", "TransformerException", ";", "import", "javax", ".", "xml", ".", "transform", ".", "TransformerFactory", ";", "import", "javax", ".", "xml", ".", "transform", ".", "dom", ".", "DOMResult", ";", "import", "javax", ".", "xml", ".", "transform", ".", "sax", ".", "SAXSource", ";", "import", "javax", ".", "xml", ".", "transform", ".", "stream", ".", "StreamSource", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "nio", ".", "ByteBuffer", ";", "import", "java", ".", "nio", ".", "charset", ".", "Charset", ";", "public", "class", "XMLParser", "implements", "IXMLParser", "{", "public", "class", "ByteBufferInputStream", "extends", "InputStream", "{", "private", "final", "ByteBuffer", "buf", ";", "public", "ByteBufferInputStream", "(", "ByteBuffer", "buf", ")", "{", "this", ".", "buf", "=", "buf", ";", "}", "@", "Override", "public", "synchronized", "int", "read", "(", ")", "throws", "IOException", "{", "if", "(", "!", "buf", ".", "hasRemaining", "(", ")", ")", "{", "return", "-", "1", ";", "}", "int", "c", "=", "buf", ".", "get", "(", ")", "&", "0xff", ";", "return", "c", ";", "}", "@", "Override", "public", "synchronized", "int", "read", "(", "byte", "[", "]", "bytes", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "!", "buf", ".", "hasRemaining", "(", ")", ")", "{", "return", "-", "1", ";", "}", "len", "=", "Math", ".", "min", "(", "len", ",", "buf", ".", "remaining", "(", ")", ")", ";", "buf", ".", "get", "(", "bytes", ",", "off", ",", "len", ")", ";", "return", "len", ";", "}", "@", "Override", "public", "int", "available", "(", ")", "throws", "IOException", "{", "return", "buf", ".", "remaining", "(", ")", ";", "}", "}", "private", "LineNumberFilter", "filter", ";", "private", "String", "parsedItem", "=", "null", ";", "public", "XMLParser", "(", ")", "{", "try", "{", "SAXParserFactory", "saxParserFactory", "=", "SAXParserFactory", ".", "newInstance", "(", ")", ";", "saxParserFactory", ".", "setNamespaceAware", "(", "true", ")", ";", "saxParserFactory", ".", "setXIncludeAware", "(", "true", ")", ";", "XMLReader", "xmlReader", "=", "saxParserFactory", ".", "newSAXParser", "(", ")", ".", "getXMLReader", "(", ")", ";", "filter", "=", "new", "LineNumberFilter", "(", "xmlReader", ")", ";", "}", "catch", "(", "ParserConfigurationException", "e", ")", "{", "throw", "new", "XMLException", "(", "e", ")", ";", "}", "catch", "(", "SAXException", "e", ")", "{", "throw", "new", "XMLException", "(", "e", ")", ";", "}", "}", "private", "IXMLElement", "searchFirstElement", "(", "DOMResult", "domResult", ")", "{", "for", "(", "Node", "child", "=", "domResult", ".", "getNode", "(", ")", ".", "getFirstChild", "(", ")", ";", "child", "!=", "null", ";", "child", "=", "child", ".", "getNextSibling", "(", ")", ")", "{", "if", "(", "child", ".", "getNodeType", "(", ")", "==", "Node", ".", "ELEMENT_NODE", ")", "{", "return", "new", "XMLElementImpl", "(", "child", ")", ";", "}", "}", "return", "null", ";", "}", "private", "DOMResult", "parseLineNrFromInputSource", "(", "InputSource", "inputSource", ")", "{", "DOMResult", "result", "=", "null", ";", "try", "{", "result", "=", "new", "DOMResult", "(", ")", ";", "SAXSource", "source", "=", "new", "SAXSource", "(", "inputSource", ")", ";", "source", ".", "setXMLReader", "(", "filter", ")", ";", "URL", "xslResourceUrl", "=", "IXMLParser", ".", "class", ".", "getResource", "(", "XSL_FILE_NAME", ")", ";", "if", "(", "xslResourceUrl", "==", "null", ")", "{", "throw", "new", "XMLException", "(", "\"\"", "+", "XSL_FILE_NAME", "+", "\"\\\"\"", ")", ";", "}", "Source", "xsltSource", "=", "new", "StreamSource", "(", "xslResourceUrl", ".", "openStream", "(", ")", ")", ";", "Transformer", "xformer", "=", "TransformerFactory", ".", "newInstance", "(", ")", ".", "newTransformer", "(", "xsltSource", ")", ";", "xformer", ".", "transform", "(", "source", ",", "result", ")", ";", "filter", ".", "applyLN", "(", "result", ")", ";", "}", "catch", "(", "TransformerException", "e", ")", "{", "String", "extraInfos", "=", "null", ";", "if", "(", "this", ".", "parsedItem", "!=", "null", ")", "{", "extraInfos", "=", "\"", "in", "\"", "+", "parsedItem", ";", "}", "if", "(", "e", ".", "getLocator", "(", ")", "==", "null", "&&", "filter", ".", "getDocumentLocator", "(", ")", "!=", "null", ")", "{", "Locator", "locator", "=", "filter", ".", "getDocumentLocator", "(", ")", ";", "extraInfos", "+=", "\"", "at", "line", "\"", "+", "locator", ".", "getLineNumber", "(", ")", "+", "\",", "column", "\"", "+", "locator", ".", "getColumnNumber", "(", ")", ";", "}", "if", "(", "extraInfos", "!=", "null", ")", "{", "throw", "new", "XMLException", "(", "\"Error\"", "+", "extraInfos", "+", "\"", ":", "\"", "+", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "throw", "new", "XMLException", "(", "e", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "XMLException", "(", "e", ")", ";", "}", "finally", "{", "this", ".", "parsedItem", "=", "null", ";", "}", "return", "result", ";", "}", "public", "IXMLElement", "parse", "(", "InputStream", "inputStream", ")", "{", "checkNotNullStream", "(", "inputStream", ")", ";", "this", ".", "parsedItem", "=", "null", ";", "InputSource", "inputSource", "=", "new", "InputSource", "(", "inputStream", ")", ";", "DOMResult", "result", "=", "parseLineNrFromInputSource", "(", "inputSource", ")", ";", "return", "searchFirstElement", "(", "result", ")", ";", "}", "public", "IXMLElement", "parse", "(", "InputStream", "inputStream", ",", "String", "systemId", ")", "{", "checkNotNullStream", "(", "inputStream", ")", ";", "this", ".", "parsedItem", "=", "systemId", ";", "InputSource", "inputSource", "=", "new", "InputSource", "(", "inputStream", ")", ";", "inputSource", ".", "setSystemId", "(", "systemId", ")", ";", "DOMResult", "result", "=", "parseLineNrFromInputSource", "(", "inputSource", ")", ";", "return", "searchFirstElement", "(", "result", ")", ";", "}", "public", "IXMLElement", "parse", "(", "String", "inputString", ")", "{", "this", ".", "parsedItem", "=", "null", ";", "final", "ByteBuffer", "buf", "=", "Charset", ".", "forName", "(", "\"UTF-8\"", ")", ".", "encode", "(", "inputString", ")", ";", "return", "parse", "(", "new", "ByteBufferInputStream", "(", "buf", ")", ")", ";", "}", "public", "IXMLElement", "parse", "(", "URL", "inputURL", ")", "{", "this", ".", "parsedItem", "=", "inputURL", ".", "toString", "(", ")", ";", "InputSource", "inputSource", "=", "new", "InputSource", "(", "inputURL", ".", "toExternalForm", "(", ")", ")", ";", "DOMResult", "domResult", "=", "parseLineNrFromInputSource", "(", "inputSource", ")", ";", "return", "searchFirstElement", "(", "domResult", ")", ";", "}", "private", "void", "checkNotNullStream", "(", "InputStream", "inputStream", ")", "{", "if", "(", "inputStream", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"\"", ")", ";", "}", "}", "}", "</s>" ]
10,818
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "org", ".", "w3c", ".", "dom", ".", "*", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "DocumentBuilder", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "DocumentBuilderFactory", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "ParserConfigurationException", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "java", ".", "util", ".", "regex", ".", "Pattern", ";", "public", "class", "XMLElementImpl", "implements", "IXMLElement", "{", "private", "Element", "element", ";", "private", "boolean", "hasChanged", "=", "true", ";", "private", "List", "<", "IXMLElement", ">", "childrenList", ";", "public", "XMLElementImpl", "(", "String", "name", ")", "{", "Document", "document", ";", "try", "{", "DocumentBuilderFactory", "documentFactory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "DocumentBuilder", "constructeur", "=", "documentFactory", ".", "newDocumentBuilder", "(", ")", ";", "document", "=", "constructeur", ".", "newDocument", "(", ")", ";", "document", ".", "setXmlVersion", "(", "\"1.0\"", ")", ";", "element", "=", "document", ".", "createElement", "(", "name", ")", ";", "document", ".", "appendChild", "(", "element", ")", ";", "}", "catch", "(", "ParserConfigurationException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "public", "XMLElementImpl", "(", "String", "name", ",", "Document", "inDocument", ")", "{", "element", "=", "inDocument", ".", "createElement", "(", "name", ")", ";", "}", "public", "XMLElementImpl", "(", "String", "name", ",", "IXMLElement", "elementReference", ")", "{", "element", "=", "elementReference", ".", "getElement", "(", ")", ".", "getOwnerDocument", "(", ")", ".", "createElement", "(", "name", ")", ";", "}", "public", "XMLElementImpl", "(", "Node", "node", ")", "{", "if", "(", "!", "(", "node", "instanceof", "Element", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", ")", ";", "}", "this", ".", "element", "=", "(", "Element", ")", "node", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "element", ".", "getNodeName", "(", ")", ";", "}", "public", "void", "addChild", "(", "IXMLElement", "child", ")", "{", "hasChanged", "=", "true", ";", "element", ".", "appendChild", "(", "child", ".", "getElement", "(", ")", ")", ";", "}", "public", "void", "removeChild", "(", "IXMLElement", "child", ")", "{", "hasChanged", "=", "true", ";", "element", ".", "removeChild", "(", "child", ".", "getElement", "(", ")", ")", ";", "}", "public", "boolean", "hasChildren", "(", ")", "{", "for", "(", "Node", "child", "=", "element", ".", "getFirstChild", "(", ")", ";", "child", "!=", "null", ";", "child", "=", "child", ".", "getNextSibling", "(", ")", ")", "{", "if", "(", "child", ".", "getNodeType", "(", ")", "==", "Node", ".", "ELEMENT_NODE", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "private", "void", "initChildrenList", "(", ")", "{", "if", "(", "hasChanged", ")", "{", "hasChanged", "=", "false", ";", "childrenList", "=", "new", "ArrayList", "<", "IXMLElement", ">", "(", ")", ";", "for", "(", "Node", "child", "=", "element", ".", "getFirstChild", "(", ")", ";", "child", "!=", "null", ";", "child", "=", "child", ".", "getNextSibling", "(", ")", ")", "{", "if", "(", "child", ".", "getNodeType", "(", ")", "==", "Node", ".", "ELEMENT_NODE", ")", "{", "childrenList", ".", "add", "(", "new", "XMLElementImpl", "(", "child", ")", ")", ";", "}", "}", "}", "}", "public", "int", "getChildrenCount", "(", ")", "{", "initChildrenList", "(", ")", ";", "return", "childrenList", ".", "size", "(", ")", ";", "}", "public", "List", "<", "IXMLElement", ">", "getChildren", "(", ")", "{", "initChildrenList", "(", ")", ";", "return", "childrenList", ";", "}", "public", "IXMLElement", "getChildAtIndex", "(", "int", "index", ")", "{", "initChildrenList", "(", ")", ";", "return", "childrenList", ".", "get", "(", "index", ")", ";", "}", "public", "IXMLElement", "getFirstChildNamed", "(", "String", "name", ")", "{", "XMLElementImpl", "res", "=", "null", ";", "NodeList", "nodeList", "=", "element", ".", "getElementsByTagName", "(", "name", ")", ";", "if", "(", "nodeList", ".", "getLength", "(", ")", ">", "0", ")", "{", "res", "=", "new", "XMLElementImpl", "(", "nodeList", ".", "item", "(", "0", ")", ")", ";", "}", "return", "res", ";", "}", "public", "List", "<", "IXMLElement", ">", "getChildrenNamed", "(", "String", "name", ")", "{", "List", "<", "IXMLElement", ">", "res", "=", "new", "ArrayList", "<", "IXMLElement", ">", "(", ")", ";", "for", "(", "IXMLElement", "child", ":", "getChildren", "(", ")", ")", "{", "if", "(", "child", ".", "getName", "(", ")", "!=", "null", "&&", "child", ".", "getName", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "res", ".", "add", "(", "new", "XMLElementImpl", "(", "child", ".", "getElement", "(", ")", ")", ")", ";", "}", "}", "return", "res", ";", "}", "public", "String", "getAttribute", "(", "String", "name", ")", "{", "return", "this", ".", "getAttribute", "(", "name", ",", "null", ")", ";", "}", "public", "String", "getAttribute", "(", "String", "name", ",", "String", "defaultValue", ")", "{", "Node", "attribute", "=", "element", ".", "getAttributes", "(", ")", ".", "getNamedItem", "(", "name", ")", ";", "if", "(", "attribute", "!=", "null", ")", "{", "return", "attribute", ".", "getNodeValue", "(", ")", ";", "}", "return", "defaultValue", ";", "}", "public", "void", "setAttribute", "(", "String", "name", ",", "String", "value", ")", "{", "NamedNodeMap", "attributes", "=", "element", ".", "getAttributes", "(", ")", ";", "Attr", "attribute", "=", "element", ".", "getOwnerDocument", "(", ")", ".", "createAttribute", "(", "name", ")", ";", "attribute", ".", "setValue", "(", "value", ")", ";", "attributes", ".", "setNamedItem", "(", "attribute", ")", ";", "}", "public", "void", "removeAttribute", "(", "String", "name", ")", "{", "this", ".", "element", ".", "getAttributes", "(", ")", ".", "removeNamedItem", "(", "name", ")", ";", "}", "public", "Enumeration", "enumerateAttributeNames", "(", ")", "{", "NamedNodeMap", "namedNodeMap", "=", "element", ".", "getAttributes", "(", ")", ";", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "namedNodeMap", ".", "getLength", "(", ")", ";", "i", "++", ")", "{", "Node", "node", "=", "namedNodeMap", ".", "item", "(", "i", ")", ";", "properties", ".", "put", "(", "node", ".", "getNodeName", "(", ")", ",", "node", ".", "getNodeValue", "(", ")", ")", ";", "}", "return", "properties", ".", "keys", "(", ")", ";", "}", "public", "boolean", "hasAttribute", "(", "String", "name", ")", "{", "return", "(", "this", ".", "element", ".", "getAttributes", "(", ")", ".", "getNamedItem", "(", "name", ")", "!=", "null", ")", ";", "}", "public", "Properties", "getAttributes", "(", ")", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "NamedNodeMap", "namedNodeMap", "=", "this", ".", "element", ".", "getAttributes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "namedNodeMap", ".", "getLength", "(", ")", ";", "++", "i", ")", "{", "properties", ".", "put", "(", "namedNodeMap", ".", "item", "(", "i", ")", ".", "getNodeName", "(", ")", ",", "namedNodeMap", ".", "item", "(", "i", ")", ".", "getNodeValue", "(", ")", ")", ";", "}", "return", "properties", ";", "}", "public", "int", "getLineNr", "(", ")", "{", "Object", "ln", "=", "element", ".", "getUserData", "(", "\"ln\"", ")", ";", "if", "(", "ln", "==", "null", ")", "{", "return", "NO_LINE", ";", "}", "try", "{", "return", "(", "Integer", ")", "element", ".", "getUserData", "(", "\"ln\"", ")", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "return", "NO_LINE", ";", "}", "}", "public", "String", "getContent", "(", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "String", "content", ";", "Node", "child", "=", "this", ".", "element", ".", "getFirstChild", "(", ")", ";", "boolean", "err", "=", "(", "child", "==", "null", ")", ";", "Pattern", "pattern", "=", "Pattern", ".", "compile", "(", "\"^\\\\s+$\"", ")", ";", "while", "(", "!", "err", "&&", "child", "!=", "null", ")", "{", "content", "=", "child", ".", "getNodeValue", "(", ")", ";", "if", "(", "child", ".", "getNodeType", "(", ")", "==", "Node", ".", "TEXT_NODE", ")", "{", "if", "(", "content", "!=", "null", "&&", "!", "pattern", ".", "matcher", "(", "content", ")", ".", "matches", "(", ")", ")", "{", "builder", ".", "append", "(", "content", ")", ";", "}", "}", "else", "if", "(", "child", ".", "getNodeType", "(", ")", "==", "Node", ".", "CDATA_SECTION_NODE", ")", "{", "builder", ".", "append", "(", "content", ")", ";", "}", "else", "{", "err", "=", "true", ";", "}", "child", "=", "child", ".", "getNextSibling", "(", ")", ";", "}", "return", "(", "err", ")", "?", "null", ":", "builder", ".", "toString", "(", ")", ".", "trim", "(", ")", ";", "}", "public", "void", "setContent", "(", "String", "content", ")", "{", "Node", "child", ";", "while", "(", "(", "child", "=", "this", ".", "element", ".", "getFirstChild", "(", ")", ")", "!=", "null", ")", "{", "this", ".", "element", ".", "removeChild", "(", "child", ")", ";", "}", "element", ".", "appendChild", "(", "element", ".", "getOwnerDocument", "(", ")", ".", "createTextNode", "(", "content", ")", ")", ";", "}", "public", "Node", "getElement", "(", ")", "{", "return", "element", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "return", "element", ".", "getNodeName", "(", ")", "+", "\"", "\"", "+", "element", ".", "getNodeValue", "(", ")", ";", "}", "@", "Override", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "obj", "instanceof", "IXMLElement", ")", "{", "IXMLElement", "o", "=", "(", "IXMLElement", ")", "obj", ";", "Element", "elem", "=", "(", "Element", ")", "o", ".", "getElement", "(", ")", ";", "Node", "child2", "=", "elem", ".", "getFirstChild", "(", ")", ";", "for", "(", "Node", "child", "=", "element", ".", "getFirstChild", "(", ")", ";", "child", "!=", "null", "&&", "child2", "!=", "null", ";", "child", "=", "child", ".", "getNextSibling", "(", ")", ")", "{", "if", "(", "!", "child", ".", "equals", "(", "child2", ")", ")", "{", "return", "false", ";", "}", "child2", ".", "getNextSibling", "(", ")", ";", "}", "return", "true", ";", "}", "return", "false", ";", "}", "@", "Override", "public", "int", "hashCode", "(", ")", "{", "int", "hashCode", "=", "0", ";", "for", "(", "Node", "child", "=", "element", ".", "getFirstChild", "(", ")", ";", "child", "!=", "null", ";", "child", "=", "child", ".", "getNextSibling", "(", ")", ")", "{", "hashCode", "+=", "child", ".", "hashCode", "(", ")", ";", "}", "return", "hashCode", ";", "}", "}", "</s>" ]
10,819
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "IzPackException", ";", "public", "class", "XMLException", "extends", "IzPackException", "{", "public", "XMLException", "(", "String", "message", ")", "{", "super", "(", "message", ")", ";", "}", "public", "XMLException", "(", "String", "message", ",", "Throwable", "cause", ")", "{", "super", "(", "message", ",", "cause", ")", ";", "}", "public", "XMLException", "(", "Throwable", "cause", ")", "{", "super", "(", "cause", ")", ";", "}", "}", "</s>" ]
10,820
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ";", "import", "org", ".", "w3c", ".", "dom", ".", "Node", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Properties", ";", "public", "interface", "IXMLElement", "extends", "Serializable", "{", "int", "NO_LINE", "=", "-", "1", ";", "String", "getName", "(", ")", ";", "void", "addChild", "(", "IXMLElement", "child", ")", ";", "void", "removeChild", "(", "IXMLElement", "child", ")", ";", "boolean", "hasChildren", "(", ")", ";", "int", "getChildrenCount", "(", ")", ";", "List", "<", "IXMLElement", ">", "getChildren", "(", ")", ";", "IXMLElement", "getChildAtIndex", "(", "int", "index", ")", "throws", "ArrayIndexOutOfBoundsException", ";", "IXMLElement", "getFirstChildNamed", "(", "String", "name", ")", ";", "List", "<", "IXMLElement", ">", "getChildrenNamed", "(", "String", "name", ")", ";", "String", "getAttribute", "(", "String", "name", ")", ";", "String", "getAttribute", "(", "String", "name", ",", "String", "defaultValue", ")", ";", "void", "setAttribute", "(", "String", "name", ",", "String", "value", ")", ";", "void", "removeAttribute", "(", "String", "name", ")", ";", "Enumeration", "enumerateAttributeNames", "(", ")", ";", "boolean", "hasAttribute", "(", "String", "name", ")", ";", "Properties", "getAttributes", "(", ")", ";", "int", "getLineNr", "(", ")", ";", "String", "getContent", "(", ")", ";", "void", "setContent", "(", "String", "content", ")", ";", "Node", "getElement", "(", ")", ";", "}", "</s>" ]
10,821
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "substitutor", ".", "VariableSubstitutor", ";", "public", "interface", "ValueFilter", "extends", "Serializable", "{", "String", "filter", "(", "String", "value", ",", "VariableSubstitutor", "...", "substitutors", ")", "throws", "Exception", ";", "void", "validate", "(", ")", "throws", "Exception", ";", "}", "</s>" ]
10,822
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "substitutor", ".", "VariableSubstitutor", ";", "public", "interface", "Value", "{", "void", "validate", "(", ")", "throws", "Exception", ";", "String", "resolve", "(", ")", "throws", "Exception", ";", "String", "resolve", "(", "VariableSubstitutor", "...", "substitutors", ")", "throws", "Exception", ";", "InstallData", "getInstallData", "(", ")", ";", "void", "setInstallData", "(", "InstallData", "installData", ")", ";", "}", "</s>" ]
10,823
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "public", "enum", "PackColor", "{", "WHITE", ",", "GREY", ",", "BLACK", "}", "</s>" ]
10,824
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Set", ";", "public", "class", "Info", "implements", "Serializable", "{", "static", "final", "long", "serialVersionUID", "=", "13288410782044775L", ";", "public", "static", "final", "int", "REBOOT_ACTION_IGNORE", "=", "0", ";", "public", "static", "final", "int", "REBOOT_ACTION_NOTICE", "=", "1", ";", "public", "static", "final", "int", "REBOOT_ACTION_ASK", "=", "2", ";", "public", "static", "final", "int", "REBOOT_ACTION_ALWAYS", "=", "3", ";", "private", "String", "appName", "=", "\"\"", ";", "private", "String", "appVersion", "=", "\"\"", ";", "private", "String", "installationSubPath", "=", "null", ";", "private", "ArrayList", "<", "Author", ">", "authors", "=", "new", "ArrayList", "<", "Author", ">", "(", ")", ";", "private", "String", "appURL", "=", "null", ";", "private", "String", "javaVersion", "=", "\"1.4\"", ";", "private", "boolean", "jdkRequired", "=", "false", ";", "private", "String", "installerBase", "=", "null", ";", "private", "String", "webDirURL", "=", "null", ";", "private", "String", "uninstallerName", "=", "\"\"", ";", "private", "String", "uninstallerPath", "=", "\"\"", ";", "private", "String", "uninstallerCondition", "=", "null", ";", "private", "String", "summaryLogFilePath", "=", "\"\"", ";", "private", "String", "packDecoderClassName", "=", "null", ";", "private", "String", "unpackerClassName", "=", "null", ";", "private", "boolean", "writeInstallationInformation", "=", "true", ";", "private", "boolean", "pack200Compression", ";", "private", "boolean", "requirePrivilegedExecution", "=", "false", ";", "private", "boolean", "requirePrivilegedExecutionUninstaller", "=", "false", ";", "private", "String", "privilegedExecutionConditionID", "=", "null", ";", "private", "int", "rebootAction", "=", "REBOOT_ACTION_IGNORE", ";", "private", "String", "rebootActionConditionID", "=", "null", ";", "private", "Set", "<", "TempDir", ">", "tempdirs", ";", "public", "boolean", "isPrivilegedExecutionRequired", "(", ")", "{", "return", "requirePrivilegedExecution", ";", "}", "public", "void", "setRequirePrivilegedExecution", "(", "boolean", "requirePrivilegedExecution", ")", "{", "this", ".", "requirePrivilegedExecution", "=", "requirePrivilegedExecution", ";", "}", "public", "boolean", "isPrivilegedExecutionRequiredUninstaller", "(", ")", "{", "return", "requirePrivilegedExecutionUninstaller", ";", "}", "public", "void", "setRequirePrivilegedExecutionUninstaller", "(", "boolean", "required", ")", "{", "this", ".", "requirePrivilegedExecutionUninstaller", "=", "required", ";", "}", "public", "String", "getPrivilegedExecutionConditionID", "(", ")", "{", "return", "privilegedExecutionConditionID", ";", "}", "public", "void", "setPrivilegedExecutionConditionID", "(", "String", "privilegedExecutionConditionID", ")", "{", "this", ".", "privilegedExecutionConditionID", "=", "privilegedExecutionConditionID", ";", "}", "public", "int", "getRebootAction", "(", ")", "{", "return", "rebootAction", ";", "}", "public", "void", "setRebootAction", "(", "int", "rebootAction", ")", "{", "this", ".", "rebootAction", "=", "rebootAction", ";", "}", "public", "String", "getRebootActionConditionID", "(", ")", "{", "return", "rebootActionConditionID", ";", "}", "public", "void", "setRebootActionConditionID", "(", "String", "rebootActionConditionID", ")", "{", "this", ".", "rebootActionConditionID", "=", "rebootActionConditionID", ";", "}", "public", "Info", "(", ")", "{", "}", "public", "void", "setAppName", "(", "String", "appName", ")", "{", "this", ".", "appName", "=", "appName", ";", "}", "public", "String", "getAppName", "(", ")", "{", "return", "appName", ";", "}", "public", "void", "setAppVersion", "(", "String", "appVersion", ")", "{", "this", ".", "appVersion", "=", "appVersion", ";", "}", "public", "String", "getAppVersion", "(", ")", "{", "return", "appVersion", ";", "}", "public", "void", "addAuthor", "(", "Author", "author", ")", "{", "authors", ".", "add", "(", "author", ")", ";", "}", "public", "ArrayList", "<", "Author", ">", "getAuthors", "(", ")", "{", "return", "authors", ";", "}", "public", "void", "setAppURL", "(", "String", "appURL", ")", "{", "this", ".", "appURL", "=", "appURL", ";", "}", "public", "String", "getAppURL", "(", ")", "{", "return", "appURL", ";", "}", "public", "void", "setJavaVersion", "(", "String", "javaVersion", ")", "{", "this", ".", "javaVersion", "=", "javaVersion", ";", "}", "public", "String", "getJavaVersion", "(", ")", "{", "return", "javaVersion", ";", "}", "public", "void", "setInstallerBase", "(", "String", "installerBase", ")", "{", "this", ".", "installerBase", "=", "installerBase", ";", "}", "public", "String", "getInstallerBase", "(", ")", "{", "return", "installerBase", ";", "}", "public", "void", "setWebDirURL", "(", "String", "url", ")", "{", "this", ".", "webDirURL", "=", "url", ";", "}", "public", "String", "getWebDirURL", "(", ")", "{", "return", "webDirURL", ";", "}", "public", "void", "setUninstallerName", "(", "String", "name", ")", "{", "this", ".", "uninstallerName", "=", "name", ";", "}", "public", "String", "getUninstallerName", "(", ")", "{", "return", "this", ".", "uninstallerName", ";", "}", "public", "void", "setUninstallerPath", "(", "String", "path", ")", "{", "this", ".", "uninstallerPath", "=", "path", ";", "}", "public", "String", "getUninstallerPath", "(", ")", "{", "return", "this", ".", "uninstallerPath", ";", "}", "public", "boolean", "isJdkRequired", "(", ")", "{", "return", "jdkRequired", ";", "}", "public", "void", "setJdkRequired", "(", "boolean", "jdkRequired", ")", "{", "this", ".", "jdkRequired", "=", "jdkRequired", ";", "}", "public", "void", "setPack200Compression", "(", "boolean", "pack200Support", ")", "{", "this", ".", "pack200Compression", "=", "pack200Support", ";", "}", "public", "boolean", "isPack200Compression", "(", ")", "{", "return", "pack200Compression", ";", "}", "public", "static", "class", "Author", "implements", "Serializable", "{", "static", "final", "long", "serialVersionUID", "=", "-", "3090178155004960243L", ";", "private", "String", "name", ";", "private", "String", "email", ";", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "String", "getEmail", "(", ")", "{", "return", "email", ";", "}", "public", "Author", "(", "String", "name", ",", "String", "email", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "email", "=", "email", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "name", "+", "\"", "<\"", "+", "email", "+", "\">\"", ";", "}", "}", "public", "static", "class", "TempDir", "implements", "Serializable", "{", "private", "final", "String", "prefix", ";", "private", "final", "String", "suffix", ";", "private", "final", "String", "variableName", ";", "public", "TempDir", "(", "String", "variableName", ",", "String", "prefix", ",", "String", "suffix", ")", "{", "this", ".", "variableName", "=", "variableName", ";", "this", ".", "prefix", "=", "prefix", ";", "this", ".", "suffix", "=", "suffix", ";", "}", "public", "String", "getPrefix", "(", ")", "{", "return", "prefix", ";", "}", "public", "String", "getSuffix", "(", ")", "{", "return", "suffix", ";", "}", "public", "String", "getVariableName", "(", ")", "{", "return", "variableName", ";", "}", "}", "public", "String", "getInstallationSubPath", "(", ")", "{", "return", "installationSubPath", ";", "}", "public", "void", "setInstallationSubPath", "(", "String", "installationSubPath", ")", "{", "this", ".", "installationSubPath", "=", "installationSubPath", ";", "}", "public", "String", "getSummaryLogFilePath", "(", ")", "{", "return", "summaryLogFilePath", ";", "}", "public", "void", "setSummaryLogFilePath", "(", "String", "summaryLogFilePath", ")", "{", "this", ".", "summaryLogFilePath", "=", "summaryLogFilePath", ";", "}", "public", "String", "getPackDecoderClassName", "(", ")", "{", "return", "packDecoderClassName", ";", "}", "public", "void", "setPackDecoderClassName", "(", "String", "packDecoderClassName", ")", "{", "this", ".", "packDecoderClassName", "=", "packDecoderClassName", ";", "}", "public", "String", "getUnpackerClassName", "(", ")", "{", "return", "unpackerClassName", ";", "}", "public", "void", "setUnpackerClassName", "(", "String", "unpackerClassName", ")", "{", "this", ".", "unpackerClassName", "=", "unpackerClassName", ";", "}", "public", "boolean", "isWriteInstallationInformation", "(", ")", "{", "return", "writeInstallationInformation", ";", "}", "public", "void", "setWriteInstallationInformation", "(", "boolean", "writeInstallationInformation", ")", "{", "this", ".", "writeInstallationInformation", "=", "writeInstallationInformation", ";", "}", "public", "String", "getUninstallerCondition", "(", ")", "{", "return", "uninstallerCondition", ";", "}", "public", "void", "setUninstallerCondition", "(", "String", "uninstallerCondition", ")", "{", "this", ".", "uninstallerCondition", "=", "uninstallerCondition", ";", "}", "public", "void", "addTempDir", "(", "TempDir", "tempDir", ")", "{", "if", "(", "null", "==", "tempdirs", ")", "{", "tempdirs", "=", "new", "HashSet", "<", "TempDir", ">", "(", ")", ";", "}", "tempdirs", ".", "add", "(", "tempDir", ")", ";", "}", "public", "Set", "<", "TempDir", ">", "getTempDirs", "(", ")", "{", "return", "tempdirs", ";", "}", "}", "</s>" ]
10,825
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "IzPackException", ";", "public", "interface", "Variables", "{", "void", "set", "(", "String", "name", ",", "String", "value", ")", ";", "String", "get", "(", "String", "name", ")", ";", "String", "get", "(", "String", "name", ",", "String", "defaultValue", ")", ";", "boolean", "getBoolean", "(", "String", "name", ")", ";", "boolean", "getBoolean", "(", "String", "name", ",", "boolean", "defaultValue", ")", ";", "int", "getInt", "(", "String", "name", ")", ";", "int", "getInt", "(", "String", "name", ",", "int", "defaultValue", ")", ";", "long", "getLong", "(", "String", "name", ")", ";", "long", "getLong", "(", "String", "name", ",", "long", "defaultValue", ")", ";", "String", "replace", "(", "String", "value", ")", ";", "void", "add", "(", "DynamicVariable", "variable", ")", ";", "void", "refresh", "(", ")", ";", "Properties", "getProperties", "(", ")", ";", "}", "</s>" ]
10,826
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "class", "PanelActionConfiguration", "implements", "Serializable", "{", "private", "String", "actionClassName", ";", "private", "Map", "<", "String", ",", "String", ">", "properties", ";", "public", "PanelActionConfiguration", "(", "String", "actionClassName", ")", "{", "this", ".", "actionClassName", "=", "actionClassName", ";", "this", ".", "properties", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "}", "public", "String", "getActionClassName", "(", ")", "{", "return", "actionClassName", ";", "}", "public", "void", "addProperty", "(", "String", "key", ",", "String", "value", ")", "{", "this", ".", "properties", ".", "put", "(", "key", ",", "value", ")", ";", "}", "public", "String", "getProperty", "(", "String", "key", ")", "{", "return", "this", ".", "properties", ".", "get", "(", "key", ")", ";", "}", "public", "String", "getProperty", "(", "String", "key", ",", "String", "defaultValue", ")", "{", "String", "result", "=", "getProperty", "(", "key", ")", ";", "if", "(", "result", "==", "null", ")", "{", "result", "=", "defaultValue", ";", "}", "return", "result", ";", "}", "public", "Map", "<", "String", ",", "String", ">", "getProperties", "(", ")", "{", "return", "properties", ";", "}", "public", "void", "setProperties", "(", "Map", "<", "String", ",", "String", ">", "properties", ")", "{", "this", ".", "properties", "=", "properties", ";", "}", "}", "</s>" ]
10,827
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "util", ".", "EnumSet", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "enum", "LookAndFeels", "{", "LIQUID", "(", "\"liquid\"", ")", ",", "LOOKS", "(", "\"looks\"", ")", ",", "SUBSTANCE", "(", "\"substance\"", ")", ",", "NIMBUS", "(", "\"nimbus\"", ")", ",", "KUNSTSTOFF", "(", "\"kunststoff\"", ")", ";", "private", "String", "name", ";", "private", "static", "Map", "<", "String", ",", "LookAndFeels", ">", "lookup", ";", "static", "{", "lookup", "=", "new", "HashMap", "<", "String", ",", "LookAndFeels", ">", "(", ")", ";", "EnumSet", "<", "LookAndFeels", ">", "enumSet", "=", "EnumSet", ".", "allOf", "(", "LookAndFeels", ".", "class", ")", ";", "for", "(", "LookAndFeels", "elem", ":", "enumSet", ")", "{", "lookup", ".", "put", "(", "elem", ".", "name", ",", "elem", ")", ";", "}", "}", "LookAndFeels", "(", "String", "name", ")", "{", "this", ".", "name", "=", "name", ";", "}", "public", "static", "LookAndFeels", "lookup", "(", "String", "laf", ")", "{", "if", "(", "lookup", ".", "containsKey", "(", "laf", ")", ")", "{", "return", "lookup", ".", "get", "(", "laf", ")", ";", "}", "return", "null", ";", "}", "}", "</s>" ]
10,828
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "TreeMap", ";", "public", "class", "GUIPrefs", "implements", "Serializable", "{", "static", "final", "long", "serialVersionUID", "=", "-", "9081878949718963824L", ";", "public", "boolean", "resizable", ";", "public", "int", "width", ";", "public", "int", "height", ";", "public", "Map", "<", "String", ",", "String", ">", "lookAndFeelMapping", "=", "new", "TreeMap", "<", "String", ",", "String", ">", "(", ")", ";", "public", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "lookAndFeelParams", "=", "new", "TreeMap", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "(", ")", ";", "public", "Map", "<", "String", ",", "String", ">", "modifier", "=", "new", "TreeMap", "<", "String", ",", "String", ">", "(", ")", ";", "}", "</s>" ]
10,829
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "installer", ".", "DataValidator", ";", "public", "interface", "DynamicInstallerRequirementValidator", "extends", "DataValidator", "{", "@", "Override", "public", "Status", "validateData", "(", "InstallData", "idata", ")", ";", "@", "Override", "public", "String", "getErrorMessageId", "(", ")", ";", "@", "Override", "public", "String", "getWarningMessageId", "(", ")", ";", "@", "Override", "public", "boolean", "getDefaultAnswer", "(", ")", ";", "}", "</s>" ]
10,830
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ".", "Action", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ".", "Help", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ".", "OsModel", ";", "public", "class", "Panel", "implements", "Serializable", "{", "static", "final", "long", "serialVersionUID", "=", "8886445274940938809L", ";", "private", "String", "className", ";", "private", "List", "<", "OsModel", ">", "osConstraints", "=", "Collections", ".", "emptyList", "(", ")", ";", "private", "String", "panelId", ";", "private", "String", "condition", ";", "private", "String", "validator", "=", "null", ";", "private", "List", "<", "Action", ">", "actions", ";", "private", "List", "<", "PanelActionConfiguration", ">", "preConstructionActions", "=", "null", ";", "private", "List", "<", "PanelActionConfiguration", ">", "preActivationActions", "=", "null", ";", "private", "List", "<", "PanelActionConfiguration", ">", "preValidationActions", "=", "null", ";", "private", "List", "<", "PanelActionConfiguration", ">", "postValidationActions", "=", "null", ";", "private", "List", "<", "Help", ">", "helps", "=", "null", ";", "private", "Map", "<", "String", ",", "String", ">", "configuration", "=", "null", ";", "public", "String", "getClassName", "(", ")", "{", "return", "this", ".", "className", ";", "}", "public", "void", "setClassName", "(", "String", "className", ")", "{", "this", ".", "className", "=", "className", ";", "}", "public", "String", "getPanelId", "(", ")", "{", "if", "(", "panelId", "==", "null", ")", "{", "panelId", "=", "\"UNKNOWN", "(\"", "+", "className", "+", "\")\"", ";", "}", "return", "panelId", ";", "}", "public", "void", "setPanelId", "(", "String", "panelId", ")", "{", "this", ".", "panelId", "=", "panelId", ";", "}", "@", "Deprecated", "public", "String", "getPanelid", "(", ")", "{", "return", "getPanelId", "(", ")", ";", "}", "@", "Deprecated", "public", "void", "setPanelid", "(", "String", "panelId", ")", "{", "setPanelId", "(", "panelId", ")", ";", "}", "public", "String", "getCondition", "(", ")", "{", "return", "this", ".", "condition", ";", "}", "public", "void", "setCondition", "(", "String", "condition", ")", "{", "this", ".", "condition", "=", "condition", ";", "}", "public", "boolean", "hasCondition", "(", ")", "{", "return", "this", ".", "condition", "!=", "null", ";", "}", "public", "String", "getValidator", "(", ")", "{", "return", "validator", ";", "}", "public", "void", "setValidator", "(", "String", "validator", ")", "{", "this", ".", "validator", "=", "validator", ";", "}", "public", "List", "<", "Help", ">", "getHelps", "(", ")", "{", "return", "helps", ";", "}", "public", "void", "setHelps", "(", "List", "<", "Help", ">", "helps", ")", "{", "this", ".", "helps", "=", "helps", ";", "}", "public", "List", "<", "PanelActionConfiguration", ">", "getPreConstructionActions", "(", ")", "{", "return", "preConstructionActions", ";", "}", "public", "void", "addPreConstructionAction", "(", "PanelActionConfiguration", "action", ")", "{", "if", "(", "this", ".", "preConstructionActions", "==", "null", ")", "{", "this", ".", "preConstructionActions", "=", "new", "ArrayList", "<", "PanelActionConfiguration", ">", "(", ")", ";", "}", "this", ".", "preConstructionActions", ".", "add", "(", "action", ")", ";", "}", "public", "List", "<", "PanelActionConfiguration", ">", "getPreActivationActions", "(", ")", "{", "return", "preActivationActions", ";", "}", "public", "void", "addPreActivationAction", "(", "PanelActionConfiguration", "action", ")", "{", "if", "(", "this", ".", "preActivationActions", "==", "null", ")", "{", "this", ".", "preActivationActions", "=", "new", "ArrayList", "<", "PanelActionConfiguration", ">", "(", ")", ";", "}", "this", ".", "preActivationActions", ".", "add", "(", "action", ")", ";", "}", "public", "List", "<", "PanelActionConfiguration", ">", "getPreValidationActions", "(", ")", "{", "return", "preValidationActions", ";", "}", "public", "void", "addPreValidationAction", "(", "PanelActionConfiguration", "action", ")", "{", "if", "(", "this", ".", "preValidationActions", "==", "null", ")", "{", "this", ".", "preValidationActions", "=", "new", "ArrayList", "<", "PanelActionConfiguration", ">", "(", ")", ";", "}", "this", ".", "preValidationActions", ".", "add", "(", "action", ")", ";", "}", "public", "List", "<", "PanelActionConfiguration", ">", "getPostValidationActions", "(", ")", "{", "return", "postValidationActions", ";", "}", "public", "void", "addPostValidationAction", "(", "PanelActionConfiguration", "action", ")", "{", "if", "(", "this", ".", "postValidationActions", "==", "null", ")", "{", "this", ".", "postValidationActions", "=", "new", "ArrayList", "<", "PanelActionConfiguration", ">", "(", ")", ";", "}", "this", ".", "postValidationActions", ".", "add", "(", "action", ")", ";", "}", "public", "boolean", "hasConfiguration", "(", ")", "{", "return", "this", ".", "configuration", "!=", "null", ";", "}", "public", "void", "addConfiguration", "(", "String", "key", ",", "String", "value", ")", "{", "if", "(", "this", ".", "configuration", "==", "null", ")", "{", "this", ".", "configuration", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "}", "this", ".", "configuration", ".", "put", "(", "key", ",", "value", ")", ";", "}", "public", "String", "getConfiguration", "(", "String", "key", ")", "{", "String", "result", "=", "null", ";", "if", "(", "this", ".", "configuration", "!=", "null", ")", "{", "result", "=", "this", ".", "configuration", ".", "get", "(", "key", ")", ";", "}", "return", "result", ";", "}", "public", "List", "<", "OsModel", ">", "getOsConstraints", "(", ")", "{", "return", "osConstraints", ";", "}", "public", "void", "setOsConstraints", "(", "List", "<", "OsModel", ">", "osConstraints", ")", "{", "this", ".", "osConstraints", "=", "osConstraints", ";", "}", "public", "String", "getHelpUrl", "(", "String", "localeISO3", ")", "{", "if", "(", "helps", "==", "null", ")", "{", "return", "null", ";", "}", "for", "(", "Help", "help", ":", "helps", ")", "{", "if", "(", "help", ".", "getIso3", "(", ")", ".", "equals", "(", "localeISO3", ")", ")", "{", "return", "help", ".", "getSrc", "(", ")", ";", "}", "}", "return", "null", ";", "}", "public", "List", "<", "Action", ">", "getActions", "(", ")", "{", "return", "actions", ";", "}", "public", "void", "setActions", "(", "List", "<", "Action", ">", "actions", ")", "{", "this", ".", "actions", "=", "actions", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "return", "\"Panel{\"", "+", "\"className='\"", "+", "className", "+", "'\\''", "+", "\"\"", "+", "osConstraints", "+", "\",", "panelid='\"", "+", "panelId", "+", "'\\''", "+", "\"\"", "+", "condition", "+", "'\\''", "+", "\",", "actions=\"", "+", "actions", "+", "\"\"", "+", "validator", "+", "'\\''", "+", "\",", "helps=\"", "+", "helps", "+", "'}'", ";", "}", "}", "</s>" ]
10,831
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "text", ".", "MessageFormat", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "TreeMap", ";", "import", "java", ".", "util", ".", "logging", ".", "Level", ";", "import", "java", ".", "util", ".", "logging", ".", "Logger", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLParser", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "XMLException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLParser", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "ResourceException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "resource", ".", "Locales", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "resource", ".", "Messages", ";", "public", "class", "LocaleDatabase", "extends", "TreeMap", "<", "String", ",", "String", ">", "implements", "Messages", "{", "@", "Deprecated", "public", "static", "final", "String", "LOCALE_DATABASE_DIRECTORY", "=", "\"/langpacks/\"", ";", "@", "Deprecated", "public", "static", "final", "String", "LOCALE_DATABASE_DEF_SUFFIX", "=", "\".xml\"", ";", "private", "static", "final", "char", "TEMP_QUOTING_CHARACTER", "=", "'-UNK-'", ";", "private", "final", "Messages", "parent", ";", "private", "final", "Locales", "locales", ";", "private", "static", "final", "Logger", "logger", "=", "Logger", ".", "getLogger", "(", "LocaleDatabase", ".", "class", ".", "getName", "(", ")", ")", ";", "public", "LocaleDatabase", "(", "InputStream", "in", ",", "Locales", "locales", ")", "{", "this", "(", "in", ",", "null", ",", "locales", ")", ";", "}", "public", "LocaleDatabase", "(", "Messages", "parent", ",", "Locales", "locales", ")", "{", "this", "(", "null", ",", "parent", ",", "locales", ")", ";", "}", "public", "LocaleDatabase", "(", "InputStream", "in", ",", "Messages", "parent", ",", "Locales", "locales", ")", "{", "this", ".", "parent", "=", "parent", ";", "this", ".", "locales", "=", "locales", ";", "if", "(", "in", "!=", "null", ")", "{", "add", "(", "in", ")", ";", "}", "}", "public", "void", "add", "(", "InputStream", "in", ")", "{", "IXMLElement", "data", ";", "try", "{", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "data", "=", "parser", ".", "parse", "(", "in", ")", ";", "}", "catch", "(", "XMLException", "exception", ")", "{", "throw", "new", "ResourceException", "(", "\"\"", ",", "exception", ")", ";", "}", "if", "(", "!", "\"langpack\"", ".", "equalsIgnoreCase", "(", "data", ".", "getElement", "(", ")", ".", "getLocalName", "(", ")", ")", ")", "{", "throw", "new", "ResourceException", "(", "\"\"", ")", ";", "}", "for", "(", "IXMLElement", "child", ":", "data", ".", "getChildren", "(", ")", ")", "{", "String", "text", "=", "child", ".", "getContent", "(", ")", ";", "if", "(", "text", "!=", "null", "&&", "!", "\"\"", ".", "equals", "(", "text", ")", ")", "{", "put", "(", "child", ".", "getAttribute", "(", "\"id\"", ")", ",", "text", ".", "trim", "(", ")", ")", ";", "}", "else", "{", "put", "(", "child", ".", "getAttribute", "(", "\"id\"", ")", ",", "child", ".", "getAttribute", "(", "\"txt\"", ")", ")", ";", "}", "}", "}", "@", "Override", "public", "String", "get", "(", "Object", "id", ")", "{", "String", "result", "=", "super", ".", "get", "(", "id", ")", ";", "return", "result", "!=", "null", "?", "result", ":", "id", ".", "toString", "(", ")", ";", "}", "@", "Override", "public", "String", "get", "(", "String", "id", ",", "Object", "...", "args", ")", "{", "String", "result", ";", "String", "pattern", "=", "super", ".", "get", "(", "id", ")", ";", "if", "(", "pattern", "!=", "null", ")", "{", "if", "(", "args", ".", "length", ">", "0", ")", "{", "try", "{", "pattern", "=", "pattern", ".", "replace", "(", "'\\''", ",", "TEMP_QUOTING_CHARACTER", ")", ";", "pattern", "=", "MessageFormat", ".", "format", "(", "pattern", ",", "args", ")", ";", "result", "=", "MessageFormat", ".", "format", "(", "pattern", ",", "args", ")", ";", "result", "=", "result", ".", "replace", "(", "TEMP_QUOTING_CHARACTER", ",", "'\\''", ")", ";", "}", "catch", "(", "IllegalArgumentException", "exception", ")", "{", "result", "=", "id", ";", "logger", ".", "log", "(", "Level", ".", "WARNING", ",", "\"\"", "+", "pattern", "+", "\",", "for", "key=\"", "+", "id", ",", "exception", ")", ";", "}", "}", "else", "{", "result", "=", "pattern", ";", "}", "}", "else", "if", "(", "parent", "!=", "null", ")", "{", "result", "=", "parent", ".", "get", "(", "id", ",", "args", ")", ";", "}", "else", "{", "result", "=", "id", ";", "}", "return", "result", ";", "}", "@", "Override", "public", "void", "add", "(", "Messages", "messages", ")", "{", "putAll", "(", "messages", ".", "getMessages", "(", ")", ")", ";", "}", "@", "Override", "public", "Map", "<", "String", ",", "String", ">", "getMessages", "(", ")", "{", "return", "Collections", ".", "unmodifiableMap", "(", "this", ")", ";", "}", "@", "Override", "public", "Messages", "newMessages", "(", "String", "name", ")", "{", "Messages", "child", "=", "locales", ".", "getMessages", "(", "name", ")", ";", "Messages", "result", "=", "new", "LocaleDatabase", "(", "this", ",", "locales", ")", ";", "result", ".", "add", "(", "child", ")", ";", "return", "result", ";", "}", "@", "Deprecated", "public", "String", "getString", "(", "String", "key", ")", "{", "String", "val", "=", "get", "(", "key", ")", ";", "if", "(", "val", "==", "null", ")", "{", "val", "=", "key", ";", "}", "return", "val", ";", "}", "public", "String", "getString", "(", "String", "key", ",", "String", "[", "]", "variables", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "variables", ".", "length", ";", "++", "i", ")", "{", "if", "(", "variables", "[", "i", "]", "==", "null", ")", "{", "variables", "[", "i", "]", "=", "\"N/A\"", ";", "}", "else", "if", "(", "variables", "[", "i", "]", ".", "startsWith", "(", "\"$\"", ")", ")", "{", "String", "curArg", "=", "variables", "[", "i", "]", ";", "if", "(", "curArg", ".", "startsWith", "(", "\"${\"", ")", ")", "{", "curArg", "=", "curArg", ".", "substring", "(", "2", ",", "curArg", ".", "length", "(", ")", "-", "1", ")", ";", "}", "else", "{", "curArg", "=", "curArg", ".", "substring", "(", "1", ")", ";", "}", "variables", "[", "i", "]", "=", "get", "(", "curArg", ")", ";", "}", "}", "String", "message", "=", "get", "(", "key", ")", ";", "message", "=", "message", ".", "replace", "(", "'\\''", ",", "TEMP_QUOTING_CHARACTER", ")", ";", "message", "=", "MessageFormat", ".", "format", "(", "message", ",", "(", "Object", "[", "]", ")", "variables", ")", ";", "return", "message", ".", "replace", "(", "TEMP_QUOTING_CHARACTER", ",", "'\\''", ")", ";", "}", "}", "</s>" ]
10,832
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ".", "OsModel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "FileUtil", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "class", "PackFile", "implements", "Serializable", "{", "static", "final", "long", "serialVersionUID", "=", "-", "834377078706854909L", ";", "public", "transient", "String", "sourcePath", "=", "null", ";", "protected", "String", "relativePath", "=", "null", ";", "private", "String", "targetPath", "=", "null", ";", "private", "List", "<", "OsModel", ">", "osConstraints", "=", "null", ";", "private", "long", "length", "=", "0", ";", "private", "transient", "long", "size", "=", "0", ";", "private", "long", "mtime", "=", "-", "1", ";", "private", "boolean", "isDirectory", "=", "false", ";", "private", "OverrideType", "override", ";", "private", "String", "overrideRenameTo", ";", "private", "Blockable", "blockable", "=", "Blockable", ".", "BLOCKABLE_NONE", ";", "private", "Map", "additionals", "=", "null", ";", "public", "String", "previousPackId", "=", "null", ";", "public", "long", "offsetInPreviousPack", "=", "-", "1", ";", "private", "boolean", "pack200Jar", "=", "false", ";", "private", "String", "condition", "=", "null", ";", "public", "PackFile", "(", "File", "baseDir", ",", "File", "src", ",", "String", "target", ",", "List", "<", "OsModel", ">", "osList", ",", "OverrideType", "override", ",", "String", "overrideRenameTo", ",", "Blockable", "blockable", ")", "throws", "IOException", "{", "this", "(", "src", ",", "FileUtil", ".", "getRelativeFileName", "(", "src", ",", "baseDir", ")", ",", "target", ",", "osList", ",", "override", ",", "overrideRenameTo", ",", "blockable", ",", "null", ")", ";", "}", "public", "PackFile", "(", "File", "src", ",", "String", "relativeSourcePath", ",", "String", "target", ",", "List", "<", "OsModel", ">", "osList", ",", "OverrideType", "override", ",", "String", "overrideRenameTo", ",", "Blockable", "blockable", ",", "Map", "additionals", ")", "throws", "FileNotFoundException", "{", "if", "(", "!", "src", ".", "exists", "(", ")", ")", "{", "throw", "new", "FileNotFoundException", "(", "\"\"", "+", "src", ")", ";", "}", "if", "(", "'/'", "!=", "File", ".", "separatorChar", ")", "{", "target", "=", "target", ".", "replace", "(", "File", ".", "separatorChar", ",", "'/'", ")", ";", "}", "if", "(", "target", ".", "endsWith", "(", "\"/\"", ")", ")", "{", "target", "=", "target", ".", "substring", "(", "0", ",", "target", ".", "length", "(", ")", "-", "1", ")", ";", "}", "this", ".", "sourcePath", "=", "src", ".", "getPath", "(", ")", ".", "replace", "(", "File", ".", "separatorChar", ",", "'/'", ")", ";", "this", ".", "relativePath", "=", "(", "relativeSourcePath", "!=", "null", ")", "?", "relativeSourcePath", ".", "replace", "(", "File", ".", "separatorChar", ",", "'/'", ")", ":", "relativeSourcePath", ";", "this", ".", "targetPath", "=", "(", "target", "!=", "null", ")", "?", "target", ".", "replace", "(", "File", ".", "separatorChar", ",", "'/'", ")", ":", "target", ";", "this", ".", "osConstraints", "=", "osList", ";", "this", ".", "override", "=", "override", ";", "this", ".", "overrideRenameTo", "=", "overrideRenameTo", ";", "this", ".", "blockable", "=", "blockable", ";", "this", ".", "length", "=", "src", ".", "length", "(", ")", ";", "this", ".", "size", "=", "this", ".", "length", ";", "this", ".", "mtime", "=", "src", ".", "lastModified", "(", ")", ";", "this", ".", "isDirectory", "=", "src", ".", "isDirectory", "(", ")", ";", "this", ".", "additionals", "=", "additionals", ";", "if", "(", "isDirectory", ")", "{", "length", "=", "0", ";", "}", "}", "public", "PackFile", "(", "File", "baseDir", ",", "File", "src", ",", "String", "target", ",", "List", "<", "OsModel", ">", "osList", ",", "OverrideType", "override", ",", "String", "overrideRenameTo", ",", "Blockable", "blockable", ",", "Map", "additionals", ")", "throws", "IOException", "{", "this", "(", "src", ",", "FileUtil", ".", "getRelativeFileName", "(", "src", ",", "baseDir", ")", ",", "target", ",", "osList", ",", "override", ",", "overrideRenameTo", ",", "blockable", ",", "additionals", ")", ";", "}", "public", "void", "setPreviousPackFileRef", "(", "String", "previousPackId", ",", "Long", "offsetInPreviousPack", ")", "{", "this", ".", "previousPackId", "=", "previousPackId", ";", "this", ".", "offsetInPreviousPack", "=", "offsetInPreviousPack", ";", "}", "public", "final", "List", "<", "OsModel", ">", "osConstraints", "(", ")", "{", "return", "osConstraints", ";", "}", "public", "final", "long", "length", "(", ")", "{", "return", "length", ";", "}", "public", "final", "long", "size", "(", ")", "{", "return", "size", ";", "}", "public", "final", "long", "lastModified", "(", ")", "{", "return", "mtime", ";", "}", "public", "final", "OverrideType", "override", "(", ")", "{", "return", "override", ";", "}", "public", "final", "String", "overrideRenameTo", "(", ")", "{", "return", "overrideRenameTo", ";", "}", "public", "final", "Blockable", "blockable", "(", ")", "{", "return", "blockable", ";", "}", "public", "final", "boolean", "isDirectory", "(", ")", "{", "return", "isDirectory", ";", "}", "public", "final", "boolean", "isBackReference", "(", ")", "{", "return", "(", "previousPackId", "!=", "null", ")", ";", "}", "public", "final", "String", "getTargetPath", "(", ")", "{", "return", "targetPath", ";", "}", "public", "String", "getRelativeSourcePath", "(", ")", "{", "return", "relativePath", ";", "}", "public", "Map", "getAdditionals", "(", ")", "{", "return", "additionals", ";", "}", "public", "String", "getCondition", "(", ")", "{", "return", "this", ".", "condition", ";", "}", "public", "void", "setCondition", "(", "String", "condition", ")", "{", "this", ".", "condition", "=", "condition", ";", "}", "public", "boolean", "hasCondition", "(", ")", "{", "return", "this", ".", "condition", "!=", "null", ";", "}", "public", "boolean", "isPack200Jar", "(", ")", "{", "return", "pack200Jar", ";", "}", "public", "void", "setPack200Jar", "(", "boolean", "pack200Jar", ")", "{", "this", ".", "pack200Jar", "=", "pack200Jar", ";", "}", "public", "void", "setLoosePackInfo", "(", "boolean", "loose", ")", "{", "if", "(", "loose", ")", "{", "length", "=", "0", ";", "}", "}", "}", "</s>" ]
10,833
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ";", "public", "enum", "Stage", "{", "install", ",", "uninstall", ",", "compiler", ";", "public", "static", "boolean", "isInInstaller", "(", "Stage", "stage", ")", "{", "return", "uninstall", ".", "equals", "(", "stage", ")", "||", "install", ".", "equals", "(", "stage", ")", ";", "}", "}", "</s>" ]
10,834
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ";", "import", "java", ".", "io", ".", "Serializable", ";", "public", "class", "Action", "implements", "Serializable", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1L", ";", "private", "String", "classname", ";", "private", "ActionStage", "actionStage", ";", "public", "Action", "(", "String", "classname", ",", "ActionStage", "actionStage", ")", "{", "this", ".", "classname", "=", "classname", ";", "this", ".", "actionStage", "=", "actionStage", ";", "}", "public", "String", "getClassname", "(", ")", "{", "return", "classname", ";", "}", "public", "ActionStage", "getActionStage", "(", ")", "{", "return", "actionStage", ";", "}", "}", "</s>" ]
10,835
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ";", "public", "enum", "ActionStage", "{", "PRECONSTRUCT", ",", "PREACTIVATE", ",", "PREVALIDATE", ",", "POSTVALIDATE", "}", "</s>" ]
10,836
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "public", "class", "IzpackProjectInstaller", "implements", "Serializable", "{", "private", "List", "<", "Listener", ">", "listeners", "=", "new", "ArrayList", "<", "Listener", ">", "(", ")", ";", "private", "List", "<", "Panel", ">", "panels", ";", "public", "void", "add", "(", "Listener", "listener", ")", "{", "this", ".", "listeners", ".", "add", "(", "listener", ")", ";", "}", "public", "List", "<", "Listener", ">", "getListeners", "(", ")", "{", "return", "listeners", ";", "}", "public", "List", "<", "Panel", ">", "getPanels", "(", ")", "{", "return", "panels", ";", "}", "public", "void", "fillWithDefault", "(", ")", "{", "if", "(", "listeners", "==", "null", ")", "{", "listeners", "=", "Collections", ".", "emptyList", "(", ")", ";", "}", "}", "}", "</s>" ]
10,837
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "Listener", "implements", "Serializable", "{", "private", "String", "classname", ";", "private", "Stage", "stage", ";", "private", "List", "<", "OsModel", ">", "os", ";", "private", "String", "jar", ";", "private", "List", "<", "String", ">", "files", ";", "public", "Listener", "(", "String", "classname", ",", "Stage", "stage", ",", "List", "<", "OsModel", ">", "os", ",", "String", "jar", ")", "{", "this", ".", "classname", "=", "classname", ";", "this", ".", "stage", "=", "stage", ";", "this", ".", "os", "=", "os", ";", "this", ".", "jar", "=", "jar", ";", "files", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "}", "public", "String", "getClassname", "(", ")", "{", "return", "classname", ";", "}", "public", "String", "getJar", "(", ")", "{", "return", "jar", ";", "}", "public", "Stage", "getStage", "(", ")", "{", "return", "stage", ";", "}", "public", "List", "<", "OsModel", ">", "getOs", "(", ")", "{", "return", "os", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "return", "\"Listener{\"", "+", "\"classname='\"", "+", "classname", "+", "'\\''", "+", "\",", "stage=\"", "+", "stage", "+", "\",", "os=\"", "+", "os", "+", "'}'", ";", "}", "public", "List", "<", "String", ">", "getFiles", "(", ")", "{", "return", "files", ";", "}", "public", "void", "setFiles", "(", "List", "<", "String", ">", "files", ")", "{", "this", ".", "files", "=", "files", ";", "}", "}", "</s>" ]
10,838
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ";", "import", "java", ".", "io", ".", "Serializable", ";", "public", "class", "Help", "implements", "Serializable", "{", "private", "static", "final", "long", "serialVersionUID", "=", "-", "2560125306490380153L", ";", "private", "String", "iso3", ";", "private", "String", "src", ";", "public", "Help", "(", "String", "iso3", ",", "String", "src", ")", "{", "this", ".", "iso3", "=", "iso3", ";", "this", ".", "src", "=", "src", ";", "}", "public", "String", "getIso3", "(", ")", "{", "return", "iso3", ";", "}", "public", "void", "setIso3", "(", "String", "iso3", ")", "{", "this", ".", "iso3", "=", "iso3", ";", "}", "public", "String", "getSrc", "(", ")", "{", "return", "src", ";", "}", "public", "void", "setSrc", "(", "String", "src", ")", "{", "this", ".", "src", "=", "src", ";", "}", "}", "</s>" ]
10,839
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ";", "import", "java", ".", "io", ".", "Serializable", ";", "public", "class", "OsModel", "implements", "Serializable", "{", "private", "final", "String", "arch", ";", "private", "final", "String", "family", ";", "private", "final", "String", "jre", ";", "private", "final", "String", "name", ";", "private", "final", "String", "version", ";", "public", "OsModel", "(", "String", "arch", ",", "String", "family", ",", "String", "jre", ",", "String", "name", ",", "String", "version", ")", "{", "this", ".", "arch", "=", "arch", ";", "this", ".", "family", "=", "family", ";", "this", ".", "jre", "=", "jre", ";", "this", ".", "name", "=", "name", ";", "this", ".", "version", "=", "version", ";", "}", "public", "String", "getArch", "(", ")", "{", "return", "arch", ";", "}", "public", "String", "getFamily", "(", ")", "{", "return", "family", ";", "}", "public", "String", "getJre", "(", ")", "{", "return", "jre", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "String", "getVersion", "(", ")", "{", "return", "version", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "return", "\"OsModel{\"", "+", "\"arch='\"", "+", "arch", "+", "'\\''", "+", "\",", "family='\"", "+", "family", "+", "'\\''", "+", "\",", "jre='\"", "+", "jre", "+", "'\\''", "+", "\",", "name='\"", "+", "name", "+", "'\\''", "+", "\",", "version='\"", "+", "version", "+", "'\\''", "+", "'}'", ";", "}", "}", "</s>" ]
10,840
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "public", "class", "ScriptParserConstant", "{", "public", "static", "final", "String", "JAVA_HOME", "=", "\"JAVA_HOME\"", ";", "public", "static", "final", "String", "CLASS_PATH", "=", "\"CLASS_PATH\"", ";", "public", "static", "final", "String", "USER_HOME", "=", "\"USER_HOME\"", ";", "public", "static", "final", "String", "USER_NAME", "=", "\"USER_NAME\"", ";", "public", "static", "final", "String", "HOST_NAME", "=", "\"HOST_NAME\"", ";", "public", "static", "final", "String", "IP_ADDRESS", "=", "\"IP_ADDRESS\"", ";", "public", "static", "final", "String", "FILE_SEPARATOR", "=", "\"\"", ";", "public", "static", "final", "String", "APP_NAME", "=", "\"APP_NAME\"", ";", "public", "static", "final", "String", "APP_URL", "=", "\"APP_URL\"", ";", "public", "static", "final", "String", "APP_VER", "=", "\"APP_VER\"", ";", "public", "static", "final", "String", "ISO3_LANG", "=", "\"ISO3_LANG\"", ";", "public", "static", "final", "String", "LOCALE", "=", "\"\"", ";", "}", "</s>" ]
10,841
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "List", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ".", "OsModel", ";", "public", "class", "XPackFile", "extends", "PackFile", "implements", "Comparable", "<", "XPackFile", ">", "{", "private", "static", "final", "long", "serialVersionUID", "=", "5875050264763504283L", ";", "private", "long", "position", ";", "public", "XPackFile", "(", "File", "baseDir", ",", "File", "src", ",", "String", "target", ",", "List", "<", "OsModel", ">", "osList", ",", "OverrideType", "override", ",", "String", "overrideRenameTo", ",", "Blockable", "blockable", ")", "throws", "IOException", "{", "super", "(", "baseDir", ",", "src", ",", "target", ",", "osList", ",", "override", ",", "overrideRenameTo", ",", "blockable", ")", ";", "this", ".", "position", "=", "0", ";", "}", "public", "XPackFile", "(", "PackFile", "file", ")", "throws", "FileNotFoundException", "{", "super", "(", "new", "File", "(", "file", ".", "sourcePath", ")", ",", "file", ".", "relativePath", ",", "file", ".", "getTargetPath", "(", ")", ",", "file", ".", "osConstraints", "(", ")", ",", "file", ".", "override", "(", ")", ",", "file", ".", "overrideRenameTo", "(", ")", ",", "file", ".", "blockable", "(", ")", ",", "file", ".", "getAdditionals", "(", ")", ")", ";", "this", ".", "position", "=", "0", ";", "this", ".", "setCondition", "(", "file", ".", "getCondition", "(", ")", ")", ";", "}", "public", "long", "getArchiveFilePosition", "(", ")", "{", "return", "position", ";", "}", "public", "void", "setArchiveFilePosition", "(", "long", "position", ")", "{", "this", ".", "position", "=", "position", ";", "}", "public", "int", "compareTo", "(", "XPackFile", "arg0", ")", "{", "return", "this", ".", "getTargetPath", "(", ")", ".", "compareTo", "(", "arg0", ".", "getTargetPath", "(", ")", ")", ";", "}", "}", "</s>" ]
10,842
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Locale", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "MissingResourceException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLElementImpl", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "event", ".", "InstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "resource", ".", "Messages", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "rules", ".", "RulesEngine", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Platform", ";", "public", "class", "AutomatedInstallData", "implements", "InstallData", "{", "private", "RulesEngine", "rules", ";", "private", "Locale", "locale", ";", "private", "Messages", "messages", ";", "private", "Info", "info", ";", "private", "Platform", "platform", ";", "private", "List", "<", "Pack", ">", "allPacks", ";", "private", "List", "<", "Pack", ">", "availablePacks", ";", "private", "List", "<", "Pack", ">", "selectedPacks", ";", "private", "List", "<", "Panel", ">", "panelsOrder", ";", "private", "int", "curPanelNumber", ";", "private", "boolean", "canClose", "=", "false", ";", "private", "boolean", "installSuccess", "=", "true", ";", "private", "boolean", "rebootNecessary", "=", "false", ";", "private", "IXMLElement", "xmlData", ";", "private", "Map", "<", "String", ",", "List", ">", "customData", "=", "new", "HashMap", "<", "String", ",", "List", ">", "(", ")", ";", "private", "final", "Variables", "variables", ";", "private", "Map", "<", "String", ",", "List", "<", "DynamicVariable", ">", ">", "dynamicvariables", ";", "private", "List", "<", "DynamicInstallerRequirementValidator", ">", "dynamicinstallerrequirements", ";", "private", "List", "<", "InstallerRequirement", ">", "installerrequirements", ";", "private", "Map", "<", "String", ",", "Object", ">", "attributes", ";", "public", "final", "static", "String", "DEFAULT_INSTALL_PATH", "=", "\"\"", ";", "public", "final", "static", "String", "INSTALL_DRIVE", "=", "\"\"", ";", "public", "final", "static", "String", "DEFAULT_INSTALL_DRIVE", "=", "\"\"", ";", "private", "List", "<", "InstallerListener", ">", "installerListener", "=", "new", "ArrayList", "<", "InstallerListener", ">", "(", ")", ";", "public", "AutomatedInstallData", "(", "Variables", "variables", ",", "Platform", "platform", ")", "{", "this", ".", "variables", "=", "variables", ";", "this", ".", "platform", "=", "platform", ";", "setAvailablePacks", "(", "new", "ArrayList", "<", "Pack", ">", "(", ")", ")", ";", "setSelectedPacks", "(", "new", "ArrayList", "<", "Pack", ">", "(", ")", ")", ";", "setPanelsOrder", "(", "new", "ArrayList", "<", "Panel", ">", "(", ")", ")", ";", "setXmlData", "(", "new", "XMLElementImpl", "(", "\"\"", ")", ")", ";", "setAttributes", "(", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ")", ";", "}", "@", "Override", "public", "Variables", "getVariables", "(", ")", "{", "return", "variables", ";", "}", "@", "Override", "public", "void", "setVariable", "(", "String", "name", ",", "String", "value", ")", "{", "variables", ".", "set", "(", "name", ",", "value", ")", ";", "}", "@", "Override", "public", "String", "getVariable", "(", "String", "name", ")", "{", "return", "variables", ".", "get", "(", "name", ")", ";", "}", "@", "Override", "public", "void", "refreshVariables", "(", ")", "{", "variables", ".", "refresh", "(", ")", ";", "}", "@", "Override", "public", "void", "setInstallPath", "(", "String", "path", ")", "{", "setVariable", "(", "INSTALL_PATH", ",", "path", ")", ";", "}", "@", "Override", "public", "String", "getInstallPath", "(", ")", "{", "return", "getVariable", "(", "INSTALL_PATH", ")", ";", "}", "@", "Override", "public", "void", "setDefaultInstallPath", "(", "String", "path", ")", "{", "setVariable", "(", "DEFAULT_INSTALL_PATH", ",", "path", ")", ";", "}", "@", "Override", "public", "String", "getDefaultInstallPath", "(", ")", "{", "return", "getVariable", "(", "DEFAULT_INSTALL_PATH", ")", ";", "}", "@", "Override", "public", "void", "setMediaPath", "(", "String", "path", ")", "{", "setVariable", "(", "MEDIA_PATH", ",", "path", ")", ";", "}", "@", "Override", "public", "String", "getMediaPath", "(", ")", "{", "return", "getVariable", "(", "MEDIA_PATH", ")", ";", "}", "@", "Override", "public", "Object", "getAttribute", "(", "String", "name", ")", "{", "return", "getAttributes", "(", ")", ".", "get", "(", "name", ")", ";", "}", "@", "Override", "public", "void", "setAttribute", "(", "String", "name", ",", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "getAttributes", "(", ")", ".", "remove", "(", "name", ")", ";", "}", "else", "{", "getAttributes", "(", ")", ".", "put", "(", "name", ",", "value", ")", ";", "}", "}", "@", "Deprecated", "public", "void", "setAndProcessLocal", "(", "String", "locale", ",", "LocaleDatabase", "localeDatabase", ")", "{", "getXmlData", "(", ")", ".", "setAttribute", "(", "\"langpack\"", ",", "locale", ")", ";", "setVariable", "(", "ScriptParserConstant", ".", "ISO3_LANG", ",", "getLocaleISO3", "(", ")", ")", ";", "setMessages", "(", "localeDatabase", ")", ";", "}", "@", "Override", "public", "RulesEngine", "getRules", "(", ")", "{", "return", "rules", ";", "}", "public", "void", "setRules", "(", "RulesEngine", "rules", ")", "{", "this", ".", "rules", "=", "rules", ";", "}", "@", "Override", "public", "String", "getLocaleISO3", "(", ")", "{", "String", "result", "=", "null", ";", "try", "{", "if", "(", "locale", "!=", "null", ")", "{", "result", "=", "locale", ".", "getISO3Language", "(", ")", ";", "}", "}", "catch", "(", "MissingResourceException", "exception", ")", "{", "}", "return", "result", ";", "}", "@", "Deprecated", "public", "void", "setLocaleISO3", "(", "String", "localeISO3", ")", "{", "}", "@", "Override", "public", "Locale", "getLocale", "(", ")", "{", "return", "locale", ";", "}", "public", "void", "setLocale", "(", "Locale", "locale", ")", "{", "this", ".", "locale", "=", "locale", ";", "String", "code", "=", "locale", ".", "getISO3Language", "(", ")", ";", "getXmlData", "(", ")", ".", "setAttribute", "(", "\"langpack\"", ",", "code", ")", ";", "setVariable", "(", "ScriptParserConstant", ".", "ISO3_LANG", ",", "code", ")", ";", "}", "public", "void", "setMessages", "(", "Messages", "messages", ")", "{", "this", ".", "messages", "=", "messages", ";", "}", "@", "Override", "public", "Messages", "getMessages", "(", ")", "{", "return", "messages", ";", "}", "@", "Deprecated", "public", "LocaleDatabase", "getLangpack", "(", ")", "{", "return", "(", "LocaleDatabase", ")", "messages", ";", "}", "@", "Deprecated", "public", "void", "setLangpack", "(", "LocaleDatabase", "langpack", ")", "{", "setMessages", "(", "langpack", ")", ";", "}", "@", "Override", "public", "Info", "getInfo", "(", ")", "{", "return", "info", ";", "}", "public", "void", "setInfo", "(", "Info", "info", ")", "{", "this", ".", "info", "=", "info", ";", "}", "@", "Override", "public", "Platform", "getPlatform", "(", ")", "{", "return", "platform", ";", "}", "@", "Override", "public", "List", "<", "Pack", ">", "getAllPacks", "(", ")", "{", "return", "allPacks", ";", "}", "public", "void", "setAllPacks", "(", "List", "<", "Pack", ">", "allPacks", ")", "{", "this", ".", "allPacks", "=", "allPacks", ";", "}", "@", "Override", "public", "List", "<", "Pack", ">", "getAvailablePacks", "(", ")", "{", "return", "availablePacks", ";", "}", "public", "void", "setAvailablePacks", "(", "List", "<", "Pack", ">", "availablePacks", ")", "{", "this", ".", "availablePacks", "=", "availablePacks", ";", "}", "@", "Override", "public", "List", "<", "Pack", ">", "getSelectedPacks", "(", ")", "{", "return", "selectedPacks", ";", "}", "@", "Override", "public", "void", "setSelectedPacks", "(", "List", "<", "Pack", ">", "selectedPacks", ")", "{", "this", ".", "selectedPacks", "=", "selectedPacks", ";", "}", "@", "Override", "public", "List", "<", "Panel", ">", "getPanelsOrder", "(", ")", "{", "return", "panelsOrder", ";", "}", "public", "void", "setPanelsOrder", "(", "List", "<", "Panel", ">", "panelsOrder", ")", "{", "this", ".", "panelsOrder", "=", "panelsOrder", ";", "}", "@", "Deprecated", "public", "int", "getCurPanelNumber", "(", ")", "{", "return", "curPanelNumber", ";", "}", "@", "Deprecated", "public", "void", "setCurPanelNumber", "(", "int", "curPanelNumber", ")", "{", "this", ".", "curPanelNumber", "=", "curPanelNumber", ";", "}", "@", "Override", "public", "boolean", "isCanClose", "(", ")", "{", "return", "canClose", ";", "}", "public", "void", "setCanClose", "(", "boolean", "canClose", ")", "{", "this", ".", "canClose", "=", "canClose", ";", "}", "@", "Override", "public", "boolean", "isInstallSuccess", "(", ")", "{", "return", "installSuccess", ";", "}", "@", "Override", "public", "void", "setInstallSuccess", "(", "boolean", "installSuccess", ")", "{", "this", ".", "installSuccess", "=", "installSuccess", ";", "}", "@", "Override", "public", "boolean", "isRebootNecessary", "(", ")", "{", "return", "rebootNecessary", ";", "}", "@", "Override", "public", "void", "setRebootNecessary", "(", "boolean", "rebootNecessary", ")", "{", "this", ".", "rebootNecessary", "=", "rebootNecessary", ";", "}", "@", "Override", "public", "IXMLElement", "getXmlData", "(", ")", "{", "return", "xmlData", ";", "}", "public", "void", "setXmlData", "(", "IXMLElement", "xmlData", ")", "{", "this", ".", "xmlData", "=", "xmlData", ";", "}", "@", "Deprecated", "public", "Map", "<", "String", ",", "List", ">", "getCustomData", "(", ")", "{", "return", "customData", ";", "}", "@", "Deprecated", "public", "void", "setCustomData", "(", "Map", "<", "String", ",", "List", ">", "customData", ")", "{", "this", ".", "customData", "=", "customData", ";", "}", "@", "Deprecated", "public", "void", "setVariables", "(", "Variables", "variables", ")", "{", "}", "public", "Map", "<", "String", ",", "Object", ">", "getAttributes", "(", ")", "{", "return", "attributes", ";", "}", "public", "void", "setAttributes", "(", "Map", "<", "String", ",", "Object", ">", "attributes", ")", "{", "this", ".", "attributes", "=", "attributes", ";", "}", "@", "Deprecated", "public", "Map", "<", "String", ",", "List", "<", "DynamicVariable", ">", ">", "getDynamicvariables", "(", ")", "{", "return", "this", ".", "dynamicvariables", ";", "}", "@", "Deprecated", "public", "void", "setDynamicvariables", "(", "Map", "<", "String", ",", "List", "<", "DynamicVariable", ">", ">", "dynamicvariables", ")", "{", "this", ".", "dynamicvariables", "=", "dynamicvariables", ";", "}", "public", "List", "<", "DynamicInstallerRequirementValidator", ">", "getDynamicInstallerRequirements", "(", ")", "{", "return", "this", ".", "dynamicinstallerrequirements", ";", "}", "@", "Deprecated", "public", "List", "<", "DynamicInstallerRequirementValidator", ">", "getDynamicinstallerrequirements", "(", ")", "{", "return", "getDynamicInstallerRequirements", "(", ")", ";", "}", "public", "void", "setDynamicInstallerRequirements", "(", "List", "<", "DynamicInstallerRequirementValidator", ">", "requirements", ")", "{", "this", ".", "dynamicinstallerrequirements", "=", "requirements", ";", "}", "public", "void", "setInstallerRequirements", "(", "List", "<", "InstallerRequirement", ">", "requirements", ")", "{", "this", ".", "installerrequirements", "=", "requirements", ";", "}", "@", "Override", "public", "List", "<", "InstallerRequirement", ">", "getInstallerRequirements", "(", ")", "{", "return", "installerrequirements", ";", "}", "@", "Deprecated", "public", "List", "<", "InstallerRequirement", ">", "getInstallerrequirements", "(", ")", "{", "return", "getInstallerRequirements", "(", ")", ";", "}", "@", "Deprecated", "public", "List", "<", "InstallerListener", ">", "getInstallerListener", "(", ")", "{", "return", "installerListener", ";", "}", "@", "Deprecated", "public", "void", "setInstallerListener", "(", "List", "<", "InstallerListener", ">", "installerListener", ")", "{", "this", ".", "installerListener", "=", "installerListener", ";", "}", "}", "</s>" ]
10,843
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "List", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "substitutor", ".", "VariableSubstitutor", ";", "public", "interface", "DynamicVariable", "extends", "Serializable", "{", "String", "getName", "(", ")", ";", "void", "setName", "(", "String", "name", ")", ";", "Value", "getValue", "(", ")", ";", "void", "setValue", "(", "Value", "value", ")", ";", "String", "getConditionid", "(", ")", ";", "void", "setConditionid", "(", "String", "conditionid", ")", ";", "void", "validate", "(", ")", "throws", "Exception", ";", "String", "evaluate", "(", "VariableSubstitutor", "...", "substitutors", ")", "throws", "Exception", ";", "void", "setCheckonce", "(", "boolean", "checkonce", ")", ";", "void", "setIgnoreFailure", "(", "boolean", "ignore", ")", ";", "void", "addFilter", "(", "ValueFilter", "filter", ")", ";", "List", "<", "ValueFilter", ">", "getFilters", "(", ")", ";", "}", "</s>" ]
10,844
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "Serializable", ";", "public", "class", "InstallerRequirement", "implements", "Serializable", "{", "private", "static", "final", "long", "serialVersionUID", "=", "2567455022706542974L", ";", "private", "String", "condition", ";", "private", "String", "message", ";", "public", "String", "getCondition", "(", ")", "{", "return", "condition", ";", "}", "public", "void", "setCondition", "(", "String", "condition", ")", "{", "this", ".", "condition", "=", "condition", ";", "}", "public", "String", "getMessage", "(", ")", "{", "return", "message", ";", "}", "public", "void", "setMessage", "(", "String", "message", ")", "{", "this", ".", "message", "=", "message", ";", "}", "}", "</s>" ]
10,845
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "text", ".", "DecimalFormat", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ".", "OsModel", ";", "public", "class", "Pack", "implements", "Serializable", "{", "private", "String", "name", ";", "private", "String", "langPackId", ";", "private", "boolean", "loose", ";", "private", "boolean", "uninstall", ";", "private", "Set", "<", "String", ">", "installGroups", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "private", "String", "excludeGroup", "=", "\"\"", ";", "private", "String", "group", ";", "private", "String", "description", ";", "private", "List", "<", "OsModel", ">", "osConstraints", ";", "private", "String", "condition", ";", "private", "List", "<", "String", ">", "dependencies", ";", "private", "List", "<", "String", ">", "dependants", ";", "private", "boolean", "required", ";", "private", "long", "size", ";", "private", "long", "fileSize", ";", "private", "boolean", "preselected", ";", "private", "String", "parent", ";", "private", "String", "imageId", ";", "private", "List", "<", "String", ">", "validators", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "private", "boolean", "hidden", ";", "private", "final", "static", "double", "KILOBYTES", "=", "1024.0", ";", "private", "final", "static", "double", "MEGABYTES", "=", "1024.0", "*", "1024.0", ";", "private", "final", "static", "double", "GIGABYTES", "=", "1024.0", "*", "1024.0", "*", "1024.0", ";", "private", "final", "static", "DecimalFormat", "formatter", "=", "new", "DecimalFormat", "(", "\"#,###.##\"", ")", ";", "public", "Pack", "(", "String", "name", ",", "String", "langPackId", ",", "String", "description", ",", "List", "<", "OsModel", ">", "osConstraints", ",", "List", "<", "String", ">", "dependencies", ",", "boolean", "required", ",", "boolean", "preselected", ",", "boolean", "loose", ",", "String", "excludeGroup", ",", "boolean", "uninstall", ",", "long", "size", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "langPackId", "=", "langPackId", ";", "this", ".", "description", "=", "description", ";", "this", ".", "osConstraints", "=", "osConstraints", ";", "this", ".", "dependencies", "=", "dependencies", ";", "this", ".", "required", "=", "required", ";", "this", ".", "preselected", "=", "preselected", ";", "this", ".", "loose", "=", "loose", ";", "this", ".", "excludeGroup", "=", "excludeGroup", ";", "this", ".", "uninstall", "=", "uninstall", ";", "this", ".", "size", "=", "size", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "void", "setLangPackId", "(", "String", "langPackId", ")", "{", "this", ".", "langPackId", "=", "langPackId", ";", "}", "public", "String", "getLangPackId", "(", ")", "{", "return", "langPackId", ";", "}", "public", "String", "getDescription", "(", ")", "{", "return", "description", ";", "}", "public", "void", "setOsConstraints", "(", "List", "<", "OsModel", ">", "platforms", ")", "{", "osConstraints", "=", "platforms", ";", "}", "public", "List", "<", "OsModel", ">", "getOsConstraints", "(", ")", "{", "return", "osConstraints", ";", "}", "public", "void", "setDependencies", "(", "List", "<", "String", ">", "dependencies", ")", "{", "this", ".", "dependencies", "=", "dependencies", ";", "}", "public", "List", "<", "String", ">", "getDependencies", "(", ")", "{", "return", "dependencies", ";", "}", "public", "void", "addDependency", "(", "String", "name", ")", "{", "if", "(", "dependencies", "==", "null", ")", "{", "dependencies", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "}", "dependencies", ".", "add", "(", "name", ")", ";", "}", "public", "void", "setDependants", "(", "List", "<", "String", ">", "dependants", ")", "{", "this", ".", "dependants", "=", "dependants", ";", "}", "public", "List", "<", "String", ">", "getDependants", "(", ")", "{", "return", "dependants", ";", "}", "public", "void", "addDependant", "(", "String", "name", ")", "{", "if", "(", "dependants", "==", "null", ")", "{", "dependants", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "}", "dependants", ".", "add", "(", "name", ")", ";", "}", "public", "boolean", "isRequired", "(", ")", "{", "return", "required", ";", "}", "public", "void", "setPreselected", "(", "boolean", "preselected", ")", "{", "this", ".", "preselected", "=", "preselected", ";", "}", "public", "boolean", "isPreselected", "(", ")", "{", "return", "preselected", ";", "}", "public", "void", "setLoose", "(", "boolean", "loose", ")", "{", "this", ".", "loose", "=", "loose", ";", "}", "public", "boolean", "isLoose", "(", ")", "{", "return", "loose", ";", "}", "public", "void", "setExcludeGroup", "(", "String", "group", ")", "{", "excludeGroup", "=", "group", ";", "}", "public", "String", "getExcludeGroup", "(", ")", "{", "return", "excludeGroup", ";", "}", "public", "boolean", "isUninstall", "(", ")", "{", "return", "uninstall", ";", "}", "public", "Set", "<", "String", ">", "getInstallGroups", "(", ")", "{", "return", "installGroups", ";", "}", "public", "void", "setGroup", "(", "String", "group", ")", "{", "this", ".", "group", "=", "group", ";", "}", "public", "String", "getGroup", "(", ")", "{", "return", "group", ";", "}", "public", "void", "setSize", "(", "long", "size", ")", "{", "this", ".", "size", "=", "size", ";", "}", "public", "long", "getSize", "(", ")", "{", "return", "size", ";", "}", "public", "void", "setFileSize", "(", "long", "size", ")", "{", "fileSize", "=", "size", ";", "}", "public", "void", "addFileSize", "(", "long", "add", ")", "{", "fileSize", "+=", "add", ";", "}", "public", "long", "getFileSize", "(", ")", "{", "return", "fileSize", ";", "}", "public", "void", "setParent", "(", "String", "parent", ")", "{", "this", ".", "parent", "=", "parent", ";", "}", "public", "String", "getParent", "(", ")", "{", "return", "parent", ";", "}", "public", "void", "setImageId", "(", "String", "imageId", ")", "{", "this", ".", "imageId", "=", "imageId", ";", "}", "public", "String", "getImageId", "(", ")", "{", "return", "imageId", ";", "}", "public", "void", "setCondition", "(", "String", "condition", ")", "{", "this", ".", "condition", "=", "condition", ";", "}", "public", "String", "getCondition", "(", ")", "{", "return", "this", ".", "condition", ";", "}", "public", "boolean", "hasCondition", "(", ")", "{", "return", "condition", "!=", "null", ";", "}", "public", "void", "addValidator", "(", "String", "validatorClassName", ")", "{", "validators", ".", "add", "(", "validatorClassName", ")", ";", "}", "public", "List", "<", "String", ">", "getValidators", "(", ")", "{", "return", "validators", ";", "}", "public", "void", "setHidden", "(", "boolean", "hidden", ")", "{", "this", ".", "hidden", "=", "hidden", ";", "}", "public", "boolean", "isHidden", "(", ")", "{", "return", "hidden", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "name", "+", "\"", "(\"", "+", "description", "+", "\")\"", ";", "}", "public", "static", "String", "toByteUnitsString", "(", "long", "bytes", ")", "{", "if", "(", "bytes", "<", "KILOBYTES", ")", "{", "return", "String", ".", "valueOf", "(", "bytes", ")", "+", "\"", "bytes\"", ";", "}", "else", "if", "(", "bytes", "<", "(", "MEGABYTES", ")", ")", "{", "double", "value", "=", "bytes", "/", "KILOBYTES", ";", "return", "formatter", ".", "format", "(", "value", ")", "+", "\"", "KB\"", ";", "}", "else", "if", "(", "bytes", "<", "(", "GIGABYTES", ")", ")", "{", "double", "value", "=", "bytes", "/", "MEGABYTES", ";", "return", "formatter", ".", "format", "(", "value", ")", "+", "\"", "MB\"", ";", "}", "else", "{", "double", "value", "=", "bytes", "/", "GIGABYTES", ";", "return", "formatter", ".", "format", "(", "value", ")", "+", "\"", "GB\"", ";", "}", "}", "}", "</s>" ]
10,846
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "util", ".", "EnumSet", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "enum", "Blockable", "{", "BLOCKABLE_NONE", "(", "\"none\"", ")", ",", "BLOCKABLE_AUTO", "(", "\"auto\"", ")", ",", "BLOCKABLE_FORCE", "(", "\"force\"", ")", ";", "private", "static", "Map", "<", "String", ",", "Blockable", ">", "lookup", ";", "private", "String", "attribute", ";", "Blockable", "(", "String", "attribute", ")", "{", "this", ".", "attribute", "=", "attribute", ";", "}", "static", "{", "lookup", "=", "new", "HashMap", "<", "String", ",", "Blockable", ">", "(", ")", ";", "for", "(", "Blockable", "blockable", ":", "EnumSet", ".", "allOf", "(", "Blockable", ".", "class", ")", ")", "{", "lookup", ".", "put", "(", "blockable", ".", "getAttribute", "(", ")", ",", "blockable", ")", ";", "}", "}", "public", "String", "getAttribute", "(", ")", "{", "return", "attribute", ";", "}", "public", "static", "Blockable", "getBlockableFromAttribute", "(", "String", "attribute", ")", "{", "if", "(", "attribute", "!=", "null", "&&", "lookup", ".", "containsKey", "(", "attribute", ")", ")", "{", "return", "lookup", ".", "get", "(", "attribute", ")", ";", "}", "return", "null", ";", "}", "}", "</s>" ]
10,847
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "util", ".", "EnumSet", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "enum", "OverrideType", "{", "OVERRIDE_FALSE", "(", "\"false\"", ")", ",", "OVERRIDE_TRUE", "(", "\"true\"", ")", ",", "OVERRIDE_ASK_FALSE", "(", "\"askfalse\"", ")", ",", "OVERRIDE_ASK_TRUE", "(", "\"asktrue\"", ")", ",", "OVERRIDE_UPDATE", "(", "\"update\"", ")", ";", "private", "static", "Map", "<", "String", ",", "OverrideType", ">", "lookup", ";", "private", "String", "attribute", ";", "OverrideType", "(", "String", "attribute", ")", "{", "this", ".", "attribute", "=", "attribute", ";", "}", "static", "{", "lookup", "=", "new", "HashMap", "<", "String", ",", "OverrideType", ">", "(", ")", ";", "for", "(", "OverrideType", "overridetype", ":", "EnumSet", ".", "allOf", "(", "OverrideType", ".", "class", ")", ")", "{", "lookup", ".", "put", "(", "overridetype", ".", "getAttribute", "(", ")", ",", "overridetype", ")", ";", "}", "}", "public", "String", "getAttribute", "(", ")", "{", "return", "attribute", ";", "}", "public", "static", "OverrideType", "getOverrideTypeFromAttribute", "(", "String", "attribute", ")", "{", "if", "(", "attribute", "!=", "null", "&&", "lookup", ".", "containsKey", "(", "attribute", ")", ")", "{", "return", "lookup", ".", "get", "(", "attribute", ")", ";", "}", "return", "null", ";", "}", "}", "</s>" ]
10,848
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Locale", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "resource", ".", "Messages", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "rules", ".", "RulesEngine", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Platform", ";", "public", "interface", "InstallData", "{", "String", "MEDIA_PATH", "=", "\"MEDIA_PATH\"", ";", "String", "INSTALL_PATH", "=", "\"INSTALL_PATH\"", ";", "String", "MODIFY_INSTALLATION", "=", "\"\"", ";", "String", "INSTALLATION_INFORMATION", "=", "\"\"", ";", "void", "setVariable", "(", "String", "name", ",", "String", "value", ")", ";", "String", "getVariable", "(", "String", "name", ")", ";", "void", "refreshVariables", "(", ")", ";", "Variables", "getVariables", "(", ")", ";", "void", "setInstallPath", "(", "String", "path", ")", ";", "String", "getInstallPath", "(", ")", ";", "void", "setDefaultInstallPath", "(", "String", "path", ")", ";", "String", "getDefaultInstallPath", "(", ")", ";", "void", "setMediaPath", "(", "String", "path", ")", ";", "String", "getMediaPath", "(", ")", ";", "RulesEngine", "getRules", "(", ")", ";", "Locale", "getLocale", "(", ")", ";", "String", "getLocaleISO3", "(", ")", ";", "Messages", "getMessages", "(", ")", ";", "Info", "getInfo", "(", ")", ";", "Platform", "getPlatform", "(", ")", ";", "List", "<", "Pack", ">", "getAllPacks", "(", ")", ";", "List", "<", "Pack", ">", "getAvailablePacks", "(", ")", ";", "List", "<", "Pack", ">", "getSelectedPacks", "(", ")", ";", "void", "setSelectedPacks", "(", "List", "<", "Pack", ">", "selectedPacks", ")", ";", "List", "<", "Panel", ">", "getPanelsOrder", "(", ")", ";", "boolean", "isCanClose", "(", ")", ";", "boolean", "isInstallSuccess", "(", ")", ";", "void", "setInstallSuccess", "(", "boolean", "success", ")", ";", "boolean", "isRebootNecessary", "(", ")", ";", "void", "setRebootNecessary", "(", "boolean", "reboot", ")", ";", "IXMLElement", "getXmlData", "(", ")", ";", "List", "<", "InstallerRequirement", ">", "getInstallerRequirements", "(", ")", ";", "List", "<", "DynamicInstallerRequirementValidator", ">", "getDynamicInstallerRequirements", "(", ")", ";", "void", "setAttribute", "(", "String", "name", ",", "Object", "value", ")", ";", "Object", "getAttribute", "(", "String", "name", ")", ";", "}", "</s>" ]
10,849
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "factory", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "IzPackClassNotFoundException", ";", "public", "interface", "ObjectFactory", "{", "<", "T", ">", "T", "create", "(", "Class", "<", "T", ">", "type", ",", "Object", "...", "parameters", ")", ";", "<", "T", ">", "T", "create", "(", "String", "className", ",", "Class", "<", "T", ">", "superType", ",", "Object", "...", "parameters", ")", ";", "}", "</s>" ]
10,850
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "xinclude", ";", "import", "static", "junit", ".", "framework", ".", "Assert", ".", "assertEquals", ";", "import", "static", "junit", ".", "framework", ".", "Assert", ".", "fail", ";", "import", "static", "org", ".", "hamcrest", ".", "MatcherAssert", ".", "assertThat", ";", "import", "static", "org", ".", "hamcrest", ".", "text", ".", "IsEqualIgnoringWhiteSpace", ".", "equalToIgnoringWhiteSpace", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLParser", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLParser", ";", "public", "abstract", "class", "BaseXIncludeTestCase", "{", "public", "abstract", "void", "doTest", "(", "String", "fileBase", ")", "throws", "Exception", ";", "public", "void", "ensureFailure", "(", "String", "fileBase", ")", "throws", "Exception", "{", "try", "{", "URL", "baseURL", "=", "getClass", "(", ")", ".", "getResource", "(", "fileBase", "+", "\"-input.xml\"", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "parser", ".", "parse", "(", "baseURL", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "}", "}", "public", "void", "deepEqual", "(", "IXMLElement", "a", ",", "IXMLElement", "b", ")", "{", "assertEquals", "(", "\"\"", ",", "a", ".", "getName", "(", ")", ",", "b", ".", "getName", "(", ")", ")", ";", "if", "(", "null", "!=", "b", ".", "getContent", "(", ")", "&&", "null", "!=", "a", ".", "getContent", "(", ")", ")", "{", "assertThat", "(", "a", ".", "getContent", "(", ")", ",", "equalToIgnoringWhiteSpace", "(", "b", ".", "getContent", "(", ")", ")", ")", ";", "}", "assertEquals", "(", "\"\"", "+", "a", ".", "getName", "(", ")", ",", "a", ".", "getChildrenCount", "(", ")", ",", "b", ".", "getChildrenCount", "(", ")", ")", ";", "List", "<", "IXMLElement", ">", "aChildren", "=", "a", ".", "getChildren", "(", ")", ";", "List", "<", "IXMLElement", ">", "bChildren", "=", "b", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bChildren", ".", "size", "(", ")", ";", "i", "++", ")", "{", "IXMLElement", "aChild", "=", "aChildren", ".", "get", "(", "i", ")", ";", "IXMLElement", "bChild", "=", "bChildren", ".", "get", "(", "i", ")", ";", "deepEqual", "(", "aChild", ",", "bChild", ")", ";", "}", "}", "@", "Test", "public", "void", "testIncludeOnly", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"include-only\"", ")", ";", "}", "@", "Test", "public", "void", "testIncludeSubdirectoryOnly", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testIncludeFragmentOnly", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testIncludeInElement", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testIncludeFragmentInElement", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "_testIncludeTextInElement", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testParseAttributeText", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testParseAttributeXML", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testParseInvalidAttribute", "(", ")", "throws", "Exception", "{", "ensureFailure", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testFallback", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"fallback\"", ")", ";", "}", "@", "Test", "public", "void", "testEmptyFallback", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "testMultipleIncludes", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ")", ";", "}", "}", "</s>" ]
10,851
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "xinclude", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLParser", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLParser", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "net", ".", "URL", ";", "public", "class", "XIncludeParseFileTestCase", "extends", "BaseXIncludeTestCase", "{", "@", "Override", "public", "void", "doTest", "(", "String", "fileBase", ")", "throws", "Exception", "{", "URL", "inputURL", "=", "getClass", "(", ")", ".", "getResource", "(", "fileBase", "+", "\"-input.xml\"", ")", ";", "URL", "expectURL", "=", "getClass", "(", ")", ".", "getResource", "(", "fileBase", "+", "\"-expect.xml\"", ")", ";", "File", "fileInput", "=", "new", "File", "(", "inputURL", ".", "toURI", "(", ")", ")", ";", "File", "fileExcept", "=", "new", "File", "(", "expectURL", ".", "toURI", "(", ")", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "IXMLElement", "inputElement", "=", "parser", ".", "parse", "(", "new", "FileInputStream", "(", "fileInput", ")", ",", "fileInput", ".", "getAbsolutePath", "(", ")", ")", ";", "IXMLElement", "expectedElement", "=", "parser", ".", "parse", "(", "new", "FileInputStream", "(", "fileExcept", ")", ",", "fileInput", ".", "getAbsolutePath", "(", ")", ")", ";", "deepEqual", "(", "expectedElement", ",", "inputElement", ")", ";", "}", "}", "</s>" ]
10,852
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "xinclude", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLParser", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLParser", ";", "import", "java", ".", "net", ".", "URL", ";", "public", "class", "XIncludeParseURLTestCase", "extends", "BaseXIncludeTestCase", "{", "@", "Override", "public", "void", "doTest", "(", "String", "fileBase", ")", "throws", "Exception", "{", "URL", "inputURL", "=", "getClass", "(", ")", ".", "getResource", "(", "fileBase", "+", "\"-input.xml\"", ")", ";", "URL", "expectURL", "=", "getClass", "(", ")", ".", "getResource", "(", "fileBase", "+", "\"-expect.xml\"", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "IXMLElement", "inputElement", "=", "parser", ".", "parse", "(", "inputURL", ")", ";", "IXMLElement", "expectedElement", "=", "parser", ".", "parse", "(", "expectURL", ")", ";", "deepEqual", "(", "expectedElement", ",", "inputElement", ")", ";", "}", "}", "</s>" ]
10,853
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "xinclude", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLParser", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLParser", ";", "import", "java", ".", "net", ".", "URL", ";", "public", "class", "XIncludeParseStreamTestCase", "extends", "BaseXIncludeTestCase", "{", "@", "Override", "public", "void", "doTest", "(", "String", "fileBase", ")", "throws", "Exception", "{", "URL", "inputURL", "=", "getClass", "(", ")", ".", "getResource", "(", "fileBase", "+", "\"-input.xml\"", ")", ";", "URL", "expectURL", "=", "getClass", "(", ")", ".", "getResource", "(", "fileBase", "+", "\"-expect.xml\"", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "IXMLElement", "inputElement", "=", "parser", ".", "parse", "(", "inputURL", ".", "openStream", "(", ")", ",", "inputURL", ".", "toExternalForm", "(", ")", ")", ";", "IXMLElement", "expectedElement", "=", "parser", ".", "parse", "(", "expectURL", ".", "openStream", "(", ")", ")", ";", "deepEqual", "(", "expectedElement", ",", "inputElement", ")", ";", "}", "}", "</s>" ]
10,854
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLElementImpl", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLParser", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLWriter", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Rule", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "rules", ".", "TemporaryFolder", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "XMLWriterTest", "{", "private", "static", "final", "String", "filename", "=", "\"partial.xml\"", ";", "private", "static", "final", "String", "output", "=", "\"output.xml\"", ";", "private", "IXMLParser", "parser", ";", "private", "IXMLElement", "root", ";", "@", "Rule", "public", "TemporaryFolder", "tempFolder", "=", "new", "TemporaryFolder", "(", ")", ";", "@", "Before", "public", "void", "setUp", "(", ")", "throws", "FileNotFoundException", "{", "parser", "=", "new", "XMLParser", "(", ")", ";", "root", "=", "parser", ".", "parse", "(", "XMLWriterTest", ".", "class", ".", "getResourceAsStream", "(", "filename", ")", ")", ";", "}", "@", "Test", "public", "void", "testWriteFile", "(", ")", "throws", "IOException", "{", "IXMLWriter", "writer", "=", "new", "XMLWriter", "(", ")", ";", "File", "file", "=", "tempFolder", ".", "newFile", "(", "output", ")", ";", "FileOutputStream", "out", "=", "new", "FileOutputStream", "(", "file", ")", ";", "writer", ".", "setOutput", "(", "out", ")", ";", "writer", ".", "write", "(", "root", ")", ";", "root", "=", "parser", ".", "parse", "(", "XMLWriterTest", ".", "class", ".", "getResourceAsStream", "(", "filename", ")", ")", ";", "IXMLElement", "element", "=", "parser", ".", "parse", "(", "new", "FileInputStream", "(", "file", ")", ")", ";", "Assert", ".", "assertEquals", "(", "root", ".", "getName", "(", ")", ",", "element", ".", "getName", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testWriteURL", "(", ")", "throws", "IOException", "{", "IXMLWriter", "writer", "=", "new", "XMLWriter", "(", ")", ";", "File", "file", "=", "tempFolder", ".", "newFile", "(", "output", ")", ";", "FileOutputStream", "out", "=", "new", "FileOutputStream", "(", "file", ")", ";", "writer", ".", "setOutput", "(", "out", ")", ";", "writer", ".", "write", "(", "root", ")", ";", "root", "=", "parser", ".", "parse", "(", "XMLWriterTest", ".", "class", ".", "getResourceAsStream", "(", "filename", ")", ")", ";", "IXMLElement", "element", "=", "parser", ".", "parse", "(", "new", "FileInputStream", "(", "file", ")", ")", ";", "Assert", ".", "assertEquals", "(", "root", ".", "getName", "(", ")", ",", "element", ".", "getName", "(", ")", ")", ";", "}", "@", "Test", "(", "expected", "=", "XMLException", ".", "class", ")", "public", "void", "testFail", "(", ")", "{", "IXMLElement", "elt", "=", "new", "XMLElementImpl", "(", "\"root\"", ")", ";", "IXMLWriter", "writer", "=", "new", "XMLWriter", "(", ")", ";", "writer", ".", "setOutput", "(", "\"\"", ")", ";", "writer", ".", "write", "(", "elt", ")", ";", "}", "}", "</s>" ]
10,855
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLParser", ";", "import", "org", ".", "apache", ".", "commons", ".", "io", ".", "FileUtils", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "xml", ".", "sax", ".", "SAXException", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "ParserConfigurationException", ";", "import", "javax", ".", "xml", ".", "transform", ".", "TransformerException", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "static", "junit", ".", "framework", ".", "Assert", ".", "assertEquals", ";", "public", "class", "XMLParserTest", "{", "private", "static", "final", "String", "filename", "=", "\"\"", ";", "private", "static", "final", "String", "shortFilename", "=", "\"short.xml\"", ";", "private", "static", "final", "String", "lnFilename", "=", "\"\"", ";", "private", "static", "final", "String", "xlnFilename", "=", "\"\"", ";", "private", "static", "final", "String", "parseErrorFilename", "=", "\"notvalid.xml\"", ";", "private", "static", "final", "String", "parseErrorXincludeFilename", "=", "\"\"", ";", "@", "org", ".", "junit", ".", "Test", "public", "void", "testParseFile", "(", ")", "throws", "Exception", "{", "InputStream", "input", ";", "IXMLElement", "spec", ";", "input", "=", "XMLParserTest", ".", "class", ".", "getResourceAsStream", "(", "shortFilename", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "spec", "=", "parser", ".", "parse", "(", "input", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "spec", ".", "getName", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testParseString", "(", ")", "throws", "Exception", "{", "IXMLElement", "spec", ";", "String", "substitutedSpec", "=", "FileUtils", ".", "readFileToString", "(", "new", "File", "(", "XMLParserTest", ".", "class", ".", "getResource", "(", "filename", ")", ".", "toURI", "(", ")", ")", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "spec", "=", "parser", ".", "parse", "(", "substitutedSpec", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "spec", ".", "getName", "(", ")", ")", ";", "}", "private", "void", "checkEltLN", "(", "IXMLElement", "elt", ")", "{", "assertEquals", "(", "Integer", ".", "parseInt", "(", "elt", ".", "getAttribute", "(", "\"ln\"", ")", ")", ",", "elt", ".", "getLineNr", "(", ")", ")", ";", "for", "(", "IXMLElement", "child", ":", "elt", ".", "getChildren", "(", ")", ")", "{", "checkEltLN", "(", "child", ")", ";", "}", "}", "@", "org", ".", "junit", ".", "Test", "public", "void", "testLineNumber", "(", ")", "throws", "SAXException", ",", "ParserConfigurationException", ",", "IOException", ",", "TransformerException", "{", "InputStream", "input", "=", "XMLParserTest", ".", "class", ".", "getResourceAsStream", "(", "lnFilename", ")", ";", "IXMLElement", "elt", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "elt", "=", "parser", ".", "parse", "(", "input", ")", ";", "checkEltLN", "(", "elt", ")", ";", "}", "@", "Test", "public", "void", "testXincludeLineNumber", "(", ")", "throws", "SAXException", ",", "ParserConfigurationException", ",", "IOException", ",", "TransformerException", "{", "URL", "url", "=", "XMLParserTest", ".", "class", ".", "getResource", "(", "xlnFilename", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "IXMLElement", "elt", "=", "parser", ".", "parse", "(", "url", ")", ";", "checkEltLN", "(", "elt", ")", ";", "}", "@", "Test", "(", "expected", "=", "XMLException", ".", "class", ")", "public", "void", "testXMLExceptionThrown", "(", ")", "{", "InputStream", "input", "=", "XMLParserTest", ".", "class", ".", "getResourceAsStream", "(", "parseErrorFilename", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "parser", ".", "parse", "(", "input", ",", "parseErrorFilename", ")", ";", "}", "@", "Test", "(", "expected", "=", "XMLException", ".", "class", ")", "public", "void", "testXMLExceptionThrownXInclude", "(", ")", "{", "InputStream", "input", "=", "XMLParserTest", ".", "class", ".", "getResourceAsStream", "(", "parseErrorXincludeFilename", ")", ";", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "parser", ".", "parse", "(", "input", ",", "parseErrorXincludeFilename", ")", ";", "}", "@", "Test", "(", "expected", "=", "NullPointerException", ".", "class", ")", "public", "void", "testNPE", "(", ")", "{", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "parser", ".", "parse", "(", "(", "InputStream", ")", "null", ")", ";", "}", "@", "Test", "(", "expected", "=", "NullPointerException", ".", "class", ")", "public", "void", "testWithSystemIdNPE", "(", ")", "{", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "parser", ".", "parse", "(", "null", ",", "\"bla\"", ")", ";", "}", "}", "</s>" ]
10,856
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLElementImpl", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "impl", ".", "XMLParser", ";", "import", "org", ".", "junit", ".", "Assert", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "XMLElementTest", "{", "private", "static", "final", "String", "filename", "=", "\"partial.xml\"", ";", "private", "IXMLElement", "root", ";", "@", "Before", "public", "void", "setUp", "(", ")", "throws", "FileNotFoundException", "{", "IXMLParser", "parser", "=", "new", "XMLParser", "(", ")", ";", "root", "=", "parser", ".", "parse", "(", "XMLElementTest", ".", "class", ".", "getResourceAsStream", "(", "filename", ")", ")", ";", "}", "@", "Test", "public", "void", "testGetName", "(", ")", "{", "Assert", ".", "assertEquals", "(", "\"\"", ",", "root", ".", "getName", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "root", ".", "getChildAtIndex", "(", "0", ")", ".", "getName", "(", ")", ",", "\"info\"", ")", ";", "}", "@", "Test", "public", "void", "testAddChild", "(", ")", "throws", "NoSuchMethodException", "{", "IXMLElement", "element", "=", "new", "XMLElementImpl", "(", "\"child\"", ",", "root", ")", ";", "root", ".", "addChild", "(", "element", ")", ";", "element", "=", "root", ".", "getChildAtIndex", "(", "root", ".", "getChildrenCount", "(", ")", "-", "1", ")", ";", "Assert", ".", "assertEquals", "(", "element", ".", "getName", "(", ")", ",", "\"child\"", ")", ";", "}", "@", "Test", "public", "void", "testRemoveChild", "(", ")", "throws", "NoSuchMethodException", "{", "IXMLElement", "element", "=", "new", "XMLElementImpl", "(", "\"child\"", ",", "root", ")", ";", "root", ".", "addChild", "(", "element", ")", ";", "element", "=", "root", ".", "getChildAtIndex", "(", "root", ".", "getChildrenCount", "(", ")", "-", "1", ")", ";", "root", ".", "removeChild", "(", "element", ")", ";", "Assert", ".", "assertEquals", "(", "root", ".", "getChildrenNamed", "(", "\"child\"", ")", ".", "size", "(", ")", ",", "0", ")", ";", "}", "@", "Test", "public", "void", "testHasChildrenIfTrue", "(", ")", "{", "Assert", ".", "assertTrue", "(", "root", ".", "hasChildren", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testHasChildrenIfFalse", "(", ")", "{", "IXMLElement", "element", "=", "new", "XMLElementImpl", "(", "\"test\"", ")", ";", "Assert", ".", "assertFalse", "(", "element", ".", "hasChildren", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testGetChildrenCount", "(", ")", "{", "IXMLElement", "element", "=", "root", ".", "getChildAtIndex", "(", "0", ")", ";", "Assert", ".", "assertEquals", "(", "element", ".", "getChildrenCount", "(", ")", ",", "9", ")", ";", "}", "@", "Test", "public", "void", "testGetChildAtIndex", "(", ")", "{", "IXMLElement", "element", "=", "root", ".", "getChildAtIndex", "(", "1", ")", ";", "Assert", ".", "assertEquals", "(", "\"variables\"", ",", "element", ".", "getName", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testGetFirstChildNamed", "(", ")", "{", "IXMLElement", "element", "=", "root", ".", "getFirstChildNamed", "(", "\"locale\"", ")", ";", "Assert", ".", "assertEquals", "(", "element", ".", "getName", "(", ")", ",", "\"locale\"", ")", ";", "}", "@", "Test", "public", "void", "testGetChildrenNamed", "(", ")", "{", "IXMLElement", "element", "=", "root", ".", "getChildAtIndex", "(", "2", ")", ";", "List", "<", "IXMLElement", ">", "list", "=", "element", ".", "getChildrenNamed", "(", "\"modifier\"", ")", ";", "Assert", ".", "assertEquals", "(", "7", ",", "list", ".", "size", "(", ")", ")", ";", "}", "}", "</s>" ]
10,857
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mockito", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "resource", ".", "Locales", ";", "public", "class", "LocaleDatabaseTest", "{", "private", "LocaleDatabase", "db", ";", "@", "Before", "public", "void", "setUp", "(", ")", "throws", "Exception", "{", "db", "=", "new", "LocaleDatabase", "(", "LocaleDatabaseTest", ".", "class", ".", "getResourceAsStream", "(", "\"\"", ")", ",", "Mockito", ".", "mock", "(", "Locales", ".", "class", ")", ")", ";", "}", "@", "Test", "public", "void", "testGet", "(", ")", "{", "assertEquals", "(", "\"String", "Text\"", ",", "db", ".", "get", "(", "\"string\"", ")", ")", ";", "assertEquals", "(", "\"none\"", ",", "db", ".", "get", "(", "\"none\"", ")", ")", ";", "}", "@", "Test", "public", "void", "testGetWithArgs", "(", ")", "{", "assertEquals", "(", "\"\"", ",", "db", ".", "get", "(", "\"\"", ",", "\"one\"", ",", "\"two\"", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "db", ".", "get", "(", "\"\"", ",", "\"one\"", ",", "\"two\"", ")", ")", ";", "}", "@", "Test", "public", "void", "testGetString", "(", ")", "throws", "Exception", "{", "assertEquals", "(", "\"String", "Text\"", ",", "db", ".", "getString", "(", "\"string\"", ")", ")", ";", "assertEquals", "(", "\"none\"", ",", "db", ".", "getString", "(", "\"none\"", ")", ")", ";", "}", "@", "Test", "public", "void", "testNpeHandling", "(", ")", "{", "assertEquals", "(", "\"\"", ",", "db", ".", "getString", "(", "\"\"", ",", "new", "String", "[", "]", "{", "\"one\"", ",", "null", "}", ")", ")", ";", "}", "@", "Test", "public", "void", "testQuotedPlaceholder", "(", ")", "{", "assertEquals", "(", "\"\"", ",", "db", ".", "getString", "(", "\"\"", ",", "new", "String", "[", "]", "{", "\"one\"", ",", "null", "}", ")", ")", ";", "}", "}", "</s>" ]
10,858
[ "<s>", "package", "com", ".", "company", ".", "izpack", ".", "panels", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "GUIInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Info", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "gui", ".", "IzPanelLayout", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "gui", ".", "LabelFactory", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "gui", ".", "LayoutConstants", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "IzPanel", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "class", "MyHelloPanel", "extends", "IzPanel", "{", "private", "static", "final", "long", "serialVersionUID", "=", "3257848774955905587L", ";", "public", "MyHelloPanel", "(", "InstallerFrame", "parent", ",", "GUIInstallData", "idata", ")", "{", "this", "(", "parent", ",", "idata", ",", "new", "IzPanelLayout", "(", ")", ")", ";", "}", "public", "MyHelloPanel", "(", "InstallerFrame", "parent", ",", "GUIInstallData", "idata", ",", "LayoutManager2", "layout", ")", "{", "super", "(", "parent", ",", "idata", ",", "layout", ")", ";", "Messages", "messages", "=", "installData", ".", "getMessages", "(", ")", ";", "String", "str", ";", "str", "=", "messages", ".", "get", "(", "\"\"", ")", "+", "idata", ".", "getInfo", "(", ")", ".", "getAppName", "(", ")", "+", "\"", "\"", "+", "idata", ".", "getInfo", "(", ")", ".", "getAppVersion", "(", ")", "+", "messages", ".", "get", "(", "\"\"", ")", ";", "JLabel", "welcomeLabel", "=", "LabelFactory", ".", "create", "(", "str", ",", "parent", ".", "getIcons", "(", ")", ".", "get", "(", "\"host\"", ")", ",", "LEADING", ")", ";", "add", "(", "welcomeLabel", ",", "NEXT_LINE", ")", ";", "add", "(", "IzPanelLayout", ".", "createParagraphGap", "(", ")", ")", ";", "ArrayList", "<", "Info", ".", "Author", ">", "authors", "=", "idata", ".", "getInfo", "(", ")", ".", "getAuthors", "(", ")", ";", "int", "size", "=", "authors", ".", "size", "(", ")", ";", "if", "(", "size", ">", "0", ")", "{", "str", "=", "messages", ".", "get", "(", "\"\"", ")", ";", "JLabel", "appAuthorsLabel", "=", "LabelFactory", ".", "create", "(", "str", ",", "parent", ".", "getIcons", "(", ")", ".", "get", "(", "\"information\"", ")", ",", "LEADING", ")", ";", "add", "(", "appAuthorsLabel", ",", "LayoutConstants", ".", "NEXT_LINE", ")", ";", "JLabel", "label", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "Info", ".", "Author", "a", "=", "authors", ".", "get", "(", "i", ")", ";", "String", "email", "=", "(", "a", ".", "getEmail", "(", ")", "!=", "null", "&&", "a", ".", "getEmail", "(", ")", ".", "length", "(", ")", ">", "0", ")", "?", "(", "\"", "<\"", "+", "a", ".", "getEmail", "(", ")", "+", "\">\"", ")", ":", "\"\"", ";", "label", "=", "LabelFactory", ".", "create", "(", "\"", "-", "\"", "+", "a", ".", "getName", "(", ")", "+", "email", ",", "parent", ".", "getIcons", "(", ")", ".", "get", "(", "\"empty\"", ")", ",", "LEADING", ")", ";", "add", "(", "label", ",", "NEXT_LINE", ")", ";", "}", "add", "(", "IzPanelLayout", ".", "createParagraphGap", "(", ")", ")", ";", "}", "if", "(", "idata", ".", "getInfo", "(", ")", ".", "getAppURL", "(", ")", "!=", "null", ")", "{", "str", "=", "messages", ".", "get", "(", "\"\"", ")", "+", "idata", ".", "getInfo", "(", ")", ".", "getAppURL", "(", ")", ";", "JLabel", "appURLLabel", "=", "LabelFactory", ".", "create", "(", "str", ",", "parent", ".", "getIcons", "(", ")", ".", "get", "(", "\"bookmark\"", ")", ",", "LEADING", ")", ";", "add", "(", "appURLLabel", ",", "LayoutConstants", ".", "NEXT_LINE", ")", ";", "}", "getLayoutHelper", "(", ")", ".", "completeLayout", "(", ")", ";", "}", "public", "boolean", "isValidated", "(", ")", "{", "return", "true", ";", "}", "}", "</s>" ]
10,859
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "sample", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processor", ".", "Processor", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processorclient", ".", "ProcessingClient", ";", "public", "class", "Scrambler", "implements", "Processor", "{", "public", "String", "process", "(", "ProcessingClient", "client", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "client", ".", "getNumFields", "(", ")", "-", "1", ";", "i", ">", "-", "1", ";", "i", "--", ")", "{", "buffer", ".", "append", "(", "client", ".", "getFieldContents", "(", "i", ")", ")", ";", "if", "(", "i", ">", "0", ")", "{", "buffer", ".", "append", "(", "'*'", ")", ";", "}", "}", "return", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "}", "</s>" ]
10,860
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "sample", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processorclient", ".", "ProcessingClient", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "validator", ".", "Validator", ";", "public", "class", "IPValidator", "implements", "Validator", "{", "public", "boolean", "validate", "(", "ProcessingClient", "client", ")", "{", "if", "(", "client", ".", "getNumFields", "(", ")", "!=", "4", ")", "{", "return", "(", "false", ")", ";", "}", "boolean", "isIP", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "int", "value", ";", "try", "{", "value", "=", "Integer", ".", "parseInt", "(", "client", ".", "getFieldContents", "(", "i", ")", ")", ";", "if", "(", "(", "value", "<", "0", ")", "||", "(", "value", ">", "255", ")", ")", "{", "isIP", "=", "false", ";", "}", "}", "catch", "(", "Throwable", "exception", ")", "{", "isIP", "=", "false", ";", "}", "}", "return", "(", "isIP", ")", ";", "}", "}", "</s>" ]
10,861
[ "<s>", "package", "com", ".", "myCompany", ".", "tools", ".", "install", ".", "listener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "PackFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "InstallerException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "SimpleInstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "FileExecutor", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "public", "class", "ChmodInstallerListener", "extends", "SimpleInstallerListener", "{", "public", "boolean", "isFileListener", "(", ")", "{", "return", "true", ";", "}", "public", "void", "afterFile", "(", "File", "filePath", ",", "PackFile", "pf", ")", "throws", "Exception", "{", "if", "(", "pf", ".", "getAdditionals", "(", ")", "==", "null", ")", "{", "return", ";", "}", "Object", "file", "=", "pf", ".", "getAdditionals", "(", ")", ".", "get", "(", "\"\"", ")", ";", "int", "fileVal", "=", "-", "1", ";", "if", "(", "file", "!=", "null", "&&", "file", "instanceof", "Integer", ")", "{", "fileVal", "=", "(", "(", "Integer", ")", "file", ")", ".", "intValue", "(", ")", ";", "}", "if", "(", "fileVal", "!=", "-", "1", ")", "{", "chmod", "(", "filePath", ",", "fileVal", ")", ";", "}", "}", "public", "void", "afterDir", "(", "File", "dirPath", ",", "PackFile", "pf", ")", "throws", "Exception", "{", "if", "(", "pf", ".", "getAdditionals", "(", ")", "==", "null", ")", "{", "return", ";", "}", "if", "(", "dirPath", "==", "null", ")", "{", "return", ";", "}", "Object", "dir", "=", "pf", ".", "getAdditionals", "(", ")", ".", "get", "(", "\"\"", ")", ";", "int", "dirVal", "=", "-", "1", ";", "if", "(", "dir", "!=", "null", "&&", "dir", "instanceof", "Integer", ")", "{", "dirVal", "=", "(", "(", "Integer", ")", "dir", ")", ".", "intValue", "(", ")", ";", "}", "if", "(", "dirVal", "!=", "-", "1", ")", "{", "if", "(", "(", "dirVal", "&", "0x000001C0", ")", "<", "0x000001C0", ")", "{", "throw", "new", "InstallerException", "(", "\"\"", "+", "dirPath", ".", "getAbsolutePath", "(", ")", "+", "\"\"", ")", ";", "}", "chmod", "(", "dirPath", ",", "dirVal", ")", ";", "}", "}", "private", "void", "chmod", "(", "File", "path", ",", "int", "permissions", ")", "throws", "IOException", "{", "String", "pathSep", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "if", "(", "OsVersion", ".", "IS_WINDOWS", ")", "{", "throw", "new", "IOException", "(", "\"\"", ")", ";", "}", "if", "(", "path", "==", "null", ")", "{", "return", ";", "}", "String", "permStr", "=", "Integer", ".", "toOctalString", "(", "permissions", ")", ";", "String", "[", "]", "params", "=", "{", "\"chmod\"", ",", "permStr", ",", "path", ".", "getAbsolutePath", "(", ")", "}", ";", "String", "[", "]", "output", "=", "new", "String", "[", "2", "]", ";", "FileExecutor", "fe", "=", "new", "FileExecutor", "(", ")", ";", "fe", ".", "executeCommand", "(", "params", ",", "output", ")", ";", "}", "}", "</s>" ]
10,862
[ "<s>", "package", "com", ".", "myCompany", ".", "tools", ".", "install", ".", "listener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "CompilerException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "listener", ".", "SimpleCompilerListener", ";", "import", "net", ".", "n3", ".", "nanoxml", ".", "XMLElement", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Vector", ";", "public", "class", "ChmodCompilerListener", "extends", "SimpleCompilerListener", "{", "public", "Map", "reviseAdditionalDataMap", "(", "Map", "existentDataMap", ",", "XMLElement", "element", ")", "throws", "CompilerException", "{", "Map", "retval", "=", "existentDataMap", "!=", "null", "?", "existentDataMap", ":", "new", "HashMap", "(", ")", ";", "Vector", "dataList", "=", "element", ".", "getChildrenNamed", "(", "\"\"", ")", ";", "Iterator", "iter", "=", "null", ";", "if", "(", "dataList", "==", "null", "||", "dataList", ".", "size", "(", ")", "==", "0", ")", "{", "return", "(", "existentDataMap", ")", ";", "}", "iter", "=", "dataList", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "XMLElement", "data", "=", "(", "XMLElement", ")", "iter", ".", "next", "(", ")", ";", "String", "[", "]", "relevantKeys", "=", "{", "\"\"", ",", "\"\"", "}", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "relevantKeys", ".", "length", ";", "++", "i", ")", "{", "String", "key", "=", "data", ".", "getAttribute", "(", "\"key\"", ")", ";", "if", "(", "key", ".", "equalsIgnoreCase", "(", "relevantKeys", "[", "i", "]", ")", ")", "{", "String", "value", "=", "data", ".", "getAttribute", "(", "\"value\"", ")", ";", "if", "(", "value", "==", "null", "||", "value", ".", "length", "(", ")", "==", "0", ")", "{", "continue", ";", "}", "try", "{", "int", "radix", "=", "value", ".", "startsWith", "(", "\"0\"", ")", "?", "8", ":", "10", ";", "retval", ".", "put", "(", "key", ",", "Integer", ".", "valueOf", "(", "value", ",", "radix", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "x", ")", "{", "throw", "new", "CompilerException", "(", "\"'\"", "+", "relevantKeys", "[", "i", "]", "+", "\"\"", ")", ";", "}", "}", "}", "}", "return", "retval", ";", "}", "}", "</s>" ]
10,863
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "sample", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processor", ".", "Processor", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processorclient", ".", "ProcessingClient", ";", "public", "class", "PWDEncryptor", "implements", "Processor", "{", "public", "String", "process", "(", "ProcessingClient", "client", ")", "{", "if", "(", "client", ".", "getNumFields", "(", ")", "<", "1", ")", "{", "return", "(", "\"\"", ")", ";", "}", "char", "[", "]", "password", "=", "client", ".", "getFieldContents", "(", "0", ")", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "result", "=", "new", "char", "[", "password", ".", "length", "]", ";", "int", "temp", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "password", ".", "length", ";", "i", "++", ")", "{", "temp", "=", "password", "[", "i", "]", "-", "57", ";", "if", "(", "i", ">", "0", ")", "{", "temp", "=", "temp", "+", "password", "[", "i", "-", "1", "]", ";", "}", "if", "(", "(", "temp", "%", "3", ")", "==", "0", ")", "{", "temp", "=", "temp", "+", "13", ";", "}", "if", "(", "temp", "<", "0", ")", "{", "temp", "=", "temp", "+", "193", ";", "}", "result", "[", "i", "]", "=", "(", "char", ")", "temp", ";", "}", "return", "(", "new", "String", "(", "result", ")", ")", ";", "}", "}", "</s>" ]
10,864
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "sample", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processorclient", ".", "ProcessingClient", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "validator", ".", "Validator", ";", "public", "class", "PWDValidator", "implements", "Validator", "{", "public", "boolean", "validate", "(", "ProcessingClient", "client", ")", "{", "int", "numFields", "=", "client", ".", "getNumFields", "(", ")", ";", "if", "(", "numFields", "<", "2", ")", "{", "return", "(", "true", ")", ";", "}", "boolean", "match", "=", "true", ";", "String", "content", "=", "client", ".", "getFieldContents", "(", "0", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "numFields", ";", "i", "++", ")", "{", "if", "(", "!", "content", ".", "equals", "(", "client", ".", "getFieldContents", "(", "i", ")", ")", ")", "{", "match", "=", "false", ";", "}", "}", "return", "(", "match", ")", ";", "}", "}", "</s>" ]
10,865
[ "<s>", "package", "org", ".", "izpack", ".", "mojo", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "org", ".", "apache", ".", "maven", ".", "model", ".", "Developer", ";", "import", "org", ".", "apache", ".", "maven", ".", "plugin", ".", "AbstractMojo", ";", "import", "org", ".", "apache", ".", "maven", ".", "plugin", ".", "MojoExecutionException", ";", "import", "org", ".", "apache", ".", "maven", ".", "plugin", ".", "MojoFailureException", ";", "import", "org", ".", "apache", ".", "maven", ".", "project", ".", "MavenProject", ";", "import", "org", ".", "apache", ".", "maven", ".", "project", ".", "MavenProjectHelper", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Info", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ".", "IzpackProjectInstaller", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "CompilerConfig", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "CompilerContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "data", ".", "CompilerData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "data", ".", "PropertyManager", ";", "public", "class", "IzPackNewMojo", "extends", "AbstractMojo", "{", "private", "MavenProject", "project", ";", "private", "MavenProjectHelper", "projectHelper", ";", "private", "String", "comprFormat", ";", "private", "String", "kind", ";", "private", "String", "installFile", ";", "private", "String", "baseDir", ";", "private", "String", "output", ";", "private", "boolean", "mkdirs", ";", "private", "int", "comprLevel", ";", "private", "boolean", "autoIncludeUrl", ";", "private", "boolean", "autoIncludeDevelopers", ";", "private", "File", "outputDirectory", ";", "private", "String", "finalName", ";", "private", "String", "classifier", ";", "private", "boolean", "enableAttachArtifact", ";", "private", "boolean", "enableOverrideArtifact", ";", "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "File", "jarFile", "=", "getJarFile", "(", ")", ";", "CompilerData", "compilerData", "=", "initCompilerData", "(", "jarFile", ")", ";", "CompilerContainer", "compilerContainer", "=", "new", "CompilerContainer", "(", ")", ";", "compilerContainer", ".", "addConfig", "(", "\"installFile\"", ",", "installFile", ")", ";", "compilerContainer", ".", "getComponent", "(", "IzpackProjectInstaller", ".", "class", ")", ";", "compilerContainer", ".", "addComponent", "(", "CompilerData", ".", "class", ",", "compilerData", ")", ";", "CompilerConfig", "compilerConfig", "=", "compilerContainer", ".", "getComponent", "(", "CompilerConfig", ".", "class", ")", ";", "PropertyManager", "propertyManager", "=", "compilerContainer", ".", "getComponent", "(", "PropertyManager", ".", "class", ")", ";", "initMavenProperties", "(", "propertyManager", ")", ";", "try", "{", "compilerConfig", ".", "executeCompiler", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "AssertionError", "(", "e", ")", ";", "}", "if", "(", "classifier", "!=", "null", "&&", "!", "classifier", ".", "isEmpty", "(", ")", ")", "{", "if", "(", "enableAttachArtifact", ")", "{", "projectHelper", ".", "attachArtifact", "(", "project", ",", "getType", "(", ")", ",", "classifier", ",", "jarFile", ")", ";", "}", "}", "else", "{", "if", "(", "enableOverrideArtifact", ")", "{", "project", ".", "getArtifact", "(", ")", ".", "setFile", "(", "jarFile", ")", ";", "}", "}", "}", "protected", "static", "final", "String", "getType", "(", ")", "{", "return", "\"jar\"", ";", "}", "private", "File", "getJarFile", "(", ")", "{", "File", "file", ";", "if", "(", "output", "!=", "null", ")", "{", "file", "=", "new", "File", "(", "output", ")", ";", "}", "else", "{", "if", "(", "classifier", "==", "null", "||", "classifier", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "classifier", "=", "\"\"", ";", "}", "else", "if", "(", "!", "classifier", ".", "startsWith", "(", "\"-\"", ")", ")", "{", "classifier", "=", "\"-\"", "+", "classifier", ";", "}", "file", "=", "new", "File", "(", "outputDirectory", ",", "finalName", "+", "classifier", "+", "\".jar\"", ")", ";", "}", "return", "file", ";", "}", "private", "void", "initMavenProperties", "(", "PropertyManager", "propertyManager", ")", "{", "if", "(", "project", "!=", "null", ")", "{", "Properties", "properties", "=", "project", ".", "getProperties", "(", ")", ";", "for", "(", "String", "propertyName", ":", "properties", ".", "stringPropertyNames", "(", ")", ")", "{", "String", "value", "=", "properties", ".", "getProperty", "(", "propertyName", ")", ";", "if", "(", "propertyManager", ".", "addProperty", "(", "propertyName", ",", "value", ")", ")", "{", "getLog", "(", ")", ".", "debug", "(", "\"\"", "+", "propertyName", "+", "\"=\"", "+", "value", ")", ";", "}", "else", "{", "getLog", "(", ")", ".", "warn", "(", "\"\"", "+", "propertyName", "+", "\"\"", ")", ";", "}", "}", "}", "}", "private", "CompilerData", "initCompilerData", "(", "File", "jarFile", ")", "{", "Info", "info", "=", "new", "Info", "(", ")", ";", "if", "(", "project", "!=", "null", ")", "{", "if", "(", "autoIncludeDevelopers", ")", "{", "if", "(", "project", ".", "getDevelopers", "(", ")", "!=", "null", ")", "{", "for", "(", "Developer", "dev", ":", "(", "List", "<", "Developer", ">", ")", "project", ".", "getDevelopers", "(", ")", ")", "{", "info", ".", "addAuthor", "(", "new", "Info", ".", "Author", "(", "dev", ".", "getName", "(", ")", ",", "dev", ".", "getEmail", "(", ")", ")", ")", ";", "}", "}", "}", "if", "(", "autoIncludeUrl", ")", "{", "info", ".", "setAppURL", "(", "project", ".", "getUrl", "(", ")", ")", ";", "}", "}", "return", "new", "CompilerData", "(", "comprFormat", ",", "kind", ",", "installFile", ",", "null", ",", "baseDir", ",", "jarFile", ".", "getPath", "(", ")", ",", "mkdirs", ",", "comprLevel", ",", "info", ")", ";", "}", "}", "</s>" ]
10,866
[ "<s>", "package", "org", ".", "izpack", ".", "mojo", ";", "import", "org", ".", "apache", ".", "maven", ".", "project", ".", "MavenProject", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "IzPackMavenProjectStub", "extends", "MavenProject", "{", "@", "Override", "public", "List", "getAttachedArtifacts", "(", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "}", "</s>" ]
10,867
[ "<s>", "package", "org", ".", "izpack", ".", "mojo", ";", "import", "static", "org", ".", "hamcrest", ".", "MatcherAssert", ".", "assertThat", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "jar", ".", "JarFile", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipEntry", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipFile", ";", "import", "org", ".", "apache", ".", "commons", ".", "io", ".", "IOUtils", ";", "import", "org", ".", "apache", ".", "maven", ".", "plugin", ".", "testing", ".", "AbstractMojoTestCase", ";", "import", "org", ".", "hamcrest", ".", "collection", ".", "IsCollectionContaining", ";", "import", "org", ".", "hamcrest", ".", "core", ".", "Is", ";", "import", "org", ".", "hamcrest", ".", "core", ".", "IsNull", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "matcher", ".", "ZipMatcher", ";", "public", "class", "IzPackNewMojoTest", "extends", "AbstractMojoTestCase", "{", "@", "Test", "public", "void", "testExecute", "(", ")", "throws", "Exception", "{", "File", "testPom", "=", "new", "File", "(", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ".", "getResource", "(", "\"\"", ")", ".", "toURI", "(", ")", ")", ";", "IzPackNewMojo", "mojo", "=", "(", "IzPackNewMojo", ")", "lookupMojo", "(", "\"izpack\"", ",", "testPom", ")", ";", "assertThat", "(", "mojo", ",", "IsNull", ".", "notNullValue", "(", ")", ")", ";", "initIzpackMojo", "(", "mojo", ")", ";", "mojo", ".", "execute", "(", ")", ";", "File", "file", "=", "new", "File", "(", "\"\"", ")", ";", "assertThat", "(", "file", ".", "exists", "(", ")", ",", "Is", ".", "is", "(", "true", ")", ")", ";", "JarFile", "jar", "=", "new", "JarFile", "(", "file", ")", ";", "assertThat", "(", "(", "ZipFile", ")", "jar", ",", "ZipMatcher", ".", "isZipMatching", "(", "IsCollectionContaining", ".", "hasItems", "(", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ")", ")", ";", "ZipEntry", "entry", "=", "jar", ".", "getEntry", "(", "\"\"", ")", ";", "InputStream", "content", "=", "jar", ".", "getInputStream", "(", "entry", ")", ";", "try", "{", "List", "<", "String", ">", "list", "=", "IOUtils", ".", "readLines", "(", "content", ")", ";", "assertThat", "(", "list", ",", "IsCollectionContaining", ".", "hasItem", "(", "\"\"", ")", ")", ";", "}", "finally", "{", "content", ".", "close", "(", ")", ";", "}", "}", "private", "void", "initIzpackMojo", "(", "IzPackNewMojo", "mojo", ")", "throws", "IllegalAccessException", "{", "File", "installFile", "=", "new", "File", "(", "\"\"", ")", ";", "setVariableValueToObject", "(", "mojo", ",", "\"comprFormat\"", ",", "\"default\"", ")", ";", "setVariableValueToObject", "(", "mojo", ",", "\"installFile\"", ",", "installFile", ".", "getAbsolutePath", "(", ")", ")", ";", "setVariableValueToObject", "(", "mojo", ",", "\"kind\"", ",", "\"standard\"", ")", ";", "setVariableValueToObject", "(", "mojo", ",", "\"baseDir\"", ",", "new", "File", "(", "\"\"", ")", ".", "getAbsolutePath", "(", ")", ")", ";", "setVariableValueToObject", "(", "mojo", ",", "\"output\"", ",", "\"\"", ")", ";", "setVariableValueToObject", "(", "mojo", ",", "\"comprLevel\"", ",", "-", "1", ")", ";", "setVariableValueToObject", "(", "mojo", ",", "\"mkdirs\"", ",", "true", ")", ";", "}", "}", "</s>" ]
10,868
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "listener", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "List", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "AutomatedInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Pack", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "PackFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "event", ".", "InstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "event", ".", "ProgressListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "IzPackException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "handler", ".", "AbstractUIProgressHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "AbstractProgressInstallerListener", ";", "public", "class", "TestInstallerListener", "extends", "AbstractProgressInstallerListener", "{", "private", "int", "initialiseCount", ";", "private", "int", "beforePacksCount", ";", "private", "int", "afterPacksCount", ";", "private", "int", "beforePackCount", ";", "private", "int", "afterPackCount", ";", "private", "int", "beforeDirCount", ";", "private", "int", "afterDirCount", ";", "private", "int", "beforeFileCount", ";", "private", "int", "afterFileCount", ";", "public", "TestInstallerListener", "(", "InstallData", "installData", ")", "{", "super", "(", "installData", ")", ";", "}", "public", "int", "getInitialiseCount", "(", ")", "{", "return", "initialiseCount", ";", "}", "public", "int", "getBeforePacksCount", "(", ")", "{", "return", "beforePacksCount", ";", "}", "public", "int", "getAfterPacksCount", "(", ")", "{", "return", "afterPacksCount", ";", "}", "public", "int", "getBeforePackCount", "(", ")", "{", "return", "beforePackCount", ";", "}", "public", "int", "getAfterPackCount", "(", ")", "{", "return", "afterPackCount", ";", "}", "public", "int", "getBeforeDirCount", "(", ")", "{", "return", "beforeDirCount", ";", "}", "public", "int", "getAfterDirCount", "(", ")", "{", "return", "afterDirCount", ";", "}", "public", "int", "getBeforeFileCount", "(", ")", "{", "return", "beforeFileCount", ";", "}", "public", "int", "getAfterFileCount", "(", ")", "{", "return", "afterFileCount", ";", "}", "@", "Override", "public", "void", "initialise", "(", ")", "{", "++", "initialiseCount", ";", "log", "(", "\"initialise\"", ")", ";", "}", "@", "Override", "public", "void", "beforePacks", "(", "List", "<", "Pack", ">", "packs", ")", "{", "++", "beforePacksCount", ";", "log", "(", "\"\"", "+", "packs", ".", "size", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "beforePack", "(", "Pack", "pack", ",", "int", "index", ")", "{", "++", "beforePackCount", ";", "log", "(", "\"\"", "+", "pack", ")", ";", "}", "@", "Override", "public", "void", "afterPack", "(", "Pack", "pack", ",", "int", "index", ")", "{", "++", "afterPackCount", ";", "log", "(", "\"\"", "+", "pack", ")", ";", "}", "@", "Override", "public", "void", "afterPacks", "(", "List", "<", "Pack", ">", "packs", ",", "ProgressListener", "listener", ")", "{", "++", "afterPacksCount", ";", "log", "(", "\"afterPacks\"", ")", ";", "}", "@", "Override", "public", "void", "beforeDir", "(", "File", "dir", ",", "PackFile", "packFile", ",", "Pack", "pack", ")", "{", "++", "beforeDirCount", ";", "log", "(", "\"\"", "+", "dir", ")", ";", "}", "@", "Override", "public", "void", "afterDir", "(", "File", "dir", ",", "PackFile", "packFile", ",", "Pack", "pack", ")", "{", "++", "afterDirCount", ";", "log", "(", "\"\"", "+", "dir", ")", ";", "}", "@", "Override", "public", "void", "beforeFile", "(", "File", "file", ",", "PackFile", "packFile", ",", "Pack", "pack", ")", "{", "++", "beforeFileCount", ";", "log", "(", "\"\"", "+", "file", ")", ";", "}", "@", "Override", "public", "void", "afterFile", "(", "File", "file", ",", "PackFile", "packFile", ",", "Pack", "pack", ")", "{", "++", "afterFileCount", ";", "log", "(", "\"\"", "+", "file", ")", ";", "}", "public", "void", "afterInstallerInitialization", "(", "AutomatedInstallData", "data", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "beforePacks", "(", "AutomatedInstallData", "data", ",", "Integer", "packs", ",", "AbstractUIProgressHandler", "handler", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "afterPacks", "(", "AutomatedInstallData", "data", ",", "AbstractUIProgressHandler", "handler", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "beforePack", "(", "Pack", "pack", ",", "Integer", "i", ",", "AbstractUIProgressHandler", "handler", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "afterPack", "(", "Pack", "pack", ",", "Integer", "i", ",", "AbstractUIProgressHandler", "handler", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "boolean", "isFileListener", "(", ")", "{", "return", "true", ";", "}", "public", "void", "beforeDir", "(", "File", "dir", ",", "PackFile", "packFile", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "afterDir", "(", "File", "dir", ",", "PackFile", "packFile", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "beforeFile", "(", "File", "file", ",", "PackFile", "packFile", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "afterFile", "(", "File", "file", ",", "PackFile", "packFile", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "private", "void", "log", "(", "String", "message", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "message", ")", ";", "}", "}", "</s>" ]
10,869
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "listener", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "io", ".", "ObjectInputStream", ";", "import", "java", ".", "io", ".", "ObjectOutputStream", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "List", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "event", ".", "ProgressListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "event", ".", "UninstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "IzPackException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "handler", ".", "AbstractUIProgressHandler", ";", "public", "class", "TestUninstallerListener", "implements", "UninstallerListener", "{", "private", "String", "logPath", ";", "private", "State", "state", "=", "new", "State", "(", ")", ";", "public", "static", "class", "State", "implements", "Serializable", "{", "public", "int", "initialiseCount", ";", "public", "int", "beforeListDeleteCount", ";", "public", "int", "afterListDeleteCount", ";", "public", "int", "beforeDeleteCount", ";", "public", "int", "afterDeleteCount", ";", "}", "public", "TestUninstallerListener", "(", ")", "{", "String", "installPath", "=", "getInstallPath", "(", ")", ";", "if", "(", "installPath", "!=", "null", ")", "{", "logPath", "=", "getStatePath", "(", "installPath", ")", ";", "if", "(", "logPath", "!=", "null", ")", "{", "log", "(", "\"Logging", "to:", "\"", "+", "logPath", ")", ";", "}", "}", "}", "public", "static", "String", "getStatePath", "(", "String", "installPath", ")", "{", "return", "new", "File", "(", "System", ".", "getProperty", "(", "\"\"", ")", ",", "\"\"", "+", "installPath", ".", "hashCode", "(", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "}", "public", "static", "State", "readState", "(", "String", "path", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "ObjectInputStream", "stream", "=", "new", "ObjectInputStream", "(", "new", "FileInputStream", "(", "path", ")", ")", ";", "try", "{", "return", "(", "State", ")", "stream", ".", "readObject", "(", ")", ";", "}", "finally", "{", "stream", ".", "close", "(", ")", ";", "}", "}", "@", "Override", "public", "void", "initialise", "(", ")", "{", "++", "state", ".", "initialiseCount", ";", "log", "(", "\"initialise\"", ")", ";", "}", "public", "boolean", "isFileListener", "(", ")", "{", "return", "true", ";", "}", "@", "Override", "public", "void", "beforeDelete", "(", "List", "<", "File", ">", "files", ")", "{", "++", "state", ".", "beforeListDeleteCount", ";", "log", "(", "\"\"", "+", "files", ".", "size", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "beforeDelete", "(", "File", "file", ")", "{", "++", "state", ".", "beforeDeleteCount", ";", "log", "(", "\"\"", "+", "file", ")", ";", "}", "@", "Override", "public", "void", "afterDelete", "(", "File", "file", ")", "{", "++", "state", ".", "afterDeleteCount", ";", "log", "(", "\"\"", "+", "file", ")", ";", "}", "@", "Override", "public", "void", "afterDelete", "(", "List", "<", "File", ">", "files", ",", "ProgressListener", "listener", ")", "{", "++", "state", ".", "afterListDeleteCount", ";", "log", "(", "\"\"", "+", "files", ".", "size", "(", ")", ")", ";", "}", "public", "void", "beforeDeletion", "(", "List", "files", ",", "AbstractUIProgressHandler", "handler", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "afterDeletion", "(", "List", "files", ",", "AbstractUIProgressHandler", "handler", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "beforeDelete", "(", "File", "file", ",", "AbstractUIProgressHandler", "handler", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "public", "void", "afterDelete", "(", "File", "file", ",", "AbstractUIProgressHandler", "handler", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", ")", ";", "}", "private", "void", "log", "(", "String", "message", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "message", ")", ";", "if", "(", "logPath", "!=", "null", ")", "{", "ObjectOutputStream", "stream", "=", "null", ";", "try", "{", "stream", "=", "new", "ObjectOutputStream", "(", "new", "FileOutputStream", "(", "logPath", ")", ")", ";", "stream", ".", "writeObject", "(", "state", ")", ";", "}", "catch", "(", "IOException", "exception", ")", "{", "exception", ".", "printStackTrace", "(", ")", ";", "}", "finally", "{", "if", "(", "stream", "!=", "null", ")", "{", "try", "{", "stream", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "ignore", ")", "{", "}", "}", "}", "}", "}", "private", "String", "getInstallPath", "(", ")", "{", "String", "result", "=", "null", ";", "try", "{", "InputStream", "in", "=", "getClass", "(", ")", ".", "getResourceAsStream", "(", "\"/install.log\"", ")", ";", "InputStreamReader", "inReader", "=", "new", "InputStreamReader", "(", "in", ")", ";", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "inReader", ")", ";", "result", "=", "reader", ".", "readLine", "(", ")", ";", "reader", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "exception", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", "+", "exception", ".", "getMessage", "(", ")", ")", ";", "}", "return", "result", ";", "}", "}", "</s>" ]
10,870
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "sample", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processorclient", ".", "ProcessingClient", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "validator", ".", "Validator", ";", "public", "class", "PWDValidator", "implements", "Validator", "{", "public", "boolean", "validate", "(", "ProcessingClient", "client", ")", "{", "int", "numFields", "=", "client", ".", "getNumFields", "(", ")", ";", "if", "(", "numFields", "<", "2", ")", "{", "return", "(", "true", ")", ";", "}", "boolean", "match", "=", "true", ";", "String", "content", "=", "client", ".", "getFieldContents", "(", "0", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "numFields", ";", "i", "++", ")", "{", "if", "(", "!", "content", ".", "equals", "(", "client", ".", "getFieldContents", "(", "i", ")", ")", ")", "{", "match", "=", "false", ";", "}", "}", "return", "(", "match", ")", ";", "}", "}", "</s>" ]
10,871
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "sample", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processor", ".", "Processor", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processorclient", ".", "ProcessingClient", ";", "public", "class", "Scrambler", "implements", "Processor", "{", "public", "String", "process", "(", "ProcessingClient", "client", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "client", ".", "getNumFields", "(", ")", "-", "1", ";", "i", ">", "-", "1", ";", "i", "--", ")", "{", "buffer", ".", "append", "(", "client", ".", "getFieldContents", "(", "i", ")", ")", ";", "if", "(", "i", ">", "0", ")", "{", "buffer", ".", "append", "(", "'*'", ")", ";", "}", "}", "return", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "}", "</s>" ]
10,872
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "sample", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processor", ".", "Processor", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processorclient", ".", "ProcessingClient", ";", "public", "class", "PWDEncryptor", "implements", "Processor", "{", "public", "String", "process", "(", "ProcessingClient", "client", ")", "{", "if", "(", "client", ".", "getNumFields", "(", ")", "<", "1", ")", "{", "return", "(", "\"\"", ")", ";", "}", "char", "[", "]", "password", "=", "client", ".", "getFieldContents", "(", "0", ")", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "result", "=", "new", "char", "[", "password", ".", "length", "]", ";", "int", "temp", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "password", ".", "length", ";", "i", "++", ")", "{", "temp", "=", "password", "[", "i", "]", "-", "57", ";", "if", "(", "i", ">", "0", ")", "{", "temp", "=", "temp", "+", "password", "[", "i", "-", "1", "]", ";", "}", "if", "(", "(", "temp", "%", "3", ")", "==", "0", ")", "{", "temp", "=", "temp", "+", "13", ";", "}", "if", "(", "temp", "<", "0", ")", "{", "temp", "=", "temp", "+", "193", ";", "}", "result", "[", "i", "]", "=", "(", "char", ")", "temp", ";", "}", "return", "(", "new", "String", "(", "result", ")", ")", ";", "}", "}", "</s>" ]
10,873
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "sample", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "processorclient", ".", "ProcessingClient", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "userinput", ".", "validator", ".", "Validator", ";", "public", "class", "IPValidator", "implements", "Validator", "{", "public", "boolean", "validate", "(", "ProcessingClient", "client", ")", "{", "if", "(", "client", ".", "getNumFields", "(", ")", "!=", "4", ")", "{", "return", "(", "false", ")", ";", "}", "boolean", "isIP", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "int", "value", ";", "try", "{", "value", "=", "Integer", ".", "parseInt", "(", "client", ".", "getFieldContents", "(", "i", ")", ")", ";", "if", "(", "(", "value", "<", "0", ")", "||", "(", "value", ">", "255", ")", ")", "{", "isIP", "=", "false", ";", "}", "}", "catch", "(", "Throwable", "exception", ")", "{", "isIP", "=", "false", ";", "}", "}", "return", "(", "isIP", ")", ";", "}", "}", "</s>" ]
10,874
[ "<s>", "package", "com", ".", "myCompany", ".", "tools", ".", "install", ".", "listener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "adaptator", ".", "IXMLElement", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "CompilerException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "listener", ".", "SimpleCompilerListener", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "class", "ChmodCompilerListener", "extends", "SimpleCompilerListener", "{", "public", "Map", "reviseAdditionalDataMap", "(", "Map", "existentDataMap", ",", "IXMLElement", "element", ")", "throws", "CompilerException", "{", "Map", "retval", "=", "existentDataMap", "!=", "null", "?", "existentDataMap", ":", "new", "HashMap", "(", ")", ";", "List", "<", "IXMLElement", ">", "dataList", "=", "element", ".", "getChildrenNamed", "(", "\"\"", ")", ";", "if", "(", "dataList", "==", "null", "||", "dataList", ".", "size", "(", ")", "==", "0", ")", "{", "return", "(", "existentDataMap", ")", ";", "}", "for", "(", "IXMLElement", "data", ":", "dataList", ")", "{", "String", "[", "]", "relevantKeys", "=", "{", "\"\"", ",", "\"\"", "}", ";", "for", "(", "String", "relevantKey", ":", "relevantKeys", ")", "{", "String", "key", "=", "data", ".", "getAttribute", "(", "\"key\"", ")", ";", "if", "(", "key", ".", "equalsIgnoreCase", "(", "relevantKey", ")", ")", "{", "String", "value", "=", "data", ".", "getAttribute", "(", "\"value\"", ")", ";", "if", "(", "value", "==", "null", "||", "value", ".", "length", "(", ")", "==", "0", ")", "{", "continue", ";", "}", "try", "{", "int", "radix", "=", "value", ".", "startsWith", "(", "\"0\"", ")", "?", "8", ":", "10", ";", "retval", ".", "put", "(", "key", ",", "Integer", ".", "valueOf", "(", "value", ",", "radix", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "x", ")", "{", "throw", "new", "CompilerException", "(", "\"'\"", "+", "relevantKey", "+", "\"\"", ")", ";", "}", "}", "}", "}", "return", "retval", ";", "}", "}", "</s>" ]
10,875
[ "<s>", "package", "com", ".", "myCompany", ".", "tools", ".", "install", ".", "listener", ";", "import", "java", ".", "io", ".", "File", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Pack", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "PackFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "InstallerException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "AbstractProgressInstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "FileExecutor", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "OsVersion", ";", "public", "class", "ChmodInstallerListener", "extends", "AbstractProgressInstallerListener", "{", "public", "ChmodInstallerListener", "(", "InstallData", "installData", ")", "{", "super", "(", "installData", ")", ";", "}", "@", "Override", "public", "boolean", "isFileListener", "(", ")", "{", "return", "true", ";", "}", "@", "Override", "public", "void", "afterFile", "(", "File", "filePath", ",", "PackFile", "pf", ",", "Pack", "pack", ")", "{", "if", "(", "pf", ".", "getAdditionals", "(", ")", "==", "null", ")", "{", "return", ";", "}", "Object", "file", "=", "pf", ".", "getAdditionals", "(", ")", ".", "get", "(", "\"\"", ")", ";", "int", "fileVal", "=", "-", "1", ";", "if", "(", "file", "!=", "null", "&&", "file", "instanceof", "Integer", ")", "{", "fileVal", "=", "(", "Integer", ")", "file", ";", "}", "if", "(", "fileVal", "!=", "-", "1", ")", "{", "chmod", "(", "filePath", ",", "fileVal", ")", ";", "}", "}", "@", "Override", "public", "void", "afterDir", "(", "File", "dirPath", ",", "PackFile", "pf", ",", "Pack", "pack", ")", "{", "if", "(", "pf", ".", "getAdditionals", "(", ")", "==", "null", ")", "{", "return", ";", "}", "if", "(", "dirPath", "==", "null", ")", "{", "return", ";", "}", "Object", "dir", "=", "pf", ".", "getAdditionals", "(", ")", ".", "get", "(", "\"\"", ")", ";", "int", "dirVal", "=", "-", "1", ";", "if", "(", "dir", "!=", "null", "&&", "dir", "instanceof", "Integer", ")", "{", "dirVal", "=", "(", "Integer", ")", "dir", ";", "}", "if", "(", "dirVal", "!=", "-", "1", ")", "{", "if", "(", "(", "dirVal", "&", "0x000001C0", ")", "<", "0x000001C0", ")", "{", "throw", "new", "InstallerException", "(", "\"\"", "+", "dirPath", ".", "getAbsolutePath", "(", ")", "+", "\"\"", ")", ";", "}", "chmod", "(", "dirPath", ",", "dirVal", ")", ";", "}", "}", "private", "void", "chmod", "(", "File", "path", ",", "int", "permissions", ")", "{", "String", "pathSep", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "if", "(", "OsVersion", ".", "IS_WINDOWS", ")", "{", "throw", "new", "InstallerException", "(", "\"\"", ")", ";", "}", "if", "(", "path", "==", "null", ")", "{", "return", ";", "}", "String", "permStr", "=", "Integer", ".", "toOctalString", "(", "permissions", ")", ";", "String", "[", "]", "params", "=", "{", "\"chmod\"", ",", "permStr", ",", "path", ".", "getAbsolutePath", "(", ")", "}", ";", "String", "[", "]", "output", "=", "new", "String", "[", "2", "]", ";", "FileExecutor", "fe", "=", "new", "FileExecutor", "(", ")", ";", "fe", ".", "executeCommand", "(", "params", ",", "output", ")", ";", "}", "}", "</s>" ]
10,876
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "panelaction", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "public", "class", "PreConstructPanelAction", "extends", "TestPanelAction", "{", "public", "PreConstructPanelAction", "(", "Panel", "panel", ",", "InstallData", "installData", ")", "{", "super", "(", "panel", ",", "ActionStage", ".", "preconstruct", ",", "installData", ")", ";", "}", "}", "</s>" ]
10,877
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "panelaction", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNotNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "fail", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "PanelActionConfiguration", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "handler", ".", "AbstractUIHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "installer", ".", "DataValidator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "data", ".", "PanelAction", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "datavalidator", ".", "TestDataValidator", ";", "public", "class", "TestPanelAction", "extends", "TestDataValidator", "implements", "PanelAction", "{", "private", "final", "ActionStage", "stage", ";", "public", "TestPanelAction", "(", "Panel", "panel", ",", "ActionStage", "stage", ",", "InstallData", "installData", ")", "{", "super", "(", "panel", ",", "installData", ")", ";", "this", ".", "stage", "=", "stage", ";", "}", "public", "static", "int", "getPreConstruct", "(", "String", "panelId", ",", "InstallData", "installData", ")", "{", "return", "getValue", "(", "panelId", "+", "\".\"", "+", "ActionStage", ".", "preconstruct", ",", "installData", ")", ";", "}", "public", "static", "int", "getPreActivate", "(", "String", "panelId", ",", "InstallData", "installData", ")", "{", "return", "getValue", "(", "panelId", "+", "\".\"", "+", "ActionStage", ".", "preactivate", ",", "installData", ")", ";", "}", "public", "static", "int", "getPreValidate", "(", "String", "panelId", ",", "InstallData", "installData", ")", "{", "return", "getValue", "(", "panelId", "+", "\".\"", "+", "ActionStage", ".", "prevalidate", ",", "installData", ")", ";", "}", "public", "static", "int", "getPostValidate", "(", "String", "panelId", ",", "InstallData", "installData", ")", "{", "return", "getValue", "(", "panelId", "+", "\".\"", "+", "ActionStage", ".", "postvalidate", ",", "installData", ")", ";", "}", "@", "Override", "public", "void", "executeAction", "(", "InstallData", "installData", ",", "AbstractUIHandler", "handler", ")", "{", "String", "id", "=", "getPanelId", "(", ")", ";", "if", "(", "stage", "==", "ActionStage", ".", "preconstruct", ")", "{", "assertNull", "(", "handler", ")", ";", "}", "else", "{", "assertNotNull", "(", "handler", ")", ";", "}", "String", "variable", "=", "id", "+", "\".\"", "+", "stage", ";", "int", "value", "=", "increment", "(", "variable", ")", ";", "System", ".", "err", ".", "println", "(", "\"\"", "+", "variable", "+", "\"=\"", "+", "value", "+", "\",", "thread=\"", "+", "Thread", ".", "currentThread", "(", ")", ".", "getName", "(", ")", ")", ";", "int", "preConstruct", "=", "getPreConstruct", "(", ")", ";", "int", "preActivate", "=", "getPreActivate", "(", ")", ";", "int", "preValidate", "=", "getPreValidate", "(", ")", ";", "int", "validate", "=", "getValidate", "(", ")", ";", "int", "postValidate", "=", "getPostValidate", "(", ")", ";", "switch", "(", "stage", ")", "{", "case", "preconstruct", ":", "assertEquals", "(", "1", ",", "preConstruct", ")", ";", "assertEquals", "(", "0", ",", "preActivate", ")", ";", "assertEquals", "(", "0", ",", "preValidate", ")", ";", "assertEquals", "(", "0", ",", "validate", ")", ";", "assertEquals", "(", "0", ",", "postValidate", ")", ";", "break", ";", "case", "preactivate", ":", "assertEquals", "(", "1", ",", "preConstruct", ")", ";", "assertEquals", "(", "1", ",", "preActivate", ")", ";", "assertEquals", "(", "0", ",", "preValidate", ")", ";", "assertEquals", "(", "0", ",", "validate", ")", ";", "assertEquals", "(", "0", ",", "postValidate", ")", ";", "break", ";", "case", "prevalidate", ":", "assertEquals", "(", "1", ",", "preConstruct", ")", ";", "assertEquals", "(", "1", ",", "preActivate", ")", ";", "assertTrue", "(", "preValidate", ">=", "1", ")", ";", "assertEquals", "(", "preValidate", "-", "1", ",", "validate", ")", ";", "assertEquals", "(", "preValidate", "-", "1", ",", "postValidate", ")", ";", "break", ";", "case", "postvalidate", ":", "assertEquals", "(", "1", ",", "preConstruct", ")", ";", "assertEquals", "(", "1", ",", "preActivate", ")", ";", "assertTrue", "(", "preValidate", ">=", "1", ")", ";", "assertEquals", "(", "preValidate", ",", "validate", ")", ";", "assertEquals", "(", "preValidate", ",", "postValidate", ")", ";", "break", ";", "default", ":", "fail", "(", "\"\"", "+", "stage", ")", ";", "}", "}", "@", "Override", "public", "Status", "validateData", "(", "InstallData", "installData", ")", "{", "Status", "status", "=", "super", ".", "validateData", "(", "installData", ")", ";", "int", "preConstruct", "=", "getPreConstruct", "(", ")", ";", "int", "preActivate", "=", "getPreActivate", "(", ")", ";", "int", "preValidate", "=", "getPreValidate", "(", ")", ";", "int", "validate", "=", "getValidate", "(", ")", ";", "int", "postValidate", "=", "getPostValidate", "(", ")", ";", "assertEquals", "(", "1", ",", "preConstruct", ")", ";", "assertEquals", "(", "1", ",", "preActivate", ")", ";", "assertTrue", "(", "preValidate", ">=", "1", ")", ";", "assertEquals", "(", "preValidate", ",", "validate", ")", ";", "assertEquals", "(", "preValidate", "-", "1", ",", "postValidate", ")", ";", "return", "status", ";", "}", "@", "Override", "public", "void", "initialize", "(", "PanelActionConfiguration", "configuration", ")", "{", "if", "(", "configuration", "!=", "null", ")", "{", "String", "prefix", "=", "getPanelId", "(", ")", "+", "\".\"", "+", "stage", ".", "toString", "(", ")", ".", "toLowerCase", "(", ")", "+", "\".config.\"", ";", "InstallData", "installData", "=", "getInstallData", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "entry", ":", "configuration", ".", "getProperties", "(", ")", ".", "entrySet", "(", ")", ")", "{", "installData", ".", "setVariable", "(", "prefix", "+", "entry", ".", "getKey", "(", ")", ",", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "}", "private", "int", "getPreConstruct", "(", ")", "{", "return", "getValue", "(", "getPanelId", "(", ")", "+", "\".\"", "+", "ActionStage", ".", "preconstruct", ")", ";", "}", "private", "int", "getPreActivate", "(", ")", "{", "return", "getValue", "(", "getPanelId", "(", ")", "+", "\".\"", "+", "ActionStage", ".", "preactivate", ")", ";", "}", "private", "int", "getPreValidate", "(", ")", "{", "return", "getValue", "(", "getPanelId", "(", ")", "+", "\".\"", "+", "ActionStage", ".", "prevalidate", ")", ";", "}", "private", "int", "getPostValidate", "(", ")", "{", "return", "getValue", "(", "getPanelId", "(", ")", "+", "\".\"", "+", "ActionStage", ".", "postvalidate", ")", ";", "}", "}", "</s>" ]
10,878
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "panelaction", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "public", "class", "PostValidatePanelAction", "extends", "TestPanelAction", "{", "public", "PostValidatePanelAction", "(", "Panel", "panel", ",", "InstallData", "installData", ")", "{", "super", "(", "panel", ",", "ActionStage", ".", "postvalidate", ",", "installData", ")", ";", "}", "}", "</s>" ]
10,879
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "panelaction", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "public", "class", "PreActivatePanelAction", "extends", "TestPanelAction", "{", "public", "PreActivatePanelAction", "(", "Panel", "panel", ",", "InstallData", "installData", ")", "{", "super", "(", "panel", ",", "ActionStage", ".", "preactivate", ",", "installData", ")", ";", "}", "}", "</s>" ]
10,880
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "panelaction", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertFalse", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNotNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "fest", ".", "swing", ".", "core", ".", "matcher", ".", "JButtonMatcher", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "DialogFixture", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "FrameFixture", ";", "import", "org", ".", "fest", ".", "swing", ".", "timing", ".", "Timeout", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Rule", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "rules", ".", "TemporaryFolder", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "GuiId", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "PanelActionConfiguration", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "binding", ".", "ActionStage", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "data", ".", "PanelAction", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerController", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "IzPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "IzPanels", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "HelperTestMethod", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "hello", ".", "HelloPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "simplefinish", ".", "SimpleFinishPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "util", ".", "TestHousekeeper", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "PanelActionTest", "{", "@", "Rule", "public", "TemporaryFolder", "temporaryFolder", "=", "new", "TemporaryFolder", "(", ")", ";", "private", "final", "InstallData", "installData", ";", "private", "final", "InstallerFrame", "frame", ";", "private", "final", "InstallerController", "controller", ";", "private", "final", "TestHousekeeper", "housekeeper", ";", "private", "final", "IzPanels", "panels", ";", "private", "FrameFixture", "frameFixture", ";", "public", "PanelActionTest", "(", "InstallData", "installData", ",", "InstallerFrame", "frame", ",", "InstallerController", "controller", ",", "TestHousekeeper", "housekeeper", ",", "IzPanels", "panels", ")", "{", "this", ".", "installData", "=", "installData", ";", "this", ".", "frame", "=", "frame", ";", "this", ".", "controller", "=", "controller", ";", "this", ".", "housekeeper", "=", "housekeeper", ";", "this", ".", "panels", "=", "panels", ";", "}", "@", "Before", "public", "void", "setUp", "(", ")", "{", "File", "installPath", "=", "new", "File", "(", "temporaryFolder", ".", "getRoot", "(", ")", ",", "\"izpackTest\"", ")", ";", "assertTrue", "(", "installPath", ".", "mkdirs", "(", ")", ")", ";", "installData", ".", "setInstallPath", "(", "installPath", ".", "getAbsolutePath", "(", ")", ")", ";", "}", "@", "After", "public", "void", "tearDown", "(", ")", "{", "if", "(", "frameFixture", "!=", "null", ")", "{", "frameFixture", ".", "cleanUp", "(", ")", ";", "}", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testPanelActions", "(", ")", "throws", "Exception", "{", "assertEquals", "(", "3", ",", "panels", ".", "getPanels", "(", ")", ".", "size", "(", ")", ")", ";", "Panel", "hello1", "=", "panels", ".", "getPanels", "(", ")", ".", "get", "(", "0", ")", ";", "Panel", "hello2", "=", "panels", ".", "getPanels", "(", ")", ".", "get", "(", "1", ")", ";", "Panel", "finish", "=", "panels", ".", "getPanels", "(", ")", ".", "get", "(", "2", ")", ";", "checkActions", "(", "hello1", ",", "PreConstructPanelAction", ".", "class", ",", "PreActivatePanelAction", ".", "class", ",", "PreValidatePanelAction", ".", "class", ",", "PostValidatePanelAction", ".", "class", ")", ";", "checkActions", "(", "hello2", ",", "TestPanelAction", ".", "class", ",", "TestPanelAction", ".", "class", ",", "TestPanelAction", ".", "class", ",", "TestPanelAction", ".", "class", ")", ";", "checkActions", "(", "finish", ",", "PreConstructPanelAction", ".", "class", ",", "PreActivatePanelAction", ".", "class", ",", "PreValidatePanelAction", ".", "class", ",", "PostValidatePanelAction", ".", "class", ")", ";", "checkActionInvocations", "(", "\"HelloPanel1\"", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0", ")", ";", "frameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "frame", ",", "controller", ")", ";", "checkActionsConfiguration", "(", "hello1", ")", ";", "checkActionInvocations", "(", "\"HelloPanel1\"", ",", "1", ",", "1", ",", "0", ",", "0", ",", "0", ")", ";", "Thread", ".", "sleep", "(", "2000", ")", ";", "checkCurrentPanel", "(", "HelloPanel", ".", "class", ")", ";", "installData", ".", "setVariable", "(", "\"\"", ",", "\"ERROR\"", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "checkDialog", "(", "\"\"", ")", ";", "checkActionInvocations", "(", "\"HelloPanel1\"", ",", "1", ",", "1", ",", "1", ",", "1", ",", "1", ")", ";", "installData", ".", "setVariable", "(", "\"\"", ",", "\"WARNING\"", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "checkDialog", "(", "\"\"", ")", ";", "checkActionInvocations", "(", "\"HelloPanel1\"", ",", "1", ",", "1", ",", "2", ",", "2", ",", "2", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkCurrentPanel", "(", "HelloPanel", ".", "class", ")", ";", "installData", ".", "setVariable", "(", "\"\"", ",", "\"OK\"", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "checkActionInvocations", "(", "\"HelloPanel2\"", ",", "1", ",", "1", ",", "1", ",", "1", ",", "1", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkCurrentPanel", "(", "SimpleFinishPanel", ".", "class", ")", ";", "checkActionInvocations", "(", "\"\"", ",", "1", ",", "1", ",", "0", ",", "0", ",", "0", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_QUIT", ".", "id", ")", ".", "click", "(", ")", ";", "checkActionInvocations", "(", "\"\"", ",", "1", ",", "1", ",", "0", ",", "0", ",", "0", ")", ";", "housekeeper", ".", "waitShutdown", "(", "2", "*", "60", "*", "1000", ")", ";", "assertTrue", "(", "housekeeper", ".", "hasShutdown", "(", ")", ")", ";", "assertEquals", "(", "0", ",", "housekeeper", ".", "getExitCode", "(", ")", ")", ";", "assertFalse", "(", "housekeeper", ".", "getReboot", "(", ")", ")", ";", "}", "private", "void", "checkCurrentPanel", "(", "Class", "<", "?", "extends", "IzPanel", ">", "type", ")", "{", "Panel", "panel", "=", "panels", ".", "getPanel", "(", ")", ";", "assertEquals", "(", "type", ".", "getName", "(", ")", ",", "panel", ".", "getClassName", "(", ")", ")", ";", "}", "private", "void", "checkActionInvocations", "(", "String", "panelId", ",", "int", "preConstruct", ",", "int", "preActivate", ",", "int", "preValidate", ",", "int", "validate", ",", "int", "postValidate", ")", "{", "try", "{", "Thread", ".", "sleep", "(", "2000", ")", ";", "}", "catch", "(", "InterruptedException", "ignore", ")", "{", "}", "assertEquals", "(", "preConstruct", ",", "TestPanelAction", ".", "getPreConstruct", "(", "panelId", ",", "installData", ")", ")", ";", "assertEquals", "(", "preActivate", ",", "TestPanelAction", ".", "getPreActivate", "(", "panelId", ",", "installData", ")", ")", ";", "assertEquals", "(", "preValidate", ",", "TestPanelAction", ".", "getPreValidate", "(", "panelId", ",", "installData", ")", ")", ";", "assertEquals", "(", "validate", ",", "TestPanelAction", ".", "getValidate", "(", "panelId", ",", "installData", ")", ")", ";", "assertEquals", "(", "postValidate", ",", "TestPanelAction", ".", "getPostValidate", "(", "panelId", ",", "installData", ")", ")", ";", "}", "private", "void", "checkActions", "(", "Panel", "panel", ",", "Class", "preConstruction", ",", "Class", "preActivation", ",", "Class", "preValidation", ",", "Class", "postValidation", ")", "{", "checkAction", "(", "panel", ".", "getPreConstructionActions", "(", ")", ",", "preConstruction", ")", ";", "checkAction", "(", "panel", ".", "getPreActivationActions", "(", ")", ",", "preActivation", ")", ";", "checkAction", "(", "panel", ".", "getPreValidationActions", "(", ")", ",", "preValidation", ")", ";", "checkAction", "(", "panel", ".", "getPostValidationActions", "(", ")", ",", "postValidation", ")", ";", "}", "private", "void", "checkAction", "(", "List", "<", "PanelActionConfiguration", ">", "actions", ",", "Class", "type", ")", "{", "assertNotNull", "(", "actions", ")", ";", "assertEquals", "(", "1", ",", "actions", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "type", ".", "getName", "(", ")", ",", "actions", ".", "get", "(", "0", ")", ".", "getActionClassName", "(", ")", ")", ";", "}", "private", "void", "checkActionsConfiguration", "(", "Panel", "panel", ")", "{", "checkActionConfiguration", "(", "panel", ".", "getPanelId", "(", ")", ",", "ActionStage", ".", "PRECONSTRUCT", ")", ";", "checkActionConfiguration", "(", "panel", ".", "getPanelId", "(", ")", ",", "ActionStage", ".", "PREACTIVATE", ")", ";", "checkActionConfiguration", "(", "panel", ".", "getPanelId", "(", ")", ",", "ActionStage", ".", "PREVALIDATE", ",", "\"prop1\"", ",", "\"value1\"", ")", ";", "checkActionConfiguration", "(", "panel", ".", "getPanelId", "(", ")", ",", "ActionStage", ".", "POSTVALIDATE", ",", "\"prop2\"", ",", "\"value2\"", ",", "\"prop3\"", ",", "\"value3\"", ")", ";", "}", "private", "void", "checkActionConfiguration", "(", "String", "panelId", ",", "ActionStage", "stage", ",", "String", "...", "properties", ")", "{", "String", "prefix", "=", "panelId", "+", "\".\"", "+", "stage", ".", "toString", "(", ")", ".", "toLowerCase", "(", ")", "+", "\".config.\"", ";", "if", "(", "properties", ".", "length", "==", "0", ")", "{", "Set", "<", "Object", ">", "keys", "=", "installData", ".", "getVariables", "(", ")", ".", "getProperties", "(", ")", ".", "keySet", "(", ")", ";", "for", "(", "Object", "key", ":", "keys", ")", "{", "assertFalse", "(", "key", ".", "toString", "(", ")", ".", "startsWith", "(", "prefix", ")", ")", ";", "}", "}", "else", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "properties", ".", "length", ";", "i", "++", ")", "{", "String", "name", "=", "prefix", "+", "properties", "[", "i", "]", ";", "String", "value", "=", "properties", "[", "++", "i", "]", ";", "assertEquals", "(", "value", ",", "installData", ".", "getVariable", "(", "name", ")", ")", ";", "}", "}", "}", "private", "void", "checkDialog", "(", "String", "text", ")", "{", "DialogFixture", "dialog", "=", "frameFixture", ".", "dialog", "(", "Timeout", ".", "timeout", "(", "10000", ")", ")", ";", "assertEquals", "(", "text", ",", "dialog", ".", "label", "(", "\"\"", ")", ".", "text", "(", ")", ")", ";", "dialog", ".", "button", "(", "JButtonMatcher", ".", "withText", "(", "\"OK\"", ")", ")", ".", "click", "(", ")", ";", "}", "}", "</s>" ]
10,881
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "panelaction", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "public", "class", "PreValidatePanelAction", "extends", "TestPanelAction", "{", "public", "PreValidatePanelAction", "(", "Panel", "panel", ",", "InstallData", "installData", ")", "{", "super", "(", "panel", ",", "ActionStage", ".", "prevalidate", ",", "installData", ")", ";", "}", "}", "</s>" ]
10,882
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "java", ".", "io", ".", "File", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Rule", ";", "import", "org", ".", "junit", ".", "rules", ".", "TemporaryFolder", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "public", "class", "AbstractInstallationTest", "{", "@", "Rule", "public", "TemporaryFolder", "temporaryFolder", "=", "new", "TemporaryFolder", "(", ")", ";", "private", "InstallData", "installData", ";", "public", "AbstractInstallationTest", "(", "InstallData", "installData", ")", "{", "this", ".", "installData", "=", "installData", ";", "}", "@", "Before", "public", "void", "setUp", "(", ")", "throws", "Exception", "{", "File", "installPath", "=", "new", "File", "(", "temporaryFolder", ".", "getRoot", "(", ")", ",", "\"izpackTest\"", ")", ";", "installData", ".", "setInstallPath", "(", "installPath", ".", "getAbsolutePath", "(", ")", ")", ";", "installData", ".", "setDefaultInstallPath", "(", "installPath", ".", "getAbsolutePath", "(", ")", ")", ";", "}", "protected", "String", "getInstallPath", "(", ")", "{", "return", "installData", ".", "getInstallPath", "(", ")", ";", "}", "protected", "InstallData", "getInstallData", "(", ")", "{", "return", "installData", ";", "}", "}", "</s>" ]
10,883
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "static", "org", ".", "hamcrest", ".", "MatcherAssert", ".", "assertThat", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNotNull", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "hamcrest", ".", "core", ".", "Is", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "data", ".", "CustomData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "RegistryInstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "RegistryUninstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "SummaryLoggerInstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "UninstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "event", ".", "InstallerListeners", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "EventTest", "{", "private", "final", "InstallerListeners", "listeners", ";", "private", "final", "UninstallData", "uninstallData", ";", "public", "EventTest", "(", "InstallerListeners", "listeners", ",", "UninstallData", "uninstallData", ")", "{", "this", ".", "listeners", "=", "listeners", ";", "this", ".", "uninstallData", "=", "uninstallData", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "eventInitialization", "(", ")", "throws", "Exception", "{", "assertThat", "(", "listeners", ".", "size", "(", ")", ",", "Is", ".", "is", "(", "2", ")", ")", ";", "assertThat", "(", "listeners", ".", "get", "(", "0", ")", ",", "Is", ".", "is", "(", "SummaryLoggerInstallerListener", ".", "class", ")", ")", ";", "assertThat", "(", "listeners", ".", "get", "(", "1", ")", ",", "Is", ".", "is", "(", "RegistryInstallerListener", ".", "class", ")", ")", ";", "List", "<", "CustomData", ">", "uninstallListeners", "=", "uninstallData", ".", "getUninstallerListeners", "(", ")", ";", "assertNotNull", "(", "uninstallListeners", ")", ";", "assertThat", "(", "uninstallListeners", ".", "size", "(", ")", ",", "Is", ".", "is", "(", "1", ")", ")", ";", "CustomData", "customData", "=", "uninstallListeners", ".", "get", "(", "0", ")", ";", "assertEquals", "(", "RegistryUninstallerListener", ".", "class", ".", "getName", "(", ")", ",", "customData", ".", "listenerName", ")", ";", "}", "}", "</s>" ]
10,884
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "static", "org", ".", "hamcrest", ".", "MatcherAssert", ".", "assertThat", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "apache", ".", "commons", ".", "lang", ".", "StringUtils", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "DialogFixture", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "FrameFixture", ";", "import", "org", ".", "fest", ".", "swing", ".", "timing", ".", "Timeout", ";", "import", "org", ".", "hamcrest", ".", "collection", ".", "IsCollectionContaining", ";", "import", "org", ".", "hamcrest", ".", "core", ".", "Is", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Rule", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "rules", ".", "TemporaryFolder", ";", "import", "org", ".", "junit", ".", "rules", ".", "TestRule", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "GuiId", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "NativeLibException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "core", ".", "os", ".", "RegistryDefaultHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "core", ".", "os", ".", "RegistryHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "GUIInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerController", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "language", ".", "LanguageDialog", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "OsVersion", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "IzpackInstallationTest", "{", "@", "Rule", "public", "TemporaryFolder", "temporaryFolder", "=", "new", "TemporaryFolder", "(", ")", ";", "@", "Rule", "public", "TestRule", "globalTimeout", "=", "new", "org", ".", "junit", ".", "rules", ".", "Timeout", "(", "HelperTestMethod", ".", "TIMEOUT", ")", ";", "private", "DialogFixture", "dialogFrameFixture", ";", "private", "FrameFixture", "installerFrameFixture", ";", "private", "LanguageDialog", "languageDialog", ";", "private", "InstallerFrame", "installerFrame", ";", "private", "GUIInstallData", "installData", ";", "private", "InstallerController", "installerController", ";", "private", "RegistryDefaultHandler", "handler", ";", "public", "IzpackInstallationTest", "(", "LanguageDialog", "languageDialog", ",", "InstallerFrame", "installerFrame", ",", "GUIInstallData", "installData", ",", "InstallerController", "installerController", ",", "RegistryDefaultHandler", "handler", ")", "{", "this", ".", "installerController", "=", "installerController", ";", "this", ".", "languageDialog", "=", "languageDialog", ";", "this", ".", "installData", "=", "installData", ";", "this", ".", "installerFrame", "=", "installerFrame", ";", "this", ".", "handler", "=", "handler", ";", "}", "@", "Before", "public", "void", "setUp", "(", ")", "throws", "NativeLibException", "{", "RegistryHandler", "registry", "=", "handler", ".", "getInstance", "(", ")", ";", "if", "(", "registry", "!=", "null", ")", "{", "String", "uninstallName", "=", "registry", ".", "getUninstallName", "(", ")", ";", "if", "(", "!", "StringUtils", ".", "isEmpty", "(", "uninstallName", ")", ")", "{", "registry", ".", "setRoot", "(", "RegistryHandler", ".", "HKEY_LOCAL_MACHINE", ")", ";", "String", "key", "=", "RegistryHandler", ".", "UNINSTALL_ROOT", "+", "uninstallName", ";", "if", "(", "registry", ".", "keyExist", "(", "key", ")", ")", "{", "registry", ".", "deleteKey", "(", "key", ")", ";", "}", "}", "}", "}", "@", "After", "public", "void", "tearBinding", "(", ")", "throws", "NoSuchFieldException", ",", "IllegalAccessException", "{", "try", "{", "if", "(", "dialogFrameFixture", "!=", "null", ")", "{", "dialogFrameFixture", ".", "cleanUp", "(", ")", ";", "dialogFrameFixture", "=", "null", ";", "}", "}", "finally", "{", "if", "(", "installerFrameFixture", "!=", "null", ")", "{", "installerFrameFixture", ".", "cleanUp", "(", ")", ";", "installerFrameFixture", "=", "null", ";", "}", "}", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testIzpackInstallation", "(", ")", "throws", "Exception", "{", "File", "installPath", "=", "new", "File", "(", "temporaryFolder", ".", "getRoot", "(", ")", ",", "\"izpackTest\"", ")", ";", "installData", ".", "setInstallPath", "(", "installPath", ".", "getAbsolutePath", "(", ")", ")", ";", "installData", ".", "setDefaultInstallPath", "(", "installPath", ".", "getAbsolutePath", "(", ")", ")", ";", "HelperTestMethod", ".", "clickDefaultLang", "(", "languageDialog", ")", ";", "installerFrameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "installerFrame", ",", "installerController", ")", ";", "Thread", ".", "sleep", "(", "600", ")", ";", "Thread", ".", "sleep", "(", "600", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "radioButton", "(", "GuiId", ".", "LICENCE_YES_RADIO", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "optionPane", "(", "Timeout", ".", "timeout", "(", "1000", ")", ")", ".", "focus", "(", ")", ";", "installerFrameFixture", ".", "optionPane", "(", ")", ".", "requireWarningMessage", "(", ")", ";", "installerFrameFixture", ".", "optionPane", "(", ")", ".", "okButton", "(", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "HelperTestMethod", ".", "waitAndCheckInstallation", "(", "installData", ",", "installPath", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "if", "(", "!", "OsVersion", ".", "IS_MAC", ")", "{", "Thread", ".", "sleep", "(", "1000", ")", ";", "installerFrameFixture", ".", "checkBox", "(", "GuiId", ".", "SHORTCUT_CREATE_CHECK_BOX", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "}", "Thread", ".", "sleep", "(", "1000", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_QUIT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkIzpackInstallation", "(", "installPath", ")", ";", "File", "uninstaller", "=", "UninstallHelper", ".", "getUninstallerJar", "(", "installData", ")", ";", "UninstallHelper", ".", "guiUninstall", "(", "uninstaller", ")", ";", "}", "private", "void", "checkIzpackInstallation", "(", "File", "installPath", ")", "{", "List", "<", "String", ">", "paths", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "File", "[", "]", "files", "=", "installPath", ".", "listFiles", "(", ")", ";", "if", "(", "files", "!=", "null", ")", "{", "for", "(", "File", "file", ":", "files", ")", "{", "paths", ".", "add", "(", "file", ".", "getName", "(", ")", ")", ";", "}", "}", "assertThat", "(", "paths", ",", "IsCollectionContaining", ".", "hasItems", "(", "Is", ".", "is", "(", "\"bin\"", ")", ",", "Is", ".", "is", "(", "\"legal\"", ")", ",", "Is", ".", "is", "(", "\"lib\"", ")", ")", ")", ";", "}", "}", "</s>" ]
10,885
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "static", "org", ".", "hamcrest", ".", "MatcherAssert", ".", "assertThat", ";", "import", "java", ".", "awt", ".", "Image", ";", "import", "java", ".", "io", ".", "File", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "FrameFixture", ";", "import", "org", ".", "hamcrest", ".", "core", ".", "Is", ";", "import", "org", ".", "hamcrest", ".", "core", ".", "IsNull", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Ignore", ";", "import", "org", ".", "junit", ".", "Rule", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "rules", ".", "TestRule", ";", "import", "org", ".", "junit", ".", "rules", ".", "Timeout", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "GuiId", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "gui", ".", "IconsDatabase", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "container", ".", "impl", ".", "InstallerContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "GUIInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerController", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "language", ".", "LanguageDialog", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "hello", ".", "HelloPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "InstallationTest", "{", "@", "Rule", "public", "TestRule", "globalTimeout", "=", "new", "Timeout", "(", "HelperTestMethod", ".", "TIMEOUT", ")", ";", "private", "FrameFixture", "installerFrameFixture", ";", "private", "IconsDatabase", "icons", ";", "private", "LanguageDialog", "languageDialog", ";", "private", "InstallerFrame", "installerFrame", ";", "private", "GUIInstallData", "installData", ";", "private", "InstallerController", "installerController", ";", "private", "InstallerContainer", "installerContainer", ";", "public", "InstallationTest", "(", "IconsDatabase", "icons", ",", "LanguageDialog", "languageDialog", ",", "InstallerFrame", "installerFrame", ",", "GUIInstallData", "installData", ",", "InstallerController", "installerController", ",", "InstallerContainer", "installerContainer", ")", "{", "this", ".", "installerController", "=", "installerController", ";", "this", ".", "icons", "=", "icons", ";", "this", ".", "languageDialog", "=", "languageDialog", ";", "this", ".", "installData", "=", "installData", ";", "this", ".", "installerFrame", "=", "installerFrame", ";", "this", ".", "installerContainer", "=", "installerContainer", ";", "}", "@", "After", "public", "void", "tearBinding", "(", ")", "throws", "NoSuchFieldException", ",", "IllegalAccessException", "{", "if", "(", "installerFrameFixture", "!=", "null", ")", "{", "installerFrameFixture", ".", "cleanUp", "(", ")", ";", "installerFrameFixture", "=", "null", ";", "}", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testHelloAndFinishPanels", "(", ")", "throws", "Exception", "{", "Image", "image", "=", "icons", ".", "get", "(", "\"JFrameIcon\"", ")", ".", "getImage", "(", ")", ";", "assertThat", "(", "image", ",", "IsNull", ".", "<", "Object", ">", "notNullValue", "(", ")", ")", ";", "languageDialog", ".", "initLangPack", "(", ")", ";", "installerFrameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "installerFrame", ",", "installerController", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "requireVisible", "(", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testMultiplePanels", "(", ")", "throws", "Exception", "{", "installerController", ".", "buildInstallation", "(", ")", ";", "HelloPanel", "firstHelloPanel", "=", "(", "HelloPanel", ")", "installerContainer", ".", "getComponent", "(", "\"42\"", ")", ";", "assertThat", "(", "firstHelloPanel", ".", "getMetadata", "(", ")", ".", "getPanelId", "(", ")", ",", "Is", ".", "is", "(", "\"42\"", ")", ")", ";", "HelloPanel", "secondHelloPanel", "=", "(", "HelloPanel", ")", "installerContainer", ".", "getComponent", "(", "\"34\"", ")", ";", "assertThat", "(", "secondHelloPanel", ".", "getMetadata", "(", ")", ".", "getPanelId", "(", ")", ",", "Is", ".", "is", "(", "\"34\"", ")", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testPanelConfiguration", "(", ")", "throws", "Exception", "{", "installerController", ".", "buildInstallation", "(", ")", ";", "HelloPanel", "helloPanel", "=", "(", "HelloPanel", ")", "installerContainer", ".", "getComponent", "(", "\"hellopanel\"", ")", ";", "assertThat", "(", "helloPanel", ".", "getMetadata", "(", ")", ".", "getConfiguration", "(", "\"config1\"", ")", ",", "Is", ".", "is", "(", "\"value1\"", ")", ")", ";", "assertThat", "(", "helloPanel", ".", "getMetadata", "(", ")", ".", "getConfiguration", "(", "\"config2\"", ")", ",", "Is", ".", "is", "(", "\"value2\"", ")", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testSubstanceLaf", "(", ")", "throws", "Exception", "{", "languageDialog", ".", "initLangPack", "(", ")", ";", "installerFrameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "installerFrame", ",", "installerController", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "requireVisible", "(", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testSilverpeas", "(", ")", "throws", "Exception", "{", "languageDialog", ".", "initLangPack", "(", ")", ";", "installerFrameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "installerFrame", ",", "installerController", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "requireVisible", "(", ")", ";", "}", "@", "Test", "@", "Ignore", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testHelloAndFinishPanelsCompressed", "(", ")", "throws", "Exception", "{", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testBasicInstall", "(", ")", "throws", "Exception", "{", "File", "installPath", "=", "HelperTestMethod", ".", "prepareInstallation", "(", "installData", ")", ";", "HelperTestMethod", ".", "clickDefaultLang", "(", "languageDialog", ")", ";", "installerFrameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "installerFrame", ",", "installerController", ")", ";", "Thread", ".", "sleep", "(", "600", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "600", ")", ";", "installerFrameFixture", ".", "textBox", "(", "GuiId", ".", "INFO_PANEL_TEXT_AREA", ".", "id", ")", ".", "requireText", "(", "\"\"", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_PREV", ".", "id", ")", ".", "requireVisible", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_PREV", ".", "id", ")", ".", "requireEnabled", "(", ")", ";", "Thread", ".", "sleep", "(", "300", ")", ";", "installerFrameFixture", ".", "textBox", "(", "GuiId", ".", "LICENCE_TEXT_AREA", ".", "id", ")", ".", "requireText", "(", "\"\"", ")", ";", "installerFrameFixture", ".", "radioButton", "(", "GuiId", ".", "LICENCE_NO_RADIO", ".", "id", ")", ".", "requireSelected", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "requireDisabled", "(", ")", ";", "installerFrameFixture", ".", "radioButton", "(", "GuiId", ".", "LICENCE_YES_RADIO", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "300", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "installerFrameFixture", ".", "optionPane", "(", ")", ".", "requireWarningMessage", "(", ")", ";", "installerFrameFixture", ".", "optionPane", "(", ")", ".", "okButton", "(", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "300", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "HelperTestMethod", ".", "waitAndCheckInstallation", "(", "installData", ",", "installPath", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "FINISH_PANEL_AUTO_BUTTON", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "800", ")", ";", "installerFrameFixture", ".", "fileChooser", "(", "GuiId", ".", "FINISH_PANEL_FILE_CHOOSER", ".", "id", ")", ".", "fileNameTextBox", "(", ")", ".", "enterText", "(", "\"auto.xml\"", ")", ";", "Thread", ".", "sleep", "(", "300", ")", ";", "installerFrameFixture", ".", "fileChooser", "(", "GuiId", ".", "FINISH_PANEL_FILE_CHOOSER", ".", "id", ")", ".", "approve", "(", ")", ";", "assertThat", "(", "new", "File", "(", "installPath", ",", "\"auto.xml\"", ")", ".", "exists", "(", ")", ",", "Is", ".", "is", "(", "true", ")", ")", ";", "}", "}", "</s>" ]
10,886
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "datavalidator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "installer", ".", "DataValidator", ";", "public", "class", "TestDataValidator", "implements", "DataValidator", "{", "private", "final", "Panel", "panel", ";", "private", "final", "InstallData", "installData", ";", "public", "TestDataValidator", "(", "Panel", "panel", ",", "InstallData", "installData", ")", "{", "this", ".", "installData", "=", "installData", ";", "this", ".", "panel", "=", "panel", ";", "}", "public", "static", "int", "getValidate", "(", "String", "panelId", ",", "InstallData", "installData", ")", "{", "return", "getValue", "(", "panelId", "+", "\".validate\"", ",", "installData", ")", ";", "}", "@", "Override", "public", "Status", "validateData", "(", "InstallData", "installData", ")", "{", "String", "id", "=", "getPanelId", "(", ")", ";", "String", "status", "=", "installData", ".", "getVariable", "(", "id", "+", "\".status\"", ")", ";", "increment", "(", "id", "+", "\".validate\"", ")", ";", "return", "(", "status", "!=", "null", ")", "?", "Status", ".", "valueOf", "(", "status", ")", ":", "Status", ".", "ERROR", ";", "}", "@", "Override", "public", "String", "getErrorMessageId", "(", ")", "{", "return", "getPanelId", "(", ")", "+", "\".error\"", ";", "}", "@", "Override", "public", "String", "getWarningMessageId", "(", ")", "{", "return", "getPanelId", "(", ")", "+", "\".warning\"", ";", "}", "@", "Override", "public", "boolean", "getDefaultAnswer", "(", ")", "{", "return", "false", ";", "}", "protected", "InstallData", "getInstallData", "(", ")", "{", "return", "installData", ";", "}", "protected", "String", "getPanelId", "(", ")", "{", "return", "panel", ".", "getPanelId", "(", ")", ";", "}", "protected", "int", "getValidate", "(", ")", "{", "return", "getValue", "(", "getPanelId", "(", ")", "+", "\".validate\"", ")", ";", "}", "protected", "int", "getValue", "(", "String", "variable", ")", "{", "return", "getValue", "(", "variable", ",", "installData", ")", ";", "}", "protected", "static", "int", "getValue", "(", "String", "variable", ",", "InstallData", "installData", ")", "{", "String", "value", "=", "installData", ".", "getVariable", "(", "variable", ")", ";", "if", "(", "value", "==", "null", ")", "{", "value", "=", "\"0\"", ";", "}", "return", "Integer", ".", "valueOf", "(", "value", ")", ";", "}", "protected", "int", "increment", "(", "String", "variable", ")", "{", "int", "value", "=", "getValue", "(", "variable", ")", ";", "value", "++", ";", "installData", ".", "setVariable", "(", "variable", ",", "Integer", ".", "toString", "(", "value", ")", ")", ";", "return", "value", ";", "}", "}", "</s>" ]
10,887
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "datavalidator", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertFalse", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "fest", ".", "swing", ".", "core", ".", "matcher", ".", "JButtonMatcher", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "DialogFixture", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "FrameFixture", ";", "import", "org", ".", "fest", ".", "swing", ".", "timing", ".", "Timeout", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Rule", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "rules", ".", "TemporaryFolder", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "GuiId", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "installer", ".", "DataValidator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "GUIInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerController", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "IzPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "IzPanels", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "HelperTestMethod", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "hello", ".", "HelloPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "install", ".", "InstallPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "simplefinish", ".", "SimpleFinishPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "util", ".", "TestHousekeeper", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "DataValidatorTest", "{", "@", "Rule", "public", "TemporaryFolder", "temporaryFolder", "=", "new", "TemporaryFolder", "(", ")", ";", "private", "final", "GUIInstallData", "installData", ";", "private", "final", "InstallerFrame", "frame", ";", "private", "final", "InstallerController", "controller", ";", "private", "final", "IzPanels", "panels", ";", "private", "final", "TestHousekeeper", "housekeeper", ";", "private", "FrameFixture", "frameFixture", ";", "public", "DataValidatorTest", "(", "GUIInstallData", "installData", ",", "InstallerFrame", "frame", ",", "InstallerController", "controller", ",", "IzPanels", "panels", ",", "TestHousekeeper", "housekeeper", ")", "{", "this", ".", "installData", "=", "installData", ";", "this", ".", "frame", "=", "frame", ";", "this", ".", "controller", "=", "controller", ";", "this", ".", "panels", "=", "panels", ";", "this", ".", "housekeeper", "=", "housekeeper", ";", "}", "@", "Before", "public", "void", "setUp", "(", ")", "{", "File", "installPath", "=", "new", "File", "(", "temporaryFolder", ".", "getRoot", "(", ")", ",", "\"izpackTest\"", ")", ";", "assertTrue", "(", "installPath", ".", "mkdirs", "(", ")", ")", ";", "installData", ".", "setInstallPath", "(", "installPath", ".", "getAbsolutePath", "(", ")", ")", ";", "}", "@", "After", "public", "void", "tearDown", "(", ")", "{", "if", "(", "frameFixture", "!=", "null", ")", "{", "frameFixture", ".", "cleanUp", "(", ")", ";", "}", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testDataValidators", "(", ")", "throws", "Exception", "{", "List", "<", "Panel", ">", "list", "=", "panels", ".", "getPanels", "(", ")", ";", "assertEquals", "(", "3", ",", "list", ".", "size", "(", ")", ")", ";", "Panel", "hello", "=", "list", ".", "get", "(", "0", ")", ";", "Panel", "install", "=", "list", ".", "get", "(", "1", ")", ";", "Panel", "finish", "=", "list", ".", "get", "(", "2", ")", ";", "assertEquals", "(", "HelloPanel", ".", "class", ".", "getName", "(", ")", ",", "hello", ".", "getClassName", "(", ")", ")", ";", "assertEquals", "(", "TestDataValidator", ".", "class", ".", "getName", "(", ")", ",", "hello", ".", "getValidator", "(", ")", ")", ";", "assertEquals", "(", "InstallPanel", ".", "class", ".", "getName", "(", ")", ",", "install", ".", "getClassName", "(", ")", ")", ";", "assertEquals", "(", "TestDataValidator", ".", "class", ".", "getName", "(", ")", ",", "install", ".", "getValidator", "(", ")", ")", ";", "assertEquals", "(", "SimpleFinishPanel", ".", "class", ".", "getName", "(", ")", ",", "finish", ".", "getClassName", "(", ")", ")", ";", "assertEquals", "(", "TestDataValidator", ".", "class", ".", "getName", "(", ")", ",", "finish", ".", "getValidator", "(", ")", ")", ";", "frameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "frame", ",", "controller", ")", ";", "Thread", ".", "sleep", "(", "2000", ")", ";", "checkCurrentPanel", "(", "HelloPanel", ".", "class", ")", ";", "installData", ".", "setVariable", "(", "\"\"", ",", "\"ERROR\"", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "checkDialog", "(", "\"\"", ")", ";", "checkCurrentPanel", "(", "HelloPanel", ".", "class", ")", ";", "installData", ".", "setVariable", "(", "\"\"", ",", "\"WARNING\"", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "checkDialog", "(", "\"\"", ")", ";", "assertEquals", "(", "2", ",", "TestDataValidator", ".", "getValidate", "(", "\"HelloPanel\"", ",", "installData", ")", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkCurrentPanel", "(", "InstallPanel", ".", "class", ")", ";", "installData", ".", "setVariable", "(", "\"\"", ",", "\"ERROR\"", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "checkDialog", "(", "\"\"", ")", ";", "installData", ".", "setVariable", "(", "\"\"", ",", "\"OK\"", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "assertEquals", "(", "2", ",", "TestDataValidator", ".", "getValidate", "(", "\"InstallPanel\"", ",", "installData", ")", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkCurrentPanel", "(", "SimpleFinishPanel", ".", "class", ")", ";", "installData", ".", "setVariable", "(", "\"\"", ",", "\"ERROR\"", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_QUIT", ".", "id", ")", ".", "click", "(", ")", ";", "assertEquals", "(", "0", ",", "TestDataValidator", ".", "getValidate", "(", "\"\"", ",", "installData", ")", ")", ";", "housekeeper", ".", "waitShutdown", "(", "2", "*", "60", "*", "1000", ")", ";", "assertTrue", "(", "housekeeper", ".", "hasShutdown", "(", ")", ")", ";", "assertEquals", "(", "0", ",", "housekeeper", ".", "getExitCode", "(", ")", ")", ";", "assertFalse", "(", "housekeeper", ".", "getReboot", "(", ")", ")", ";", "}", "private", "void", "checkCurrentPanel", "(", "Class", "<", "?", "extends", "IzPanel", ">", "type", ")", "{", "Panel", "panel", "=", "panels", ".", "getPanel", "(", ")", ";", "assertEquals", "(", "type", ".", "getName", "(", ")", ",", "panel", ".", "getClassName", "(", ")", ")", ";", "}", "private", "void", "checkDialog", "(", "String", "text", ")", "{", "DialogFixture", "dialog", "=", "frameFixture", ".", "dialog", "(", "Timeout", ".", "timeout", "(", "10000", ")", ")", ";", "assertEquals", "(", "text", ",", "dialog", ".", "label", "(", "\"\"", ")", ".", "text", "(", ")", ")", ";", "dialog", ".", "button", "(", "JButtonMatcher", ".", "withText", "(", "\"OK\"", ")", ")", ".", "click", "(", ")", ";", "}", "}", "</s>" ]
10,888
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "packvalidator", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertFalse", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "FrameFixture", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Rule", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "rules", ".", "TemporaryFolder", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "GuiId", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Panel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "GUIInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerController", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "IzPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "panel", ".", "Panels", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "HelperTestMethod", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "hello", ".", "HelloPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "install", ".", "InstallPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "packs", ".", "PacksPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "simplefinish", ".", "SimpleFinishPanel", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "treepacks", ".", "PackValidator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "util", ".", "TestHousekeeper", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "PackValidatorTest", "{", "@", "Rule", "public", "TemporaryFolder", "temporaryFolder", "=", "new", "TemporaryFolder", "(", ")", ";", "private", "final", "GUIInstallData", "installData", ";", "private", "final", "InstallerFrame", "frame", ";", "private", "final", "InstallerController", "controller", ";", "private", "final", "TestHousekeeper", "housekeeper", ";", "private", "final", "Panels", "panels", ";", "private", "FrameFixture", "frameFixture", ";", "public", "PackValidatorTest", "(", "GUIInstallData", "installData", ",", "InstallerFrame", "frame", ",", "InstallerController", "controller", ",", "TestHousekeeper", "housekeeper", ",", "Panels", "panels", ")", "{", "this", ".", "installData", "=", "installData", ";", "this", ".", "frame", "=", "frame", ";", "this", ".", "controller", "=", "controller", ";", "this", ".", "housekeeper", "=", "housekeeper", ";", "this", ".", "panels", "=", "panels", ";", "}", "@", "Before", "public", "void", "setUp", "(", ")", "{", "File", "installPath", "=", "new", "File", "(", "temporaryFolder", ".", "getRoot", "(", ")", ",", "\"izpackTest\"", ")", ";", "assertTrue", "(", "installPath", ".", "mkdirs", "(", ")", ")", ";", "installData", ".", "setInstallPath", "(", "installPath", ".", "getAbsolutePath", "(", ")", ")", ";", "}", "@", "After", "public", "void", "tearDown", "(", ")", "{", "if", "(", "frameFixture", "!=", "null", ")", "{", "frameFixture", ".", "cleanUp", "(", ")", ";", "}", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testPackValidator", "(", ")", "throws", "Exception", "{", "assertEquals", "(", "4", ",", "panels", ".", "getPanels", "(", ")", ".", "size", "(", ")", ")", ";", "frameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "frame", ",", "controller", ")", ";", "Thread", ".", "sleep", "(", "2000", ")", ";", "checkCurrentPanel", "(", "HelloPanel", ".", "class", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkCurrentPanel", "(", "PacksPanel", ".", "class", ")", ";", "TestPackValidator", ".", "setValid", "(", "\"Base\"", ",", "false", ",", "installData", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkCurrentPanel", "(", "PacksPanel", ".", "class", ")", ";", "TestPackValidator", ".", "setValid", "(", "\"Base\"", ",", "true", ",", "installData", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkCurrentPanel", "(", "InstallPanel", ".", "class", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "checkCurrentPanel", "(", "SimpleFinishPanel", ".", "class", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_QUIT", ".", "id", ")", ".", "click", "(", ")", ";", "housekeeper", ".", "waitShutdown", "(", "2", "*", "60", "*", "1000", ")", ";", "assertTrue", "(", "housekeeper", ".", "hasShutdown", "(", ")", ")", ";", "assertEquals", "(", "0", ",", "housekeeper", ".", "getExitCode", "(", ")", ")", ";", "assertFalse", "(", "housekeeper", ".", "getReboot", "(", ")", ")", ";", "}", "private", "void", "checkCurrentPanel", "(", "Class", "<", "?", "extends", "IzPanel", ">", "type", ")", "{", "Panel", "panel", "=", "panels", ".", "getPanel", "(", ")", ";", "assertEquals", "(", "type", ".", "getName", "(", ")", ",", "panel", ".", "getClassName", "(", ")", ")", ";", "}", "}", "</s>" ]
10,889
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "packvalidator", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "handler", ".", "AbstractUIHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "GUIInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "panels", ".", "treepacks", ".", "PackValidator", ";", "public", "class", "TestPackValidator", "implements", "PackValidator", "{", "public", "static", "void", "setValid", "(", "String", "pack", ",", "boolean", "valid", ",", "InstallData", "installData", ")", "{", "installData", ".", "setVariable", "(", "pack", "+", "\".valid\"", ",", "Boolean", ".", "toString", "(", "valid", ")", ")", ";", "}", "@", "Override", "public", "boolean", "validate", "(", "AbstractUIHandler", "handler", ",", "GUIInstallData", "installData", ",", "String", "packName", ",", "boolean", "isSelected", ")", "{", "String", "name", "=", "packName", "+", "\".valid\"", ";", "String", "value", "=", "installData", ".", "getVariable", "(", "name", ")", ";", "return", "Boolean", ".", "valueOf", "(", "value", ")", ";", "}", "}", "</s>" ]
10,890
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "static", "org", ".", "hamcrest", ".", "MatcherAssert", ".", "assertThat", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "jar", ".", "JarFile", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "AutomatedInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "UninstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "UninstallDataWriter", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "matcher", ".", "ZipMatcher", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "listener", ".", "TestUninstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "uninstaller", ".", "Destroyer", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "UninstallerListenerTest", "extends", "AbstractDestroyerTest", "{", "private", "final", "UninstallDataWriter", "uninstallDataWriter", ";", "private", "final", "UninstallData", "uninstallData", ";", "public", "UninstallerListenerTest", "(", "UninstallDataWriter", "uninstallDataWriter", ",", "AutomatedInstallData", "installData", ",", "UninstallData", "uninstallData", ")", "{", "super", "(", "installData", ")", ";", "this", ".", "uninstallDataWriter", "=", "uninstallDataWriter", ";", "this", ".", "uninstallData", "=", "uninstallData", ";", "}", "@", "Before", "public", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "removeState", "(", ")", ";", "}", "@", "After", "public", "void", "tearDown", "(", ")", "{", "removeState", "(", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testUninstallerListenerInvocation", "(", ")", "throws", "Exception", "{", "String", "installPath", "=", "getInstallPath", "(", ")", ";", "File", "installDir", "=", "new", "File", "(", "installPath", ")", ";", "if", "(", "!", "installDir", ".", "exists", "(", ")", ")", "{", "assertTrue", "(", "installDir", ".", "mkdirs", "(", ")", ")", ";", "}", "int", "files", "=", "3", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "files", ";", "++", "i", ")", "{", "File", "file", "=", "new", "File", "(", "installPath", ",", "\"file\"", "+", "i", ")", ";", "assertTrue", "(", "file", ".", "createNewFile", "(", ")", ")", ";", "uninstallData", ".", "addFile", "(", "file", ".", "getAbsolutePath", "(", ")", ",", "true", ")", ";", "}", "assertTrue", "(", "uninstallDataWriter", ".", "write", "(", ")", ")", ";", "File", "file", "=", "getUninstallerJar", "(", ")", ";", "JarFile", "uninstallJar", "=", "new", "JarFile", "(", "file", ")", ";", "assertThat", "(", "uninstallJar", ",", "ZipMatcher", ".", "isZipContainingFiles", "(", "\"\"", ",", "\"\"", ")", ")", ";", "runDestroyer", "(", "file", ")", ";", "String", "path", "=", "TestUninstallerListener", ".", "getStatePath", "(", "installPath", ")", ";", "TestUninstallerListener", ".", "State", "state", "=", "TestUninstallerListener", ".", "readState", "(", "path", ")", ";", "assertEquals", "(", "1", ",", "state", ".", "initialiseCount", ")", ";", "assertEquals", "(", "1", ",", "state", ".", "beforeListDeleteCount", ")", ";", "assertEquals", "(", "files", "+", "1", ",", "state", ".", "beforeDeleteCount", ")", ";", "assertEquals", "(", "state", ".", "beforeListDeleteCount", ",", "state", ".", "afterListDeleteCount", ")", ";", "assertEquals", "(", "state", ".", "beforeDeleteCount", ",", "state", ".", "afterDeleteCount", ")", ";", "}", "private", "void", "removeState", "(", ")", "{", "String", "path", "=", "TestUninstallerListener", ".", "getStatePath", "(", "getInstallPath", "(", ")", ")", ";", "File", "file", "=", "new", "File", "(", "path", ")", ";", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "assertTrue", "(", "file", ".", "delete", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
10,891
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "FrameFixture", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "GuiId", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "AutomatedInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "event", ".", "InstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "event", ".", "InstallerListeners", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerController", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "listener", ".", "TestInstallerListener", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "InstallerListenerTest", "extends", "AbstractInstallationTest", "{", "private", "final", "InstallerListeners", "listeners", ";", "private", "final", "InstallerFrame", "frame", ";", "private", "final", "InstallerController", "controller", ";", "private", "FrameFixture", "frameFixture", ";", "public", "InstallerListenerTest", "(", "InstallerListeners", "listeners", ",", "AutomatedInstallData", "installData", ",", "InstallerFrame", "frame", ",", "InstallerController", "controller", ")", "{", "super", "(", "installData", ")", ";", "this", ".", "listeners", "=", "listeners", ";", "this", ".", "frame", "=", "frame", ";", "this", ".", "controller", "=", "controller", ";", "}", "@", "After", "public", "void", "tearDown", "(", ")", "{", "if", "(", "frameFixture", "!=", "null", ")", "{", "frameFixture", ".", "cleanUp", "(", ")", ";", "}", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testInstallListenerInvocation", "(", ")", "throws", "Exception", "{", "frameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "frame", ",", "controller", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "frameFixture", ".", "requireVisible", "(", ")", ";", "HelperTestMethod", ".", "waitAndCheckInstallation", "(", "getInstallData", "(", ")", ")", ";", "assertEquals", "(", "1", ",", "listeners", ".", "size", "(", ")", ")", ";", "TestInstallerListener", "listener", "=", "(", "TestInstallerListener", ")", "listeners", ".", "getInstallerListeners", "(", ")", ".", "get", "(", "0", ")", ";", "assertEquals", "(", "1", ",", "listener", ".", "getInitialiseCount", "(", ")", ")", ";", "assertEquals", "(", "1", ",", "listener", ".", "getBeforePacksCount", "(", ")", ")", ";", "assertEquals", "(", "3", ",", "listener", ".", "getBeforePackCount", "(", ")", ")", ";", "assertEquals", "(", "5", ",", "listener", ".", "getBeforeDirCount", "(", ")", ")", ";", "assertEquals", "(", "4", ",", "listener", ".", "getBeforeFileCount", "(", ")", ")", ";", "assertEquals", "(", "listener", ".", "getBeforePacksCount", "(", ")", ",", "listener", ".", "getAfterPacksCount", "(", ")", ")", ";", "assertEquals", "(", "listener", ".", "getBeforePackCount", "(", ")", ",", "listener", ".", "getAfterPackCount", "(", ")", ")", ";", "assertEquals", "(", "listener", ".", "getBeforeDirCount", "(", ")", ",", "listener", ".", "getAfterDirCount", "(", ")", ")", ";", "assertEquals", "(", "listener", ".", "getBeforeFileCount", "(", ")", ",", "listener", ".", "getAfterFileCount", "(", ")", ")", ";", "}", "}", "</s>" ]
10,892
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "automation", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "util", ".", "TestHelper", ".", "assertFileExists", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertFalse", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNotNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "AutomatedInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestConsoleInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "automation", ".", "AutomatedInstaller", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "AbstractInstallationTest", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "UninstallHelper", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "FileUtil", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestConsoleInstallationContainer", ".", "class", ")", "public", "class", "AutomatedInstallerTest", "extends", "AbstractInstallationTest", "{", "private", "final", "AutomatedInstaller", "installer", ";", "public", "AutomatedInstallerTest", "(", "AutomatedInstaller", "installer", ",", "AutomatedInstallData", "installData", ")", "{", "super", "(", "installData", ")", ";", "this", ".", "installer", "=", "installer", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testAutomatedInstaller", "(", ")", "throws", "Exception", "{", "InstallData", "installData", "=", "getInstallData", "(", ")", ";", "URL", "url", "=", "getClass", "(", ")", ".", "getResource", "(", "\"\"", ")", ";", "assertNotNull", "(", "url", ")", ";", "String", "config", "=", "FileUtil", ".", "convertUrlToFilePath", "(", "url", ")", ";", "installer", ".", "init", "(", "config", ",", "null", ")", ";", "installer", ".", "doInstall", "(", ")", ";", "assertTrue", "(", "installData", ".", "isInstallSuccess", "(", ")", ")", ";", "String", "installPath", "=", "getInstallPath", "(", ")", ";", "File", "dir", "=", "new", "File", "(", "installPath", ")", ";", "assertFileExists", "(", "dir", ",", "\"Licence.txt\"", ")", ";", "assertFileExists", "(", "dir", ",", "\"Readme.txt\"", ")", ";", "assertFileExists", "(", "dir", ",", "\"\"", ")", ";", "UninstallHelper", ".", "uninstall", "(", "installData", ")", ";", "assertFalse", "(", "new", "File", "(", "installPath", ")", ".", "exists", "(", ")", ")", ";", "}", "}", "</s>" ]
10,893
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNotNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "javax", ".", "swing", ".", "SwingUtilities", ";", "import", "com", ".", "coi", ".", "tools", ".", "os", ".", "win", ".", "RegDataContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "IzPackException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "NativeLibException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "core", ".", "os", ".", "RegistryDefaultHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "core", ".", "os", ".", "RegistryHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Librarian", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "os", ".", "ShellLink", ";", "public", "class", "WindowsHelper", "{", "public", "static", "File", "checkShortcut", "(", "final", "int", "linkType", ",", "final", "int", "userType", ",", "final", "String", "group", ",", "final", "String", "name", ",", "final", "File", "target", ",", "final", "String", "description", ",", "final", "Librarian", "librarian", ")", "throws", "Exception", "{", "final", "File", "[", "]", "shortcut", "=", "new", "File", "[", "1", "]", ";", "SwingUtilities", ".", "invokeAndWait", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "ShellLink", "link", ";", "try", "{", "link", "=", "new", "ShellLink", "(", "linkType", ",", "userType", ",", "group", ",", "name", ",", "librarian", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "throw", "new", "IzPackException", "(", "exception", ")", ";", "}", "assertEquals", "(", "linkType", ",", "link", ".", "getLinkType", "(", ")", ")", ";", "assertEquals", "(", "userType", ",", "link", ".", "getUserType", "(", ")", ")", ";", "assertEquals", "(", "target", ",", "new", "File", "(", "link", ".", "getTargetPath", "(", ")", ")", ")", ";", "assertEquals", "(", "description", ",", "link", ".", "getDescription", "(", ")", ")", ";", "shortcut", "[", "0", "]", "=", "new", "File", "(", "link", ".", "getFileName", "(", ")", ")", ";", "assertTrue", "(", "shortcut", "[", "0", "]", ".", "exists", "(", ")", ")", ";", "}", "}", ")", ";", "return", "shortcut", "[", "0", "]", ";", "}", "public", "static", "boolean", "registryKeyExists", "(", "RegistryDefaultHandler", "handler", ",", "String", "key", ")", "throws", "NativeLibException", "{", "RegistryHandler", "registry", "=", "handler", ".", "getInstance", "(", ")", ";", "assertNotNull", "(", "registry", ")", ";", "registry", ".", "setRoot", "(", "RegistryHandler", ".", "HKEY_LOCAL_MACHINE", ")", ";", "return", "registry", ".", "keyExist", "(", "key", ")", ";", "}", "public", "static", "void", "registryValueStringEquals", "(", "RegistryDefaultHandler", "handler", ",", "String", "key", ",", "String", "name", ",", "String", "expected", ")", "throws", "NativeLibException", "{", "RegistryHandler", "registry", "=", "handler", ".", "getInstance", "(", ")", ";", "assertNotNull", "(", "registry", ")", ";", "registry", ".", "setRoot", "(", "RegistryHandler", ".", "HKEY_LOCAL_MACHINE", ")", ";", "assertTrue", "(", "registry", ".", "keyExist", "(", "key", ")", ")", ";", "assertTrue", "(", "registry", ".", "valueExist", "(", "key", ",", "name", ")", ")", ";", "RegDataContainer", "value", "=", "registry", ".", "getValue", "(", "key", ",", "name", ")", ";", "assertEquals", "(", "\"\"", "+", "name", "+", "\"\"", ",", "RegDataContainer", ".", "REG_SZ", ",", "value", ".", "getType", "(", ")", ")", ";", "assertEquals", "(", "expected", ",", "registry", ".", "getValue", "(", "key", ",", "name", ")", ".", "getStringData", "(", ")", ")", ";", "}", "public", "static", "void", "registryDeleteUninstallKey", "(", "RegistryDefaultHandler", "handler", ",", "String", "key", ")", "throws", "NativeLibException", "{", "RegistryHandler", "registry", "=", "handler", ".", "getInstance", "(", ")", ";", "assertNotNull", "(", "registry", ")", ";", "if", "(", "!", "key", ".", "matches", "(", "\"\"", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "key", ")", ";", "}", "registry", ".", "setRoot", "(", "RegistryHandler", ".", "HKEY_LOCAL_MACHINE", ")", ";", "if", "(", "registry", ".", "keyExist", "(", "key", ")", ")", "{", "registry", ".", "deleteKey", "(", "key", ")", ";", "}", "}", "}", "</s>" ]
10,894
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ".", "WindowsHelper", ".", "registryDeleteUninstallKey", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ".", "WindowsHelper", ".", "registryKeyExists", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ".", "WindowsHelper", ".", "registryValueStringEquals", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Platform", ".", "Name", ".", "WINDOWS", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertFalse", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNotNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "AutomatedInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "NativeLibException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestConsoleInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestConsoleInstallerContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "core", ".", "os", ".", "RegistryDefaultHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "core", ".", "os", ".", "RegistryHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "RegistryInstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "RegistryUninstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "bootstrap", ".", "Installer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "console", ".", "TestConsoleInstaller", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "container", ".", "impl", ".", "ConsoleInstallerContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "UninstallHelper", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "console", ".", "AbstractConsoleInstallationTest", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "RunOn", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "util", ".", "TestConsole", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "FileUtil", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Platforms", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "PrivilegedRunner", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "RunOn", "(", "WINDOWS", ")", "@", "Container", "(", "TestConsoleInstallationContainer", ".", "class", ")", "public", "class", "WindowsConsoleInstallationTest", "extends", "AbstractConsoleInstallationTest", "{", "private", "final", "TestConsoleInstallerContainer", "container", ";", "private", "final", "TestConsoleInstaller", "installer", ";", "private", "final", "RegistryDefaultHandler", "handler", ";", "private", "static", "final", "String", "APP_NAME", "=", "\"\"", ";", "private", "static", "final", "String", "DEFAULT_UNINSTALL_KEY", "=", "RegistryHandler", ".", "UNINSTALL_ROOT", "+", "APP_NAME", ";", "private", "static", "final", "String", "UNINSTALL_CMD_VALUE", "=", "\"\"", ";", "private", "static", "final", "String", "UNINSTALL_KEY2", "=", "RegistryHandler", ".", "UNINSTALL_ROOT", "+", "APP_NAME", "+", "\"(1)\"", ";", "private", "static", "final", "String", "[", "]", "UNINSTALL_KEYS", "=", "{", "DEFAULT_UNINSTALL_KEY", ",", "UNINSTALL_KEY2", "}", ";", "public", "WindowsConsoleInstallationTest", "(", "TestConsoleInstallerContainer", "container", ",", "TestConsoleInstaller", "installer", ",", "AutomatedInstallData", "installData", ",", "RegistryDefaultHandler", "handler", ")", "throws", "Exception", "{", "super", "(", "installData", ")", ";", "this", ".", "container", "=", "container", ";", "this", ".", "installer", "=", "installer", ";", "this", ".", "handler", "=", "handler", ";", "}", "@", "Override", "public", "void", "setUp", "(", ")", "throws", "Exception", "{", "assertFalse", "(", "\"\"", ",", "new", "PrivilegedRunner", "(", "Platforms", ".", "WINDOWS", ")", ".", "isElevationNeeded", "(", ")", ")", ";", "super", ".", "setUp", "(", ")", ";", "String", "appName", "=", "getInstallData", "(", ")", ".", "getInfo", "(", ")", ".", "getAppName", "(", ")", ";", "assertNotNull", "(", "appName", ")", ";", "File", "file", "=", "FileUtil", ".", "getLockFile", "(", "appName", ")", ";", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "assertTrue", "(", "file", ".", "delete", "(", ")", ")", ";", "}", "destroyRegistryEntries", "(", ")", ";", "}", "@", "After", "public", "void", "tearDown", "(", ")", "throws", "Exception", "{", "destroyRegistryEntries", "(", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testInstallation", "(", ")", "throws", "Exception", "{", "checkInstall", "(", "container", ",", "APP_NAME", ")", ";", "assertTrue", "(", "registryKeyExists", "(", "handler", ",", "DEFAULT_UNINSTALL_KEY", ")", ")", ";", "File", "uninstaller", "=", "getUninstallerJar", "(", ")", ";", "assertTrue", "(", "uninstaller", ".", "exists", "(", ")", ")", ";", "UninstallHelper", ".", "consoleUninstall", "(", "uninstaller", ")", ";", "assertFalse", "(", "registryKeyExists", "(", "handler", ",", "DEFAULT_UNINSTALL_KEY", ")", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testMultipleInstallation", "(", ")", "throws", "Exception", "{", "checkInstall", "(", "container", ",", "APP_NAME", ")", ";", "removeLock", "(", ")", ";", "ConsoleInstallerContainer", "container2", "=", "new", "TestConsoleInstallerContainer", "(", ")", ";", "TestConsoleInstaller", "installer2", "=", "container2", ".", "getComponent", "(", "TestConsoleInstaller", ".", "class", ")", ";", "InstallData", "installData2", "=", "container2", ".", "getComponent", "(", "InstallData", ".", "class", ")", ";", "TestConsole", "console2", "=", "installer2", ".", "getConsole", "(", ")", ";", "console2", ".", "addScript", "(", "\"\"", ",", "\"y\"", ",", "\"1\"", ")", ";", "console2", ".", "addScript", "(", "\"InfoPanel\"", ",", "\"1\"", ")", ";", "console2", ".", "addScript", "(", "\"TargetPanel\"", ",", "\"n\"", ",", "\"1\"", ")", ";", "assertFalse", "(", "registryKeyExists", "(", "handler", ",", "UNINSTALL_KEY2", ")", ")", ";", "checkInstall", "(", "installer2", ",", "installData2", ")", ";", "assertEquals", "(", "APP_NAME", "+", "\"(1)\"", ",", "installData2", ".", "getVariable", "(", "\"\"", ")", ")", ";", "assertTrue", "(", "registryKeyExists", "(", "handler", ",", "UNINSTALL_KEY2", ")", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testRejectMultipleInstallation", "(", ")", "throws", "Exception", "{", "checkInstall", "(", "container", ",", "APP_NAME", ")", ";", "removeLock", "(", ")", ";", "ConsoleInstallerContainer", "container2", "=", "new", "TestConsoleInstallerContainer", "(", ")", ";", "TestConsoleInstaller", "installer2", "=", "container2", ".", "getComponent", "(", "TestConsoleInstaller", ".", "class", ")", ";", "RegistryDefaultHandler", "handler2", "=", "container2", ".", "getComponent", "(", "RegistryDefaultHandler", ".", "class", ")", ";", "InstallData", "installData2", "=", "container2", ".", "getComponent", "(", "InstallData", ".", "class", ")", ";", "TestConsole", "console2", "=", "installer2", ".", "getConsole", "(", ")", ";", "console2", ".", "addScript", "(", "\"\"", ",", "\"n\"", ")", ";", "assertFalse", "(", "registryKeyExists", "(", "handler2", ",", "UNINSTALL_KEY2", ")", ")", ";", "installer2", ".", "run", "(", "Installer", ".", "CONSOLE_INSTALL", ",", "null", ")", ";", "assertFalse", "(", "installData2", ".", "isInstallSuccess", "(", ")", ")", ";", "TestConsole", "console", "=", "installer2", ".", "getConsole", "(", ")", ";", "assertTrue", "(", "\"\"", "+", "console", ".", "getScriptName", "(", ")", ",", "console", ".", "scriptCompleted", "(", ")", ")", ";", "assertFalse", "(", "registryKeyExists", "(", "handler2", ",", "UNINSTALL_KEY2", ")", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testNonDefaultUninstaller", "(", ")", "throws", "Exception", "{", "assertFalse", "(", "registryKeyExists", "(", "handler", ",", "DEFAULT_UNINSTALL_KEY", ")", ")", ";", "TestConsole", "console", "=", "installer", ".", "getConsole", "(", ")", ";", "console", ".", "addScript", "(", "\"\"", ",", "\"1\"", ")", ";", "console", ".", "addScript", "(", "\"InfoPanel\"", ",", "\"1\"", ")", ";", "console", ".", "addScript", "(", "\"TargetPanel\"", ",", "\"n\"", ",", "\"1\"", ")", ";", "InstallData", "installData", "=", "getInstallData", "(", ")", ";", "checkInstall", "(", "installer", ",", "installData", ",", "false", ")", ";", "String", "installPath", "=", "installData", ".", "getInstallPath", "(", ")", ";", "assertTrue", "(", "new", "File", "(", "installPath", ",", "\"\"", ")", ".", "exists", "(", ")", ")", ";", "assertTrue", "(", "registryKeyExists", "(", "handler", ",", "DEFAULT_UNINSTALL_KEY", ")", ")", ";", "String", "command", "=", "\"\\\"\"", "+", "installData", ".", "getVariable", "(", "\"JAVA_HOME\"", ")", "+", "\"\"", "+", "installPath", "+", "\"\"", ";", "registryValueStringEquals", "(", "handler", ",", "DEFAULT_UNINSTALL_KEY", ",", "UNINSTALL_CMD_VALUE", ",", "command", ")", ";", "}", "private", "void", "checkInstall", "(", "TestConsoleInstallerContainer", "container", ",", "String", "uninstallName", ")", "throws", "NativeLibException", "{", "InstallData", "installData", "=", "container", ".", "getComponent", "(", "InstallData", ".", "class", ")", ";", "TestConsoleInstaller", "installer", "=", "container", ".", "getComponent", "(", "TestConsoleInstaller", ".", "class", ")", ";", "RegistryDefaultHandler", "handler", "=", "container", ".", "getComponent", "(", "RegistryDefaultHandler", ".", "class", ")", ";", "assertNull", "(", "installData", ".", "getVariable", "(", "\"\"", ")", ")", ";", "assertFalse", "(", "registryKeyExists", "(", "handler", ",", "DEFAULT_UNINSTALL_KEY", ")", ")", ";", "TestConsole", "console", "=", "installer", ".", "getConsole", "(", ")", ";", "console", ".", "addScript", "(", "\"\"", ",", "\"1\"", ")", ";", "console", ".", "addScript", "(", "\"InfoPanel\"", ",", "\"1\"", ")", ";", "console", ".", "addScript", "(", "\"TargetPanel\"", ",", "\"n\"", ",", "\"1\"", ")", ";", "checkInstall", "(", "installer", ",", "installData", ")", ";", "assertEquals", "(", "uninstallName", ",", "installData", ".", "getVariable", "(", "\"\"", ")", ")", ";", "assertTrue", "(", "registryKeyExists", "(", "handler", ",", "DEFAULT_UNINSTALL_KEY", ")", ")", ";", "}", "private", "void", "removeLock", "(", ")", "{", "String", "appName", "=", "getInstallData", "(", ")", ".", "getInfo", "(", ")", ".", "getAppName", "(", ")", ";", "File", "file", "=", "FileUtil", ".", "getLockFile", "(", "appName", ")", ";", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "assertTrue", "(", "file", ".", "delete", "(", ")", ")", ";", "}", "}", "private", "void", "destroyRegistryEntries", "(", ")", "throws", "NativeLibException", "{", "for", "(", "String", "key", ":", "UNINSTALL_KEYS", ")", "{", "registryDeleteUninstallKey", "(", "handler", ",", "key", ")", ";", "}", "}", "}", "</s>" ]
10,895
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ".", "WindowsHelper", ".", "checkShortcut", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ".", "WindowsHelper", ".", "registryDeleteUninstallKey", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "windows", ".", "WindowsHelper", ".", "registryKeyExists", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertFalse", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "FrameFixture", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "GuiId", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "AutomatedInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "exception", ".", "NativeLibException", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "core", ".", "os", ".", "RegistryDefaultHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "core", ".", "os", ".", "RegistryHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "RegistryInstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "event", ".", "RegistryUninstallerListener", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerController", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "AbstractDestroyerTest", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "HelperTestMethod", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "UninstallHelper", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "RunOn", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "util", ".", "TestHousekeeper", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Librarian", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Platform", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Platforms", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "PrivilegedRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "os", ".", "ShellLink", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "RunOn", "(", "Platform", ".", "Name", ".", "WINDOWS", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "WindowsInstallationTest", "extends", "AbstractDestroyerTest", "{", "private", "final", "InstallerFrame", "frame", ";", "private", "final", "InstallerController", "controller", ";", "private", "final", "Librarian", "librarian", ";", "private", "final", "RegistryDefaultHandler", "handler", ";", "private", "final", "TestHousekeeper", "housekeeper", ";", "private", "FrameFixture", "installerFrameFixture", ";", "private", "static", "final", "String", "UNINSTALL_KEY", "=", "RegistryHandler", ".", "UNINSTALL_ROOT", "+", "\"\"", ";", "public", "WindowsInstallationTest", "(", "InstallerFrame", "frame", ",", "InstallerController", "controller", ",", "AutomatedInstallData", "installData", ",", "Librarian", "librarian", ",", "RegistryDefaultHandler", "handler", ",", "TestHousekeeper", "housekeeper", ")", "{", "super", "(", "installData", ")", ";", "this", ".", "frame", "=", "frame", ";", "this", ".", "controller", "=", "controller", ";", "this", ".", "librarian", "=", "librarian", ";", "this", ".", "handler", "=", "handler", ";", "this", ".", "housekeeper", "=", "housekeeper", ";", "}", "@", "Before", "public", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "destroyRegistryEntries", "(", ")", ";", "}", "@", "After", "public", "void", "tearDown", "(", ")", "throws", "Exception", "{", "destroyRegistryEntries", "(", ")", ";", "if", "(", "installerFrameFixture", "!=", "null", ")", "{", "installerFrameFixture", ".", "cleanUp", "(", ")", ";", "installerFrameFixture", "=", "null", ";", "}", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testInstallation", "(", ")", "throws", "Exception", "{", "assertFalse", "(", "\"\"", ",", "new", "PrivilegedRunner", "(", "Platforms", ".", "WINDOWS", ")", ".", "isElevationNeeded", "(", ")", ")", ";", "assertNull", "(", "getInstallData", "(", ")", ".", "getVariable", "(", "\"\"", ")", ")", ";", "installerFrameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "frame", ",", "controller", ")", ";", "Thread", ".", "sleep", "(", "2000", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "getInstallData", "(", ")", ".", "getVariable", "(", "\"\"", ")", ")", ";", "Thread", ".", "sleep", "(", "2000", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "2000", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "2000", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "Thread", ".", "sleep", "(", "1200", ")", ";", "installerFrameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_QUIT", ".", "id", ")", ".", "click", "(", ")", ";", "housekeeper", ".", "waitShutdown", "(", "2", "*", "60", "*", "1000", ")", ";", "assertTrue", "(", "housekeeper", ".", "hasShutdown", "(", ")", ")", ";", "assertEquals", "(", "0", ",", "housekeeper", ".", "getExitCode", "(", ")", ")", ";", "assertFalse", "(", "housekeeper", ".", "getReboot", "(", ")", ")", ";", "File", "uninstaller", "=", "getUninstallerJar", "(", ")", ";", "assertTrue", "(", "registryKeyExists", "(", "handler", ",", "UNINSTALL_KEY", ")", ")", ";", "File", "shortcut", "=", "checkShortcut", "(", "ShellLink", ".", "PROGRAM_MENU", ",", "ShellLink", ".", "ALL_USERS", ",", "\"\"", ",", "\"Uninstaller\"", ",", "uninstaller", ",", "\"\"", ",", "librarian", ")", ";", "UninstallHelper", ".", "guiUninstall", "(", "uninstaller", ")", ";", "assertFalse", "(", "registryKeyExists", "(", "handler", ",", "UNINSTALL_KEY", ")", ")", ";", "assertFalse", "(", "shortcut", ".", "exists", "(", ")", ")", ";", "}", "private", "void", "destroyRegistryEntries", "(", ")", "throws", "NativeLibException", "{", "registryDeleteUninstallKey", "(", "handler", ",", "UNINSTALL_KEY", ")", ";", "}", "}", "</s>" ]
10,896
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "static", "org", ".", "hamcrest", ".", "MatcherAssert", ".", "assertThat", ";", "import", "java", ".", "util", ".", "jar", ".", "JarFile", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipFile", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Rule", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "rules", ".", "TestRule", ";", "import", "org", ".", "junit", ".", "rules", ".", "Timeout", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestCompilationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "matcher", ".", "ZipMatcher", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestCompilationContainer", ".", "class", ")", "public", "class", "IzpackGenerationTest", "{", "@", "Rule", "public", "TestRule", "globalTimeout", "=", "new", "Timeout", "(", "HelperTestMethod", ".", "TIMEOUT", ")", ";", "private", "JarFile", "jar", ";", "private", "TestCompilationContainer", "container", ";", "public", "IzpackGenerationTest", "(", "TestCompilationContainer", "container", ")", "{", "this", ".", "container", "=", "container", ";", "}", "@", "Before", "public", "void", "before", "(", ")", "{", "container", ".", "launchCompilation", "(", ")", ";", "jar", "=", "container", ".", "getComponent", "(", "JarFile", ".", "class", ")", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testGeneratedIzpackInstaller", "(", ")", "throws", "Exception", "{", "assertThat", "(", "(", "ZipFile", ")", "jar", ",", "ZipMatcher", ".", "isZipContainingFiles", "(", "\"\"", ")", ")", ";", "}", "}", "</s>" ]
10,897
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "static", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "util", ".", "TestHelper", ".", "assertFileExists", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Method", ";", "import", "java", ".", "net", ".", "MalformedURLException", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "net", ".", "URLClassLoader", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "Info", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "InstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "uninstaller", ".", "Destroyer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "uninstaller", ".", "console", ".", "ConsoleUninstallerContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "uninstaller", ".", "gui", ".", "GUIUninstallerContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "IoHelper", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "file", ".", "FileUtils", ";", "public", "class", "UninstallHelper", "{", "public", "static", "void", "uninstall", "(", "InstallData", "installData", ")", "throws", "Exception", "{", "File", "uninstallerJar", "=", "getUninstallerJar", "(", "installData", ")", ";", "assertFileExists", "(", "uninstallerJar", ")", ";", "consoleUninstall", "(", "uninstallerJar", ")", ";", "}", "public", "static", "File", "getUninstallerJar", "(", "InstallData", "installData", ")", "{", "Info", "info", "=", "installData", ".", "getInfo", "(", ")", ";", "String", "dir", "=", "IoHelper", ".", "translatePath", "(", "info", ".", "getUninstallerPath", "(", ")", ",", "installData", ".", "getVariables", "(", ")", ")", ";", "String", "path", "=", "dir", "+", "File", ".", "separator", "+", "info", ".", "getUninstallerName", "(", ")", ";", "return", "new", "File", "(", "path", ")", ";", "}", "public", "static", "void", "consoleUninstall", "(", "File", "uninstallJar", ")", "throws", "Exception", "{", "File", "copy", "=", "copy", "(", "uninstallJar", ")", ";", "ClassLoader", "loader", "=", "getClassLoader", "(", "copy", ")", ";", "Class", "containerClass", "=", "loader", ".", "loadClass", "(", "ConsoleUninstallerContainer", ".", "class", ".", "getName", "(", ")", ")", ";", "Object", "container", "=", "containerClass", ".", "newInstance", "(", ")", ";", "runDestroyer", "(", "container", ",", "loader", ",", "copy", ")", ";", "}", "public", "static", "void", "guiUninstall", "(", "File", "uninstallJar", ")", "throws", "Exception", "{", "File", "copy", "=", "copy", "(", "uninstallJar", ")", ";", "ClassLoader", "loader", "=", "getClassLoader", "(", "copy", ")", ";", "Class", "containerClass", "=", "loader", ".", "loadClass", "(", "GUIUninstallerContainer", ".", "class", ".", "getName", "(", ")", ")", ";", "Object", "container", "=", "containerClass", ".", "newInstance", "(", ")", ";", "runDestroyer", "(", "container", ",", "loader", ",", "copy", ")", ";", "}", "private", "static", "ClassLoader", "getClassLoader", "(", "File", "uninstallJar", ")", "throws", "MalformedURLException", "{", "return", "new", "URLClassLoader", "(", "new", "URL", "[", "]", "{", "uninstallJar", ".", "toURI", "(", ")", ".", "toURL", "(", ")", "}", ",", "null", ")", ";", "}", "private", "static", "void", "runDestroyer", "(", "Object", "container", ",", "ClassLoader", "loader", ",", "File", "jar", ")", "throws", "Exception", "{", "Method", "getComponent", "=", "container", ".", "getClass", "(", ")", ".", "getMethod", "(", "\"getComponent\"", ",", "Class", ".", "class", ")", ";", "Class", "destroyerClass", "=", "loader", ".", "loadClass", "(", "Destroyer", ".", "class", ".", "getName", "(", ")", ")", ";", "Object", "destroyer", "=", "getComponent", ".", "invoke", "(", "container", ",", "destroyerClass", ")", ";", "Method", "forceDelete", "=", "destroyerClass", ".", "getMethod", "(", "\"\"", ",", "boolean", ".", "class", ")", ";", "forceDelete", ".", "invoke", "(", "destroyer", ",", "true", ")", ";", "Method", "run", "=", "destroyerClass", ".", "getMethod", "(", "\"run\"", ")", ";", "run", ".", "invoke", "(", "destroyer", ")", ";", "FileUtils", ".", "delete", "(", "jar", ")", ";", "}", "private", "static", "File", "copy", "(", "File", "uninstallJar", ")", "throws", "IOException", "{", "File", "copy", "=", "File", ".", "createTempFile", "(", "\"uninstaller\"", ",", "\".jar\"", ")", ";", "copy", ".", "deleteOnExit", "(", ")", ";", "IoHelper", ".", "copyFile", "(", "uninstallJar", ",", "copy", ")", ";", "return", "copy", ";", "}", "}", "</s>" ]
10,898
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertFalse", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "apache", ".", "commons", ".", "lang", ".", "StringUtils", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "AutomatedInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "handler", ".", "AbstractUIProgressHandler", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "data", ".", "UninstallDataWriter", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "unpacker", ".", "Unpacker", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "RunOn", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "FileUtil", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "util", ".", "Platform", ".", "Name", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "ExecutableFileTest", "extends", "AbstractDestroyerTest", "{", "private", "final", "Unpacker", "unpacker", ";", "private", "final", "UninstallDataWriter", "uninstallDataWriter", ";", "public", "ExecutableFileTest", "(", "Unpacker", "unpacker", ",", "UninstallDataWriter", "uninstallDataWriter", ",", "AutomatedInstallData", "installData", ")", "{", "super", "(", "installData", ")", ";", "this", ".", "unpacker", "=", "unpacker", ";", "this", ".", "uninstallDataWriter", "=", "uninstallDataWriter", ";", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "@", "RunOn", "(", "{", "Name", ".", "WINDOWS", ",", "Name", ".", "UNIX", "}", ")", "public", "void", "testExecutables", "(", ")", "throws", "Exception", "{", "getInstallData", "(", ")", ".", "refreshVariables", "(", ")", ";", "checkNotExists", "(", "\"\"", ")", ";", "checkNotExists", "(", "\"never.log\"", ")", ";", "checkNotExists", "(", "\"\"", ")", ";", "unpacker", ".", "setProgressListener", "(", "new", "NoOpProgressHandler", "(", ")", ")", ";", "unpacker", ".", "run", "(", ")", ";", "assertTrue", "(", "uninstallDataWriter", ".", "write", "(", ")", ")", ";", "File", "file", "=", "checkContains", "(", "\"\"", ",", "\"install\"", ")", ";", "assertTrue", "(", "file", ".", "delete", "(", ")", ")", ";", "checkNotExists", "(", "\"never.log\"", ")", ";", "checkNotExists", "(", "\"\"", ")", ";", "File", "jar", "=", "getUninstallerJar", "(", ")", ";", "runDestroyer", "(", "jar", ")", ";", "checkNotExists", "(", "\"\"", ")", ";", "checkNotExists", "(", "\"never.log\"", ")", ";", "checkContains", "(", "\"\"", ",", "\"uninstall\"", ")", ";", "}", "private", "File", "checkContains", "(", "String", "name", ",", "String", "content", ")", "throws", "IOException", "{", "checkExists", "(", "name", ")", ";", "File", "file", "=", "new", "File", "(", "temporaryFolder", ".", "getRoot", "(", ")", ",", "name", ")", ";", "List", "<", "String", ">", "fileContent", "=", "FileUtil", ".", "getFileContent", "(", "file", ".", "getPath", "(", ")", ")", ";", "assertEquals", "(", "1", ",", "fileContent", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "content", ",", "StringUtils", ".", "trim", "(", "fileContent", ".", "get", "(", "0", ")", ")", ")", ";", "return", "file", ";", "}", "private", "void", "checkExists", "(", "String", "name", ")", "{", "File", "file", "=", "new", "File", "(", "temporaryFolder", ".", "getRoot", "(", ")", ",", "name", ")", ";", "assertTrue", "(", "file", ".", "exists", "(", ")", ")", ";", "}", "private", "void", "checkNotExists", "(", "String", "name", ")", "{", "File", "file", "=", "new", "File", "(", "temporaryFolder", ".", "getRoot", "(", ")", ",", "name", ")", ";", "assertFalse", "(", "file", ".", "exists", "(", ")", ")", ";", "}", "private", "static", "class", "NoOpProgressHandler", "implements", "AbstractUIProgressHandler", "{", "@", "Override", "public", "void", "startAction", "(", "String", "name", ",", "int", "no_of_steps", ")", "{", "}", "@", "Override", "public", "void", "stopAction", "(", ")", "{", "}", "@", "Override", "public", "void", "nextStep", "(", "String", "step_name", ",", "int", "step_no", ",", "int", "no_of_substeps", ")", "{", "}", "@", "Override", "public", "void", "setSubStepNo", "(", "int", "no_of_substeps", ")", "{", "}", "@", "Override", "public", "void", "progress", "(", "int", "substep_no", ",", "String", "message", ")", "{", "}", "@", "Override", "public", "void", "progress", "(", "String", "message", ")", "{", "}", "@", "Override", "public", "void", "restartAction", "(", "String", "name", ",", "String", "overallMessage", ",", "String", "tip", ",", "int", "steps", ")", "{", "}", "@", "Override", "public", "void", "emitNotification", "(", "String", "message", ")", "{", "}", "@", "Override", "public", "boolean", "emitWarning", "(", "String", "title", ",", "String", "message", ")", "{", "return", "false", ";", "}", "@", "Override", "public", "void", "emitError", "(", "String", "title", ",", "String", "message", ")", "{", "}", "@", "Override", "public", "void", "emitErrorAndBlockNext", "(", "String", "title", ",", "String", "message", ")", "{", "}", "@", "Override", "public", "int", "askQuestion", "(", "String", "title", ",", "String", "question", ",", "int", "choices", ")", "{", "return", "0", ";", "}", "@", "Override", "public", "int", "askQuestion", "(", "String", "title", ",", "String", "question", ",", "int", "choices", ",", "int", "default_choice", ")", "{", "return", "0", ";", "}", "}", "}", "</s>" ]
10,899
[ "<s>", "package", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "packaging", ";", "import", "static", "org", ".", "hamcrest", ".", "MatcherAssert", ".", "assertThat", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "java", ".", "util", ".", "jar", ".", "JarFile", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipEntry", ";", "import", "org", ".", "fest", ".", "swing", ".", "fixture", ".", "FrameFixture", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "GuiId", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "api", ".", "data", ".", "AutomatedInstallData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "container", ".", "TestInstallationContainer", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "data", ".", "CompilerData", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "compiler", ".", "packager", ".", "impl", ".", "Packager", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerController", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "gui", ".", "InstallerFrame", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "installer", ".", "unpacker", ".", "Unpacker", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "AbstractInstallationTest", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "integration", ".", "HelperTestMethod", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "matcher", ".", "ZipMatcher", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "Container", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "InstallFile", ";", "import", "com", ".", "izforge", ".", "izpack", ".", "test", ".", "junit", ".", "PicoRunner", ";", "@", "RunWith", "(", "PicoRunner", ".", "class", ")", "@", "Container", "(", "TestInstallationContainer", ".", "class", ")", "public", "class", "PackagingTest", "extends", "AbstractInstallationTest", "{", "private", "final", "JarFile", "installer", ";", "private", "final", "CompilerData", "compilerData", ";", "private", "final", "InstallerFrame", "frame", ";", "private", "final", "InstallerController", "controller", ";", "private", "FrameFixture", "frameFixture", ";", "public", "PackagingTest", "(", "JarFile", "installer", ",", "CompilerData", "compilerData", ",", "AutomatedInstallData", "installData", ",", "InstallerFrame", "frame", ",", "InstallerController", "controller", ")", "{", "super", "(", "installData", ")", ";", "this", ".", "installer", "=", "installer", ";", "this", ".", "compilerData", "=", "compilerData", ";", "this", ".", "frame", "=", "frame", ";", "this", ".", "controller", "=", "controller", ";", "}", "@", "After", "public", "void", "tearDown", "(", ")", "{", "if", "(", "frameFixture", "!=", "null", ")", "{", "frameFixture", ".", "cleanUp", "(", ")", ";", "}", "}", "@", "Test", "@", "InstallFile", "(", "\"\"", ")", "public", "void", "testPack200", "(", ")", "throws", "Exception", "{", "File", "source", "=", "new", "File", "(", "compilerData", ".", "getBasedir", "(", ")", ",", "\"\"", ")", ";", "assertTrue", "(", "source", ".", "exists", "(", ")", ")", ";", "assertThat", "(", "installer", ",", "ZipMatcher", ".", "isZipContainingFiles", "(", "\"\"", ")", ")", ";", "frameFixture", "=", "HelperTestMethod", ".", "prepareFrameFixture", "(", "frame", ",", "controller", ")", ";", "frameFixture", ".", "button", "(", "GuiId", ".", "BUTTON_NEXT", ".", "id", ")", ".", "click", "(", ")", ";", "frameFixture", ".", "requireVisible", "(", ")", ";", "HelperTestMethod", ".", "waitAndCheckInstallation", "(", "getInstallData", "(", ")", ")", ";", "File", "target", "=", "new", "File", "(", "getInstallPath", "(", ")", ",", "\"\"", ")", ";", "assertTrue", "(", "target", ".", "exists", "(", ")", ")", ";", "JarFile", "sourceJar", "=", "new", "JarFile", "(", "source", ")", ";", "JarFile", "targetJar", "=", "new", "JarFile", "(", "target", ")", ";", "Set", "<", "String", ">", "sourceEntries", "=", "getFiles", "(", "sourceJar", ")", ";", "Set", "<", "String", ">", "targetEntries", "=", "getFiles", "(", "targetJar", ")", ";", "assertEquals", "(", "sourceEntries", ",", "targetEntries", ")", ";", "}", "private", "Set", "<", "String", ">", "getFiles", "(", "JarFile", "file", ")", "throws", "IOException", "{", "Set", "<", "String", ">", "result", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "Enumeration", "<", "?", "extends", "ZipEntry", ">", "entries", "=", "file", ".", "entries", "(", ")", ";", "while", "(", "entries", ".", "hasMoreElements", "(", ")", ")", "{", "ZipEntry", "entry", "=", "entries", ".", "nextElement", "(", ")", ";", "if", "(", "!", "entry", ".", "isDirectory", "(", ")", ")", "{", "result", ".", "add", "(", "entry", ".", "getName", "(", ")", ")", ";", "}", "}", "return", "result", ";", "}", "}", "</s>" ]