{"id":22887201,"url":"https://github.com/electrostat-lab/jme3-testable","last_synced_at":"2025-07-09T01:09:32.855Z","repository":{"id":221681985,"uuid":"755076087","full_name":"Electrostat-Lab/Jme3-testable","owner":"Electrostat-Lab","description":"An API designed to automatically select and test jme3 examples.","archived":false,"fork":false,"pushed_at":"2024-02-09T12:12:42.000Z","size":91,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-06T23:30:43.041Z","etag":null,"topics":["annotations","api-design","automated-testing","desktop","electrostat-lab","java","java-reflection","jmonkeyengine3"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Electrostat-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-09T11:50:39.000Z","updated_at":"2024-08-09T18:45:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd879e5f-a9d1-4ec3-b8e8-384beac24483","html_url":"https://github.com/Electrostat-Lab/Jme3-testable","commit_stats":null,"previous_names":["software-hardware-codesign/jme3-testable","electrostat-lab/jme3-testable"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJme3-testable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJme3-testable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJme3-testable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Electrostat-Lab%2FJme3-testable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Electrostat-Lab","download_url":"https://codeload.github.com/Electrostat-Lab/Jme3-testable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523874,"owners_count":20791444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotations","api-design","automated-testing","desktop","electrostat-lab","java","java-reflection","jmonkeyengine3"],"created_at":"2024-12-13T20:31:31.135Z","updated_at":"2025-03-31T19:13:24.004Z","avatar_url":"https://github.com/Electrostat-Lab.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jme3-testable API\n\nThis is an initial  implementation for the testable api, targeting issue [jmonkeyengine#1649](https://github.com/jMonkeyEngine/jmonkeyengine/issues/1649), which suggests building a better test chooser backend for jme3-examples, where one can pickup which test cases to run inside a package.\n\nThis is a video demonstrating testables in action: \n\n[![Video](https://user-images.githubusercontent.com/60224159/170361202-c6c75a54-4197-446a-a653-fbe2fb2b7e7d.jpg)](https://www.youtube.com/watch?v=u9biai9Yg38)\n\n## F.A.Q: \n\n**How can I make my own test?**: \nA: Your test should `extends JmeTestApp` or `JmeTestState`, in either cases, you will override `launch()` method and add what you want to test there, whether a `JmeApplication.attachState(this); for AppStates` or `setting up AppSettings and start()` or `setting up a JmeSurfaceView for android`. \n\n**Does this approach provide a recursive way of opening a package?**\nA; Yep, all you need to do, is to give the package, which can be done by 2 methods : \nMETHOD-A : \n```java\n TestableExecutor.getInstance().launch(\"jme3test\", \"--No-Data--\", tags);\n```\nMETHOD-B : \n```java\n TestableExecutor.getInstance().launch(Main.class.getPackage().getName(),\n                                       \"--No-Data--\", tags);\n```\n**Can I test multiple packages that aren't on the same tree, at the same time?**\nA: Yep, just use : \n```java\nTestableExecutor.getInstance().launch(new String[] {\"jme3test.app\", \"jme3test.animation\"},\n                                     \"--No-Data--\", tags);\n```\n**Can I use multiple tags in the same `@TestableTags` annoation?**\nA: Yep, use this: \n```java\n@TestableTags({Launcher.TAG_WATER_FILTERS, Launcher.TAG_ALL})\n```\nBut, no `@TestableTags` repetition...it complicates simple stuff and not clean anyway.\n\n**What will happen if I have non-class files on my package**\nA: Don't worry, the utility skips those.\n\n**What will happen if I have other classes not implementing the Testable?** \nA: Those are skipped too.\n \n**Can I use this on android?**\nA: Theoretically, you can, but I haven't found the time to test that yet.\n\n**What will happen if I extended JmeTestApp and didn't add a `@TestableTags` with a signature?**\nA: The utility will exclude this test, because how should it know 'is it ready to be executed?', if you want to run all Testables under a package then use a unified tag in all those classes, for example, add this to all the testables you want to run `Launcher.TAG_ALL` while you can still use other tags to filter your tests for other run configurations: \n```java\n@TestableTags({Launcher.TAG_WATER_FILTERS, Launcher.TAG_ALL})\n``` \n \nI think that is it, for now, if that is what you are seeking, then i hope it will be helpful, please give a quick review.\n\n## Examples:\n1) The Testable class : \n```java\npackage jme3test.app.test;\n\nimport com.jme3.system.AppSettings;\nimport com.avrsandbox.jme3.testable.app.JmeAppTest;\nimport com.jme3.scene.Geometry;\nimport com.jme3.scene.shape.Box;\nimport com.avrsandbox.jme3.testable.TestableTags;\nimport jme3test.Launcher;\n\n/**\n * Test a bare-bones application, without SimpleApplication.\n */\n@TestableTags({Launcher.TAG_ALL})\npublic class BareBonesAppTest extends JmeAppTest\u003cAppSettings\u003e {\n\n    private Geometry boxGeom;\n\n    public static void main(String[] args){\n        AppSettings settings = new AppSettings(true);\n        settings.setRenderer(AppSettings.LWJGL_OPENGL2);\n        settings.setAudioRenderer(AppSettings.LWJGL_OPENAL);\n        new BareBonesAppTest().launch(settings);\n    }\n\n\n    @Override\n    public void simpleUpdate(float tpf) {\n        super.simpleUpdate(tpf);\n        boxGeom.rotate(tpf * 2, tpf * 4, tpf * 3);\n    }\n\n    @Override\n    public void simpleInitApp() {\n        // create a box\n        boxGeom = new Geometry(\"Box\", new Box(2, 2, 2));\n\n        // load some default material\n        boxGeom.setMaterial(assetManager.loadMaterial(\"Interface/Logo/Logo.j3m\"));\n\n        // attach box to display in primary viewport\n        rootNode.attachChild(boxGeom);\n    }\n\n\n    @Override\n    public void launch(AppSettings userData) {\n        super.launch(userData);\n        setSettings(userData);\n        setShowSettings(false);\n        start();\n    }\n}\n```\n2) The Launcher (main class) : \n```java\npackage jme3test;\n\nimport com.jme3.system.AppSettings;\nimport com.avrsandbox.testable.util.TestableExecutor;\nimport java.lang.reflect.InvocationTargetException;\n\n/**\n * Tests the new jme test api.\n *\n * @author pavl_g.\n */\npublic class Launcher {\n    public static final String TAG_ALL = \"ALL\";\n    public static final String TAG_WATER_FILTERS = \"WATER-FILTER\";\n    public static final String TAG_PBR = \"PBR\";\n\n    public static final String[] tags = new String[] {\n            TAG_ALL\n    };\n\n    public static void main(String[] args) throws InstantiationException, IllegalAccessException,\n                                                  ClassNotFoundException, NoSuchMethodException,\n                                                  InvocationTargetException {\n        final AppSettings settings = new AppSettings(true);\n        settings.setRenderer(AppSettings.LWJGL_OPENGL2);\n        settings.setAudioRenderer(AppSettings.LWJGL_OPENAL);\n        TestableExecutor.getInstance().launch(new String[] {\"jme3test\"}, settings, tags);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectrostat-lab%2Fjme3-testable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectrostat-lab%2Fjme3-testable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectrostat-lab%2Fjme3-testable/lists"}