Ignore:
Timestamp:
2018-04-02T23:20:00+02:00 (6 years ago)
Author:
Don-vip
Message:

tools update: Groovy 2.4.15, PMD 6.2.0, JAPICC 2.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/japicc/modules/Internals/RegTests.pm

    r12872 r13595  
    22# A module with regression test suite
    33#
    4 # Copyright (C) 2016-2017 Andrey Ponomarenko's ABI Laboratory
     4# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
    55#
    66# Written by Andrey Ponomarenko
    77#
    8 # This program is free software: you can redistribute it and/or modify
    9 # it under the terms of the GNU General Public License or the GNU Lesser
    10 # General Public License as published by the Free Software Foundation.
     8# This library is free software; you can redistribute it and/or
     9# modify it under the terms of the GNU Lesser General Public
     10# License as published by the Free Software Foundation; either
     11# version 2.1 of the License, or (at your option) any later version.
    1112#
    12 # This program is distributed in the hope that it will be useful,
     13# This library is distributed in the hope that it will be useful,
    1314# but WITHOUT ANY WARRANTY; without even the implied warranty of
    14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    15 # GNU General Public License for more details.
     15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     16# Lesser General Public License for more details.
    1617#
    17 # You should have received a copy of the GNU General Public License
    18 # and the GNU Lesser General Public License along with this program.
    19 # If not, see <http://www.gnu.org/licenses/>.
     18# You should have received a copy of the GNU Lesser General Public
     19# License along with this library; if not, write to the Free Software
     20# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
     21# MA  02110-1301  USA.
    2022###########################################################################
    2123use strict;
     
    384386        }");
    385387       
     388        # Added vararg parameter
     389        writeFile($Path_v1."/AddedVarargParam.java",
     390        "package $PackageName;
     391        public class AddedVarargParam {
     392            public void method(Integer x, String... y) { }
     393        }");
     394        writeFile($Path_v2."/AddedVarargParam.java",
     395        "package $PackageName;
     396        public class AddedVarargParam {
     397            public void method(Integer x, String... y) { }
     398        }");
     399       
     400        writeFile($TestsPath."/Test_AddedVarargParam.java",
     401        "import $PackageName.*;
     402        public class Test_AddedVarargParam
     403        {
     404            public static void main(String[] args) {
     405                AddedVarargParam X = new AddedVarargParam();
     406                X.method(0);
     407            }
     408        }");
     409       
    386410        # Removed_Annotation
    387411        writeFile($Path_v1."/RemovedAnnotation.java",
     
    402426        }");
    403427       
     428        # Changed Annotation
     429        writeFile($Path_v1."/ChangedAnnotation.java",
     430        "package $PackageName;
     431       
     432        enum MyEnum {
     433            SUNDAY, MONDAY
     434        }
     435       
     436        public \@interface ChangedAnnotation {
     437            String value();
     438            String datatype() default \"Str\";
     439            int num1() default 1;
     440            String[] values() default {\"Alice\", \"Bob\", \"Cindy\"};
     441            int[] nums() default {1, 2, 3};
     442            String safe_change() default \"Str\";
     443            MyEnum day() default MyEnum.SUNDAY;
     444            short num2() default 1;
     445            long num3() default 1;
     446            byte num4() default 1;
     447            float num5() default 1.5f;
     448            double num6() default 1.5;
     449            boolean bit() default true;
     450            char ch() default 'A';
     451        }");
     452       
     453        writeFile($Path_v2."/ChangedAnnotation.java",
     454        "package $PackageName;
     455       
     456        enum MyEnum {
     457            SUNDAY, MONDAY
     458        }
     459       
     460        public \@interface ChangedAnnotation {
     461            String value() default \"Str\";
     462            String datatype();
     463            int[] values();
     464            int[] nums() default {1, 2};
     465            int[] new_default_param() default {1, 2};
     466            int[] new_param();
     467            String[] safe_change() default {\"Str\"};
     468            MyEnum day() default MyEnum.MONDAY;
     469        }");
     470       
     471        writeFile($TestsPath."/Test_ChangedAnnotation.java",
     472        "import $PackageName.*;
     473        public class Test_ChangedAnnotation {
     474            public static void main(String[] args) {
     475                testMethod();
     476            }
     477           
     478            \@ChangedAnnotation(value=\"Val\")
     479            static void testMethod() {
     480            }
     481        }");
     482       
    404483        # Beta Annotation
    405484        writeFile($Path_v1."/Beta.java",
     
    752831    "package $PackageName;
    753832    public class ChangedFinalFieldValue {
    754         public final int field = 1;
     833        enum MyEnum {
     834            ONE, TWO
     835        }
     836        public final int    field1 = 1;
    755837        public final String field2 = \" \";
     838        public final MyEnum field3 = MyEnum.ONE;
    756839    }");
    757840    writeFile($Path_v2."/ChangedFinalFieldValue.java",
    758841    "package $PackageName;
    759842    public class ChangedFinalFieldValue {
    760         public final int field = 2;
     843        enum MyEnum {
     844            ONE, TWO
     845        }
     846        public final int    field1 = 2;
    761847        public final String field2 = \"newValue\";
     848        public final MyEnum field3 = MyEnum.TWO;
    762849    }");
    763850   
     
    19202007        $Cmd .= " -old-style";
    19212008    }
     2009    if(my $JdkPath = $In::Opt{"JdkPath"}) {
     2010        $Cmd .= " -jdk-path \"$JdkPath\"";
     2011    }
    19222012   
    19232013    my $TmpDir = $In::Opt{"Tmp"};
Note: See TracChangeset for help on using the changeset viewer.