Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1031188 // DynamicObject Dynamic Interface Implementation Test [OK]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 1113K of libraries. Click here for Pure Java version (6618L/35K).

!7

cmodule2 > DynTestModule {
  void test {
    new DynamicObject o;
    
    // make o dynamically implement IF0
    
    addDynamicInterface(o, IF0, () -> "hello");
    
    // check that the dynamic implementation works
    assertEqualsVerbose("hello", lookupDynamicInterface(o, IF0).get());
    
    // and that we get null for non-implemented interfaces
    assertNullVerbose(lookupDynamicInterface(o, IF1));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031188
Snippet name: DynamicObject Dynamic Interface Implementation Test [OK]
Eternal ID of this version: #1031188/10
Text MD5: 0c3288d565d514ac5fb34406152b4c28
Transpilation MD5: 01774446c15928768bdb6bcfe32d22a6
Author: stefan
Category: javax / dynamic modules
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-20 15:58:49
Source code size: 436 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 174 / 312
Version history: 9 change(s)
Referenced in: [show references]