git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorSweidan Omar <TFS\sweidan.omar>
Fri, 10 Dec 2021 09:59:15 +0000 (09:59 +0000)
committerSweidan Omar <TFS\sweidan.omar>
Fri, 10 Dec 2021 09:59:15 +0000 (09:59 +0000)
server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java

index bf52e6484f041e2c28df5be009f641392f19c150..7fc4751cc15a04b0813351d066dbcabaa50d2be9 100644 (file)
@@ -162,7 +162,7 @@ public class SmallTests {
 \r
                System.out.println(x.compareTo(y));\r
 \r
-               //A TreeSet novekvo sorrendben adja vissza, a korabbi datum lesz elol\r
+               // A TreeSet novekvo sorrendben adja vissza, a korabbi datum lesz elol\r
                Set<String> sut = new TreeSet<>();\r
 \r
                sut.add("2020.03.01_12:00:00");\r
@@ -252,7 +252,8 @@ public class SmallTests {
                Object[] inputs = { mediaCubeMedia, targetPath, targetNamePattern, successRecipient, killDateDays,\r
                                localRetrievePath, globalRetrievePath, useNexioTarget, nexioAgency, nexioPort, nexioUserName,\r
                                nexioPassword };\r
-               //              Object[] inputs = { null, null, null, null, 0, null, null, false, null, 0, null, null };\r
+               // Object[] inputs = { null, null, null, null, 0, null, null, false, null, 0,\r
+               // null, null };\r
                sut.run(null, null, inputs);\r
        }\r
 \r
@@ -372,7 +373,8 @@ public class SmallTests {
        @Test\r
        public void test94() throws Exception {\r
                List<String> uploads = Files.readAllLines(Paths.get("/opt/AMC/upload-errors.csv"));\r
-               //List<String> downloads = Files.readAllLines(Paths.get("/opt/AMC/download-errors.csv"));\r
+               // List<String> downloads =\r
+               // Files.readAllLines(Paths.get("/opt/AMC/download-errors.csv"));\r
 \r
                Map<String, String> ups = new HashMap<>();\r
 \r
@@ -420,13 +422,13 @@ public class SmallTests {
                        System.out.println(content);\r
                        System.out.println("...");\r
 \r
-                       //                      if (countMatches > 1) {\r
-                       //                              countMultiTouched++;\r
-                       //                      }\r
+                       // if (countMatches > 1) {\r
+                       // countMultiTouched++;\r
+                       // }\r
 \r
                }\r
                System.out.println(countTouched);\r
-               //              System.out.println(countMultiTouched);\r
+               // System.out.println(countMultiTouched);\r
        }\r
 \r
        @Test\r
@@ -472,7 +474,7 @@ public class SmallTests {
                        int nexio = Integer.parseInt(clip[2]);\r
                        if (mc > nexio) {\r
                                errors.add(clipName);\r
-                               //                              System.out.println("Added: " + clipName);\r
+                               // System.out.println("Added: " + clipName);\r
                        }\r
                }\r
 \r
@@ -491,7 +493,8 @@ public class SmallTests {
                }\r
        }\r
 \r
-       //update mediafile set relativepath ='CCEM100023-14.mxf.part' where relativepath ='CCEM100023-14.mxf';\r
+       // update mediafile set relativepath ='CCEM100023-14.mxf.part' where\r
+       // relativepath ='CCEM100023-14.mxf';\r
        @Test\r
        public void test97() throws Exception {\r
                List<String> lines = Files.readAllLines(Paths.get("/opt/ordered-errors-sql.txt"));\r
@@ -504,7 +507,7 @@ public class SmallTests {
                Files.write(Paths.get("/opt/sql.txt"), out);\r
        }\r
 \r
-       //ffmpeg hls\r
+       // ffmpeg hls\r
        @Test\r
        public void test99() throws Exception {\r
                System.setProperty("jobengine.ffmpeg.location", "/Programs/ffmpeg/bin/ffmpeg.exe");\r
@@ -518,12 +521,12 @@ public class SmallTests {
                });\r
        }\r
 \r
-       //mc tsm tartalom osszehasonlitas\r
+       // mc tsm tartalom osszehasonlitas\r
        @Test\r
        public void test990() throws Exception {\r
                List<String> missing = new ArrayList<>();\r
 \r
-               //pasatol/lekerdezes\r
+               // pasatol/lekerdezes\r
                List<String> mcL = Files.readAllLines(Paths.get("/opt/AMC/mc.txt"));\r
                //\r
                List<String> tsmL = Files.readAllLines(Paths.get("/opt/AMC/tsm.txt"));\r
@@ -540,7 +543,7 @@ public class SmallTests {
                Files.write(Paths.get("/opt/AMC/missing.txt"), missing);\r
        }\r
 \r
-       //tsm-missing pasa tartalom osszehasonlitas\r
+       // tsm-missing pasa tartalom osszehasonlitas\r
        @Test\r
        public void test991() throws Exception {\r
                List<String> mcmissing = new ArrayList<>();\r
@@ -557,7 +560,7 @@ public class SmallTests {
                Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing);\r
        }\r
 \r
-       //nexio modification change\r
+       // nexio modification change\r
        @Test\r
        public void test992() throws Exception {\r
                Timestamp nexio = Timestamp.from(Instant.now().minus(2, ChronoUnit.HOURS));\r
@@ -569,10 +572,10 @@ public class SmallTests {
                System.out.println(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(ldt));\r
        }\r
 \r
-       //mv missing from tsm\r
+       // mv missing from tsm\r
        @Test\r
        public void test993() throws Exception {\r
-               //List<String> missing = Files.readAllLines(Paths.get("/opt/mv-missing.txt"));\r
+               // List<String> missing = Files.readAllLines(Paths.get("/opt/mv-missing.txt"));\r
                List<String> missing = Files.readAllLines(Paths.get("/opt/mv-mc-all.txt"));\r
                String tsm = new String(Files.readAllBytes(Paths.get("/opt/mv-tsm.txt")));\r
                String polc = new String(Files.readAllBytes(Paths.get("/opt/mv-polc.txt")));\r
@@ -612,8 +615,8 @@ public class SmallTests {
                        fCount++;\r
                        System.out.println(fileName + " " + fCount);\r
 \r
-                       //                      if (rd.contains(onlyId))\r
-                       //                              inrd++;\r
+                       // if (rd.contains(onlyId))\r
+                       // inrd++;\r
 \r
                        if (fileName.startsWith("R")) {\r
                                ad++;\r
@@ -622,17 +625,17 @@ public class SmallTests {
                        else if (fileName.startsWith("M")) {\r
                                material++;\r
                        } else {\r
-                               //System.out.println(onlyId);\r
+                               // System.out.println(onlyId);\r
                                other++;\r
                        }\r
                }\r
                System.out.println(String.format("TSM hiány %d, polcon van %d, omben van %d", fCount, pCount, oCount));\r
                System.out.println(String.format("Egyéb %d, Reklám %d, Promó %d, Anyag %d, Adásban volt %d", other, ad, promo,\r
                                material, inrd));\r
-               //              Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing);\r
+               // Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing);\r
        }\r
 \r
-       //archiveitem+tags\r
+       // archiveitem+tags\r
        @Test\r
        public void test994() throws Exception {\r
                ArchiveItem archiveItem = ArchiveItem.fromFile(Paths.get("/opt1/.STATUS/0409_2032_UJ_OVI_OVB_MIX.MXF.json"));\r
@@ -647,7 +650,7 @@ public class SmallTests {
 \r
        }\r
 \r
-       //mv migracio report\r
+       // mv migracio report\r
        @Test\r
        public void test995() throws Exception {\r
                String tsm = new String(Files.readAllBytes(Paths.get("/opt/mv-tsm.txt")));\r
@@ -677,7 +680,7 @@ public class SmallTests {
                        boolean tsmContains = tsm.contains(fileName);\r
                        if (tsmContains) {\r
                                archivedCount++;\r
-                               //System.out.println("Skipping archived " + omFilePath);\r
+                               // System.out.println("Skipping archived " + omFilePath);\r
                                continue;\r
                        }\r
 \r
@@ -687,12 +690,13 @@ public class SmallTests {
                float archivePercent = archivedCount * 100 / omCount;\r
                System.out.println(String.format("Archiválandó %d, archivált %d, nem archivált %d, százalék %f", omCount,\r
                                archivedCount, errorCount, archivePercent));\r
-               //              Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing);\r
+               // Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing);\r
        }\r
 \r
-       //mv mc-tsm kulonbseg report\r
-       //select relativepath from mediafile;\r
-       // dsmadmc -id=support -password=userkft1q2 -TABdelimited "select LL_NAME from backups where FILESPACE_NAME LIKE '%JOBENGINE%'" > /opt/mv-tsm.txt\r
+       // mv mc-tsm kulonbseg report\r
+       // select relativepath from mediafile;\r
+       // dsmadmc -id=support -password=userkft1q2 -TABdelimited "select LL_NAME from\r
+       // backups where FILESPACE_NAME LIKE '%JOBENGINE%'" > /opt/mv-tsm.txt\r
        @Test\r
        public void test996() throws Exception {\r
                String tsm = new String(Files.readAllBytes(Paths.get("/opt/mv-tsm.txt")));\r
@@ -702,12 +706,12 @@ public class SmallTests {
                int errorCount = 0;\r
                for (String fileName : mc) {\r
 \r
-                       //TODO idezojelek eltavolitasa\r
+                       // TODO idezojelek eltavolitasa\r
                        int lastIndexOf = fileName.lastIndexOf("-");\r
                        if (lastIndexOf > -1) {\r
                                String fileId = fileName.substring(0, lastIndexOf);\r
                                if (exclude.contains(fileId)) {\r
-                                       //System.out.println("Excluded " + fileName);\r
+                                       // System.out.println("Excluded " + fileName);\r
                                        continue;\r
                                }\r
                        }\r
@@ -724,7 +728,7 @@ public class SmallTests {
                Files.write(Paths.get("/opt/mc-drop.sql"), sb);\r
        }\r
 \r
-       //mv exclude size by ID\r
+       // mv exclude size by ID\r
        @Test\r
        public void test997() throws Exception {\r
                List<String> om = Files.readAllLines(Paths.get("/opt/mv-omarchive-size.txt"));\r
@@ -749,7 +753,7 @@ public class SmallTests {
                        String fileId = (lastHyphen < 0) ? fileName : fileName.substring(0, lastHyphen);\r
                        if (exclude.contains(fileId)) {\r
                                out.add(omPath);\r
-                               //System.out.println(omPath);\r
+                               // System.out.println(omPath);\r
                                omExcludeCount++;\r
                                omExcludeSizeSum += omSize;\r
                        }\r
@@ -762,7 +766,7 @@ public class SmallTests {
                Files.write(Paths.get("/opt/mv-excluded-parlament-byid.txt"), out);\r
        }\r
 \r
-       //mv exclude size by name\r
+       // mv exclude size by name\r
        @Test\r
        public void test998() throws Exception {\r
                List<String> om = Files.readAllLines(Paths.get("/opt/mv-omarchive-size.txt"));\r
@@ -797,7 +801,7 @@ public class SmallTests {
                Files.write(Paths.get("/opt/mv-excluded-parlament-name.txt"), out);\r
        }\r
 \r
-       //lastminute\r
+       // lastminute\r
        @Test\r
        public void test999() throws Exception {\r
                List<String> lastMinute = Files.readAllLines(Paths.get("/opt/mv-lastminute.txt"));\r
@@ -820,20 +824,21 @@ public class SmallTests {
                        }\r
 \r
                        if (!tsm.contains(fileName)) {\r
-                               //System.out.println("Missing " + fileName);\r
+                               // System.out.println("Missing " + fileName);\r
                                out.add(lastMinuteToken);\r
                                count++;\r
                        }\r
 \r
                }\r
                System.out.println("All " + count);\r
-               //              String excludedReport = String.format("Kihagyva %d db, összméret %s", omExcludeCount, readableFileSize(omExcludeSizeSum));\r
-               //              System.out.println(excludedReport);\r
+               // String excludedReport = String.format("Kihagyva %d db, összméret %s",\r
+               // omExcludeCount, readableFileSize(omExcludeSizeSum));\r
+               // System.out.println(excludedReport);\r
                //\r
                Files.write(Paths.get("/opt/mv-lastminute-missing.txt"), out);\r
        }\r
 \r
-       //migration report\r
+       // migration report\r
        @Test\r
        public void test9990() throws Exception {\r
                List<String> mc = Files.readAllLines(Paths.get("/opt/mv-mc-houseid.txt"));\r
@@ -845,7 +850,7 @@ public class SmallTests {
                int omcount = 0;\r
                for (String omToken : om) {\r
                        if (omToken.indexOf("/") == omToken.lastIndexOf("/")) {\r
-                               //System.out.println("Skipping " + omToken);\r
+                               // System.out.println("Skipping " + omToken);\r
                                continue;\r
                        }\r
 \r
@@ -854,14 +859,14 @@ public class SmallTests {
                        if (lastIndexOf > -1) {\r
                                String fileId = fileName.substring(0, lastIndexOf);\r
                                if (exclude.contains(fileId)) {\r
-                                       //System.out.println("Excluded " + fileName);\r
+                                       // System.out.println("Excluded " + fileName);\r
                                        continue;\r
                                }\r
                        }\r
 \r
                        omcount++;\r
                        if (!mc.contains(fileName)) {\r
-                               //System.out.println("Missing " + fileName);\r
+                               // System.out.println("Missing " + fileName);\r
                                out.add(omToken);\r
                                count++;\r
                                continue;\r
@@ -869,8 +874,9 @@ public class SmallTests {
                }\r
                System.out.println(\r
                                "All (no PTV) " + omcount + " missing " + count + " completed " + ((count * 100) / omcount) + "%");\r
-               //              String excludedReport = String.format("Kihagyva %d db, összméret %s", omExcludeCount, readableFileSize(omExcludeSizeSum));\r
-               //              System.out.println(excludedReport);\r
+               // String excludedReport = String.format("Kihagyva %d db, összméret %s",\r
+               // omExcludeCount, readableFileSize(omExcludeSizeSum));\r
+               // System.out.println(excludedReport);\r
                //\r
                Files.write(Paths.get("/opt/mv-missing-noptv.txt"), out);\r
        }\r
@@ -902,8 +908,10 @@ public class SmallTests {
 \r
        @Test\r
        public void test9994() throws Exception {\r
-               //              List<String> tsm = Files.readAllLines(Paths.get("/opt/AMC/tsm-archived-from0903.txt"));\r
-               //              List<String> mc = Files.readAllLines(Paths.get("/opt/AMC/mc-archive-modified-from0903.txt"));\r
+               // List<String> tsm =\r
+               // Files.readAllLines(Paths.get("/opt/AMC/tsm-archived-from0903.txt"));\r
+               // List<String> mc =\r
+               // Files.readAllLines(Paths.get("/opt/AMC/mc-archive-modified-from0903.txt"));\r
 \r
                LinkedHashSet<String> tsm = new LinkedHashSet<>(Files.readAllLines(Paths.get("/opt/AMC/tsm-all-withdate.txt")));\r
                LinkedHashSet<String> mc = new LinkedHashSet<>(Files.readAllLines(Paths.get("/opt/AMC/mc-witharchived.txt")));\r
@@ -920,12 +928,13 @@ public class SmallTests {
                        else\r
                                return id;\r
                }).forEach(id1 -> {\r
-                       //System.out.println(id1.toString());\r
+                       // System.out.println(id1.toString());\r
                        mcjob.add(id1.toString());\r
 \r
                });\r
 \r
-               //              List<String> mc = Files.readAllLines(Paths.get("/opt/AMC/mc-all-modified.txt"));\r
+               // List<String> mc =\r
+               // Files.readAllLines(Paths.get("/opt/AMC/mc-all-modified.txt"));\r
                Map<String, String> tsmmap = new HashMap<>();\r
                for (String t : tsm) {\r
                        String[] tokens = t.split("\t");\r
@@ -946,7 +955,7 @@ public class SmallTests {
                Map<String, String> mcmap = new LinkedHashMap<>();\r
                for (String m : mc) {\r
 \r
-                       //System.out.println(m);\r
+                       // System.out.println(m);\r
                        String[] tokens = m.split(";");\r
 \r
                        String id = tokens[0];\r
@@ -1067,7 +1076,7 @@ public class SmallTests {
                System.out.println(sut.toString());\r
        }\r
 \r
-       //htv errors\r
+       // htv errors\r
        @Test\r
        public void test9999() throws Exception {\r
                Set<String> tsm = new LinkedHashSet<>(Files.readAllLines(Paths.get("/opt/HTV/htv-tsm.txt")));\r
@@ -1088,13 +1097,13 @@ public class SmallTests {
                System.out.println("All missing: " + errorCount);\r
        }\r
 \r
-       //amc format check\r
+       // amc format check\r
        @Test\r
        public void test99990() throws Exception {\r
-               //              Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/SD/");\r
-               //              String tag = "SD_MAIN_422";\r
-               //              Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/HD/");\r
-               //              String tag = "HD";\r
+               // Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/SD/");\r
+               // String tag = "SD_MAIN_422";\r
+               // Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/HD/");\r
+               // String tag = "HD";\r
                Path source = Paths.get("/opt/AMC/2021/ISSUES/#203/SelenioPool_16_9/");\r
                String tag = "SD_HIGH_16_9";\r
 \r
@@ -1128,7 +1137,7 @@ public class SmallTests {
                }\r
        }\r
 \r
-       //amc get free space\r
+       // amc get free space\r
        @Test\r
        public void test99991() throws Exception {\r
                try {\r
@@ -1161,10 +1170,10 @@ public class SmallTests {
                su.setUserName("dani");\r
                su.setPassword("dani");\r
                su.setRootPath("ftp-1/xxx");\r
-               //              FtpDirectoryLister lister = (FtpDirectoryLister) su.getLister();\r
-               //              FTPClient ftp = lister.connect();\r
-               //              System.out.println(ftp.changeWorkingDirectory("ftp-1"));\r
-               //              System.out.println(ftp.changeWorkingDirectory("xxx"));\r
+               // FtpDirectoryLister lister = (FtpDirectoryLister) su.getLister();\r
+               // FTPClient ftp = lister.connect();\r
+               // System.out.println(ftp.changeWorkingDirectory("ftp-1"));\r
+               // System.out.println(ftp.changeWorkingDirectory("xxx"));\r
 \r
                List<RemoteFile> list = su.getRemoteFiles();\r
                su.cleanUp();\r
@@ -1223,9 +1232,9 @@ public class SmallTests {
                                "c:\\opt\\AMC\\2021\\ISSUES\\#203\\IPR000011027_169.mxf");\r
                for (String file : files) {\r
                        try (user.commons.mediaarea.MediaInfo mi = new user.commons.mediaarea.MediaInfo(file)) {\r
-                               //Display aspect ratio\r
-                               //Format profile\r
-                               //String inform = mi.inform();\r
+                               // Display aspect ratio\r
+                               // Format profile\r
+                               // String inform = mi.inform();\r
                                System.out.println("---------------------------------------");\r
                                System.out.println(file);\r
                                System.out.println(mi.get(StreamKind.Video, 0, "Width"));\r
@@ -1306,9 +1315,12 @@ public class SmallTests {
                assertNotNull(settings);\r
        }\r
 \r
-       //AMC hianyzo hangsav hibakereses\r
-       //select finished,related from job where name='Archiválás' and finished is not null order by finished\r
-       //dsmadmc -id=support -password=userkft -TABdelimited -dataonly=yes "select backup_date ||','|| replace(replace(LL_NAME, '.mxf', ''),'/','') from backups where NODE_NAME='PASANODE' and state='ACTIVE_VERSION'"\r
+       // AMC hianyzo hangsav hibakereses\r
+       // select finished,related from job where name='Archiválás' and finished is not\r
+       // null order by finished\r
+       // dsmadmc -id=support -password=userkft -TABdelimited -dataonly=yes "select\r
+       // backup_date ||','|| replace(replace(LL_NAME, '.mxf', ''),'/','') from backups\r
+       // where NODE_NAME='PASANODE' and state='ACTIVE_VERSION'"\r
        @Test\r
        public void test999993() throws Exception {\r
                List<String> jobs = Files.readAllLines(Paths.get("/opt/AMC/2021/TSM-ERROR/archive-jobs"));\r
@@ -1325,7 +1337,7 @@ public class SmallTests {
                                jobsMap.put(name, dt);\r
                        else if (stored.before(dt))\r
                                jobsMap.put(name, dt);\r
-                       //                      System.out.println(name);\r
+                       // System.out.println(name);\r
                }\r
 \r
                List<String> tsm = Files.readAllLines(Paths.get("/opt/AMC/2021/TSM-ERROR/archive-tsm"));\r
@@ -1337,7 +1349,7 @@ public class SmallTests {
                        Date dt = df1.parse(tokens[0]);\r
                        String name = tokens[1].replace(".part", "");\r
                        tsmMap.put(name, dt);\r
-                       //System.out.println(name);\r
+                       // System.out.println(name);\r
                }\r
 \r
                System.out.println("NAME, TSM DATE, ARCHIVE DATE");\r
@@ -1368,7 +1380,7 @@ public class SmallTests {
                }\r
        }\r
 \r
-       //MediaCube client\r
+       // MediaCube client\r
        @Test\r
        public void test999994() throws Exception {\r
                MediaCubeClient mc = new MediaCubeClient("http://localhost:9080");\r
@@ -1424,8 +1436,8 @@ public class SmallTests {
                                lastDir = lastDir.replace("X:", "");\r
                                lastDir = lastDir.replace("\\", "/");\r
                                lastDir = lastDir.trim();\r
-                               //                              if (!lastDir.endsWith(".STATUS"))\r
-                               //                                      System.out.println(">> " + lastDir);\r
+                               // if (!lastDir.endsWith(".STATUS"))\r
+                               // System.out.println(">> " + lastDir);\r
                        }\r
 \r
                        if (lastDir != null && lastDir.endsWith(".STATUS"))\r