aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp/common/util
Commit message (Collapse)AuthorAgeFilesLines
* IOUtil.copyStreamChunk2ByteBuffer(..): Added new method to copy a chunk ↵Sven Gothel2023-05-041-0/+112
| | | | | | | | | | (segment) of the input stream (skipBytes, byteCount) This method is inspired by Bug 1280, <https://github.com/sgothel/joal/pull/16>, 'copy only needed bytes' for JOAL's com.jogamp.openal.util.WAVData.loadFromStream(..). This method is a revised version of the proposed IOHelpers.copyFromStream2ByteBuffer(..), see <https://github.com/OndrejSpanel/joal/commit/1616659e98904270af4faca25b770d0983609735>
* Clock: Use Clock.currentNanos() instead of System.nanoTime()Sven Gothel2023-03-073-26/+34
|
* TestRecursiveLock01, TestRecursiveThreadGroupLock01: 'yield()' -> ↵Sven Gothel2023-01-152-6/+6
| | | | 'yield_thread()' to avoid potential Java>17 collision (JEP 361)
* TestIteratorIndexCORE: Fix template usageSven Gothel2023-01-151-11/+11
|
* Bug 1363: Java 11: Complete renaming JEP 178 compatible native lib basename ↵Sven Gothel2019-08-181-1/+1
| | | | | | | | | | gluegen-rt -> gluegen_rt - Fix finding native library for Elf parsing - Fix one unit test - Fix comments Completes commit 330dad069dee5a0cc0480cf5cd9052000004223a
* Bug 1369: SCC: Hide SHA Algorithm bit size in literals of SpecificationSven Gothel2019-04-031-6/+6
| | | | | Implementation currently uses 256 bit Secure Hash (SHA) algorithm, but this may change in the future. Hence only use 'SHA' in the names, not 'SHA256'.
* Bug 1367: TempJarCache: Fix Unit Test using ReflectionsSven Gothel2019-04-031-4/+4
|
* Bug 1369: Source Certification Contract (SCC): Initial SHA256 fingerprint & ↵Sven Gothel2019-04-031-1/+21
| | | | | | | | | | | | | | | | | | | | | runtime validation This change implements a strong SHA256 signature over: 1) source tree inclusive make recipe (SHA256-Source) 2) all class files (SHA256-Classes) 3) all native libraries (SHA256-Natives) 4) the class files as deployed in the jar (SHA256-Classes-this) 5) the native libraries as deployed in the jar (SHA256-Natives-this) and drops all of these in the deployed Jar file. This allows SHA256 validation of (4) + (5) at runtime and further complete validation (1), (2) and (3) offline. Full SCC would now required (1) - (3) to be placed on a server for further validation. Optionally we may use GPG <https://gnupg.org/> or PGP to validate the build entity to implement the chain of trust <https://en.wikipedia.org/wiki/Chain_of_trust> The SHA256 runtime validation is tested via: com.jogamp.common.util.TestVersionInfo
* Bug 1367: Make TempFileCache & TempJarCache even if temp folder can't handle ↵Sven Gothel2019-04-032-12/+12
| | | | executables
* Bug 1366 - Use String.format((Locale)null, "..." ..) avoiding Locale output ↵Sven Gothel2019-03-301-3/+4
| | | | for System related Operations
* Version Semantics Test: Bump for 2.3.2 -> 2.4.xSven Gothel2015-10-121-4/+9
|
* Bug 1243 - Fix IOUtil.cleanPathString(..) special case ; Allow IOUtil and ↵Sven Gothel2015-10-031-3/+85
| | | | | | | | | | | | | | | | | Uri to handle relative path Fix IOUtil.cleanPathString(..) special case: Special case '/a/./../b' -> '/b' requires to resolve './' before '../'. Allow IOUtil and Uri to handle relative path: - IOUtil.getParentOf(..) - IOUtil.cleanPathString(..) Handle cases: 'a/./../b' -> 'b' '.././b' -> '../b' - Uri: Handle null scheme
* Bug 1237 - Clarify IOUtil.getResource(..) for better efficiency, i.e. allow ↵Sven Gothel2015-10-031-4/+4
| | | | | | | | | | | | caller to skip relative futile lookup IOUtil.getResource(..) and IOUtil.ClassResources, needs more clarity. ClassLoader shall be passed explicitly next to the optional relative context Class instance. This allows better efficiency, i.e. caller can pass ClassLoader but skip a possible relative lookup, if not existing.
* Bug 1231: Usability of CustomCompress API incl zip-level; Replace test-exe ↵Sven Gothel2015-09-241-1/+1
| | | | deflated files w/ zip-level 9
* Bug 1231: Add Windows x86_64 test executable ; Use 'WinMain' for Windows ↵Sven Gothel2015-09-242-0/+183
| | | | | | | | | | | | | | | | | test-executable ; Use CustomInflate for Performance - Use 'WinMain' for Windows test-executable This may have little difference than using std 'main' entry - Add Windows x86_64 test executable Since the reporter claims the test executable works well on Windows i386, maybe utilizing a x86_64 test executable on same VM fixes the issue - Use CustomInflate for Performance - Skips GZIP header - Adds own custom header [magic, deflate-size, inflate-size] - Own header allows simplified I/O read and deflation
* Bug 1219: IOUtil.testDirExe: Satisfactory when executed, more debug optionsSven Gothel2015-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | IOUtil.testDirExe(): - Satisfactory when executed Failure to execute produce an IOException right at ProcessBuilder.start(). Hence we can allow an unexpected process exit value, since we only want to learn whether executable files are allowed. - More debug options DEBUG_EXE: 'jogamp.debug.IOUtil.Exe' DEBUG_EXE_NOSTREAM: 'jogamp.debug.IOUtil.Exe.NoStream' - if DEBUG_EXE - a pre-existing 'jogamp_exe_tst'+<SUFFIX> will be used as-is. - the test-exe will not be deleted - StreamMonitor is being used to dump stdout/stderr if !DEBUG_EXE_NOSTREAM.
* Bug 1213: Use InterruptSource.ThreadSven Gothel2015-09-154-11/+14
|
* Bug 1213: Refine changes .. comments and APISven Gothel2015-09-152-2/+4
| | | | | | | | | | | | | | - Use InterruptSource.Thread.create(..), while reducing InterruptSource.Thread ctors to 3 variants. - Use InterruptSource.Thread instead of java.lang.Thread where possible - Use SourcedInterruptedException where possible - SingletonInstanceServerSocket: start(), stop() and run() - Persistent-Wait and Cancelable - Add @since 2.3.2
* Bitfield Unit Test: Add 3bit test-data; Add testing 'untouched' other bits ↵Sven Gothel2015-08-071-7/+54
| | | | of put32/get32
* Fix Bitfield.put(..): Return previous valueSven Gothel2015-08-021-2/+6
|
* Test Bitfield: Validate Bitfield.copy(..) return valueSven Gothel2015-08-021-1/+2
|
* Bitfield: Refine API method names, add clearField(boolean), fix put32(..) ↵Sven Gothel2015-08-021-0/+379
| | | | and bitCount(), add unit test (passed)
* Bitfield: Reuse [BitstreamData -> BitDemoData] for unit testsSven Gothel2015-08-026-6/+67
|
* Bump semver to 0.9.33 w/ our patch for ↵Sven Gothel2015-04-031-3/+3
| | | | CompatibilityType.BACKWARD_COMPATIBLE_BINARY
* Add ArrayHashMap; Use 'supportNullValue' optimizing ArrayHashSet and ↵Sven Gothel2015-04-012-24/+285
| | | | | | ArrayHashMap; Unify ctor for both impl. Add/Enhance unit tests for both.
* TestVersionSemantics: Add version tests: v220 -> v221, v221 -> v230 and v230 ↵v2.3.1Sven Gothel2015-03-271-8/+33
| | | | -> v23x
* Bug 1126 - Remove static query requirement of MachineDescriptor, find ↵Sven Gothel2015-02-022-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | matching StaticConfig at runtime; Fix PPC (Bug 1056) and MIPSLE (Bug 1014) issues. Currently the StaticConfig is being queried via the key[OSType, CPUType ..] as pre-determined by Java properties or the ELF parser. This adds complication to maintain different platforms and the key query might not even be sufficient. The MachineDescriptor's StaticConfig only purpose shall be to speed-up native data size and offset/alignment retrieval. This is done by using the StaticConfig index within all StaticConfig[]s as a lookup-index for the precomputed struct's size and offset tables. +++ Solution: Rename: MachineDescriptor -> MachineDataInfo Rename: MachineDescriptorRuntime -> MachineDataInfoRuntime After having defined os.and.arch (OSType, CPUType and ABIType) w/ the optional help of the now self containing ELF Reader (Bug 1125), the native gluegen-rt library gets loaded enabling JNI methods. It is satisfactory to retrieve MachineDataInfo at runtime w/ JNI and find the matching/compatible StaticConfig. Only in case none is found, the program needs to abort. Otherwise the found MachineDataInfo.StaticConfig and MachineDataInfo are stored for further use (see above). This removes above complication and key to StaticConfig mapping. New platforms simply need to add a new unique entry into the StaticConfig[] table. ++ Also fixes Bug 1056 (PPC), thanks to tmancill [@] debian [.] org, and Bug 1014 (MIPSLE), thanks to Dejan Latinovic. Parts of the patch for Bug 1014 from Dejan Latinovic are included. also solved by this change set.
* Bug 1125 - Make ELF Reader 'jogamp.common.os.elf' StatelessSven Gothel2015-02-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | ELF Reader 'jogamp.common.os.elf' currently uses Platform's pre-determined OS_TYPE and CPUType. It also uses the host platforms MachineDescription, hence can not read ELF files from other machines. This also forbids Platform to determine CPUType etc w/o having a valid 'os.arch' property. +++ ElfHeader should be split in - ElfHeaderPart1 (CPUType independent) - ElfHeaderPart2 (CPUType dependent) Fix shall make the ELF Reader self containing by only using ELF CPUType data, etc. This requires customization of struct parsing, where MachineDescription.Static index shall be - defined in ElfHeaderPart1 using e_Ident's CPUType. - used in ElfHeaderPart2 and all its struct types.
* Bug 1106 - Bitstream: Simplify 'msbFirst' case for bulk operations / Add ↵Sven Gothel2014-12-035-97/+254
| | | | | | | | | | | | | | | | | | | | | | | setting of stream position (optional) - Add setting position entry, optionally supported, e.g. ByteBufferStream and ByteArrayStream - Remove 'msbFirst' parameter on all 'bulk' read/write operations. These methods use LSB-first always, allowing proper stream access of data w/ different bit-sizes. Data is now read/write as little-endian and swapped accordingly. Optimizations are adopted for LSB-first operations. This change removes API confusion/bugs: - removes one decision (parameter) - removes the data reversion case - removes bugs w/ different bit-sizes
* SingletonJunitCase: Increase TO 12 -> 15 mins, only sleep for 1 poll period ↵Sven Gothel2014-10-041-3/+0
| | | | (500 ms) per JVM after test class (cooperative w/ other JVM test instances)
* SingletonTestCase -> SingletonJunitCase: Accomodate ClassLoader lifecycle of ↵Sven Gothel2014-10-0325-83/+64
| | | | static fields; Change name to avoid testing itself.
* SingletonTestCase: Move singleton test impl. from JOGL's UITestCase, inherit ↵Sven Gothel2014-10-0322-44/+44
| | | | | | | | | from JunitTracer and use it for all tests. - Certain performance tests don't make sense utilizing several jenkins unit tests on one machine, hence singleton test execution is desired. - JOGL's UITestCase also will derive from this SingletonTestCase
* MappedByteBuffer*Stream:Sven Gothel2014-10-031-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Validate active and GC'ed mapped-buffer count in cleanAllSlices() via close() .. - Fix missing unmapping last buffer in notifyLengthChangeImpl(), branch criteria was off by one. - cleanSlice(..) now also issues cleanBuffer(..) on the GC'ed entry, hence if WeakReference is still alive, enforce it's release. - cleanBuffer(..) reverts FLUSH_PRE_HARD -> FLUSH_PRE_SOFT in case of an error. - flush() -> flush(boolean metaData) to expose FileChannel.force(metaData). - Add synchronous mode, flushing/syncing the mapped buffers when in READ_WRITE mapping mode and issue FileChannel.force() if not READ_ONLY. Above is implemented via flush()/flushImpl(..) for buffers and FileChannel, as well as in syncSlice(..) for buffers only. flush*()/syncSlice() is covered by: - setLength() - notifyLengthChange*(..) - nextSlice() Always issue flushImpl() in close(). - Windows: Clean all buffers in setLength(), otherwise Windows will report: - Windows: Catch MappedByteBuffer.force() IOException - Optimization of position(..) position(..) is now standalone to allow issuing flushSlice(..) before gathering the new mapped buffer. This shall avoid one extra cache miss. Hence rename positionImpl(..) -> position2(..). - All MappedByteBufferOutputStream.write(..) methods issue syncSlice(..) on the last written current slice to ensure new 'synchronous' mode is honored. +++ Unit tests: - Ensure test files are being deleted - TestByteBufferCopyStream: Reduced test file size to more sensible values. -
* Bug 1063: Complete Uri impl. and adoption throughout GlueGenSven Gothel2014-09-082-22/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Uri: - Add error correction (fix) of path at ctor in case a a contained Uri is requested from an opaque one. The latter might come from URI/URL and is not properly encoded! See Uri.PARSE_HINT_FIX_PATH - Simplify conversion methods: - valueOf(URI/URL): Re-encode only if not opaque - getNativeFilePath() -> toFile() - Move IOUtil Uri related constants to class Uri - Add DEBUG and DEBUG_SHOWFIX - Complete adoption of URI -> Uri changes - IOUtil, JarUtil and TempJarCache still holds some left over deprecated methods, which will be removed after officially starting 2.3.0 (JOGL dependencies) - Otherwise not URI utilization left - Tests - Cleaned ip TestUri01 and TestUri03Resolving - TestUri03Resolving also tests URL -> Uri, and hence mentioned Uri.PARSE_HINT_FIX_PATH
* Bug 1063 - Utilize own Uri and Uri.Encoded class w/ proper encoding and ↵Sven Gothel2014-09-074-489/+2
| | | | | | | | | | | | differentiating encoded/decoded variants by type [Part 1] - Add immutable com.jogamp.common.net.Uri class impl. RFC 2396 w/ encoding of RFC 3986 - Class Uri.Encoded is used to represent encoded parts - IOUtil: Remove unused methods (residing in Uri) and mark others deprecated (will move to Uri) - Adopt usage of Uri: This must be completet in follow-up commits!
* Bug 908: Fix URI/URL double encoding, ensuring encoded/decoded variants are ↵Sven Gothel2014-09-072-176/+144
| | | | | | | | | | | | | | | | | | | | used properly (Added unit test) Bug 908 was caused by confusing URI encoded parts (e.g. scheme-specific-part) and it's decoded variant. This especially happened due to: - the fact, that the encoded and unencoded variant uses the same String type, - the URI/URL decoding differs, is not complete (e.g. %20 .. SPACE remains in decoded part), - and does not comply w/ RFC 2396 and RFC 3986 (encoding), e.g. not all RESERVED chars are encoded. In branch 'v2.3.0_branch', we will introduce our own Uri and Uri.Encoded class to solve above issue by replacing all URI usage w/ Uri. - Backporting results of own Uri class introduction in branch 'v2.3.0_branch' - Ensure the encoded URI parts are used where required, i.e. IOUtil.compose(..) etc - TestNetIOURIReservedCharsBug908: Automated test, launching GlueGen jar file from an <i>odd pathname</i>.
* TestVersionSemantics: BACKWARD_COMPATIBLE_USER current vs 2.2.0Sven Gothel2014-08-281-2/+3
|
* IntIntHashMap: Reduce temp. ArrayList<Entry> instances in cloneSven Gothel2014-08-163-3/+9
|
* Merge remote-tracking branch 'github-mark/master' (Bug 1023, Bug 1024)Sven Gothel2014-07-051-15/+0
|\ | | | | | | | | | | | | | | | | Conflicts: src/java/com/jogamp/common/jvm/JNILibLoaderBase.java src/java/com/jogamp/common/os/Platform.java src/junit/com/jogamp/common/util/TestTempJarCache.java (re-injected that api-doc of addNativeJarLibsImpl)
| * Remove unused addNativeJarLibs() method; the only consumer was a unit testMark Raynsford2014-06-261-15/+0
| | | | | | | | of the method.
* | Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-0336-840/+836
|/ | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* TestVersionSemantics: No more expecting BACKWARD_COMPATIBLE* (Due to bumping ↵Sven Gothel2014-06-171-1/+1
| | | | to 2.2.0)
* Bump semver.jar to 731db3566b4096ecf6a08a9d33991400e66c5021 (sgothel/jogamp ↵Sven Gothel2014-05-131-2/+1
| | | | branch): Using direct regexp for excludes
* Unit Test: Modularize Semantic Version Test / Fix 'excludes'Sven Gothel2014-05-131-73/+25
| | | | | | | Refactor base semjar unit test class into com.jogamp.junit.util.VersionSemanticsUtil, part of new gluegen-test-util.jar. The new gluegen-test-util.jar shall be used by all other modules to test versioning.
* Unit Test: Added Semantic Version Test (Current version agains v2.1.5)Sven Gothel2014-05-131-0/+149
| | | | | | | | | | | | | TestVersionSemantics adds testing of semantic versioning of 2.1.5 gluegen-rt.jar against the current version within a unit test. Currently we expect BACKWARD_COMPATIBLE_USER and need to toggle this to NON_BACKWARD_COMPATIBLE, if actually perfoming non compatible major or minor version changes. The latter is allowed right now, since we increment from 2.1 -> 2.2! - Added https://github.com/jeluard/semantic-versioning semver.jar (Apache License Version 2.0)
* Bug 980: Refine Bitstream API 'signed' and 'unsigned' semantics - ↵Sven Gothel2014-02-215-44/+61
| | | | readUInt32(..) must return long due to EOF
* Bitstream: Refine c70c730b22c847668cf475dc6f841b85297ac3ab: 'toUint32Long' ↵Sven Gothel2014-02-212-4/+4
| | | | -> 'toUInt32Long', add 'uint32LongtoInt'
* Bitstream: Add static 'long toUint32Long(int)' and 'int toUint32Int(int)' ↵Sven Gothel2014-02-212-3/+28
| | | | conversion functions
* Bug 890: Adding versatile Bitstream implementationSven Gothel2014-02-206-0/+1021
| | | | | | | | | | | | | | | | We already have several locations where bitstream operations are required and partially implemented (JPEG decoder, media parsing, ..) as well as endian related conversion (elf parser, ..). Create a versatile Bitstream class allowing: - Utilize I/O operations on I/O streams, buffers and arrays - Consider MSBfirst / LSBfirst mode - Linear bit R/W operations - Bulk R/W operations w/ endian related type conversion - Allow mark/reset and switching streams and input/output mode - Optimized operations Complete set of unit tests included, covering hopefully all cases.
* Bug 945 - GlueGen's IOUtil does not consider file URI's authority when ↵Sven Gothel2014-01-221-13/+26
| | | | | | | | | | | | | | | | | | | | | | | converting to file-path or URI (Windows UNC / share host) Note: Authority for 'file-scheme' URI's is used on Windows to denote the host of the shared resource -> UNC Following methods of IOUtil didn't consider the authority for file-scheme URI: 'URL toURL(final URI uri)' 'String decodeURIToFilePath(final String uriPath)' 'String decodeURIIfFilePath(final URI uri)' Further more, the patterns 'patternSingleFS' and 'patternSingleBS' converted multiple '\' '/' to one replacement. However, we should not change the separator count and replace them one-by-one. TestIOUtilURIHandling: - Added shared-file-host 'filehost' test cases to file URIs and plain file path tests. - Passed on Unix and Windows. Added 'make/scripts/test-win32-smb_share.bat' - Testing actual windows share usage - Passed on Windows