GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tik5213/DUnit: DUnit is used to test or display functions or components to others.

BranchesTags
Open more actions menu

Latest commit

 

History

73 Commits
73 Commits

Folders and files

NameName
Last commit message
Last commit date
dunit-compiler
dunit-compiler
 
 
dunit-library
dunit-library
 
 
dunit
dunit
 
 
gradle/wrapper
gradle/wrapper
 
 
img
img
 
 
sample-simple
sample-simple
 
 
sample-test-kotlin-library
sample-test-kotlin-library
 
 
sample-test-library
sample-test-library
 
 
sample
sample
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

DUnit

DUnit is used to test or display functions or components to others.

img1 img2 img3 img4

Download

dependencies {
  compile 'top.ftas:dunit:2.1'
  annotationProcessor 'top.ftas:dunit-compiler:2.1'
}

Usage1

Add annotations to existing activities:

```java
@DUnit
public class BaseActivity extends Activity{ /* Do something */ }
```

Usage2

  1. Define groups:

    @DUnitGroup("HttpGroup")
    public class HttpGroup extends DUnitRootGroup{}

    or

    @DUnitGroup
    public class ObjectGroup {
    }
  2. Create a display unit:

    @DUnit(
    		name = "RetrofitDisplayUnit",
    		group = HttpGroup.class
    )
    public class RetrofitDisplayUnit extends AbstractDisplayUnit{
    	@Override
    	public void callUnit() { /* Do something */ }
    }

Usage3

java

```sh
android {
	defaultConfig {
		javaCompileOptions {
			annotationProcessorOptions {
				arguments = [DUNIT_MODULE_NAME : "sample"]
			}
		}
	}
}
```

kotlin

```sh
kapt {
	arguments {
		arg("DUNIT_MODULE_NAME", "sample_kotlin")
	}
}
```

Usage4 paramJson

@DUnit(name = "SampleTestLibraryActivity - paramJson",paramJson = "{\"testName\":\"I am from other library!\",\"testAge\":18}")
public class SampleTestLibraryActivity extends Activity{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sample_test_library);
        TextView textView = (TextView) findViewById(R.id.hello_txt);

        String str = "Hello,SampleTestLibraryActivity!";
        Intent intent = getIntent();
        if (intent != null) {
            str += "\nname:" + intent.getStringExtra("testName");
            str += "\nage:" + intent.getIntExtra("testAge", -1);
        }

        textView.setText(str);
    }
}

paramJson

About

DUnit is used to test or display functions or components to others.

Resources

Readme
Apache-2.0 license
Activity

Stars

2 stars

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.