Skip to content

Commit

Permalink
TestCases for issues UiPath#30 and UiPath#31
Browse files Browse the repository at this point in the history
  • Loading branch information
VladNicula24S committed Dec 4, 2020
1 parent 3827d5c commit 9946830
Show file tree
Hide file tree
Showing 7 changed files with 539 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
/Activities/Java/Invoke/out
/Activities/Java/Invoke/.idea
/Activities/Java/Invoke/.idea/artifacts
/Activities/Java/TestProgram/.idea
/Activities/Java/TestProgram/out/production/TestProgram/uipath/java/test
Binary file modified Activities/Java/TestProgram/artifacts/TestProgram.jar
Binary file not shown.
17 changes: 17 additions & 0 deletions Activities/Java/TestProgram/src/uipath/java/test/Cons.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package uipath.java.test;

public class Cons {
String[] arr;

public Cons(String[] cons) {}

public Cons(String cons) {}

public Cons(int[] cons) {}

public Cons(float[] cons) {}

public static void Write(String[] args) {
System.out.println(args.length);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package uipath.java.test;

public class GenericMethods {
public String message;
String[] arr;

public GenericMethods() {
System.out.println("Constructor without parameters");
}

public GenericMethods(String[] cons) {
System.out.println("Constructor with String[]");
}

public GenericMethods(String p1, String p2) {
System.out.println("Constructor with String and String");
}

public GenericMethods(String cons) {
System.out.println("Constructor with String");
}

public GenericMethods(int[] cons) {
System.out.println("Constructor with int[]");
}

public static void Write(String[] args) {
System.out.println("Static method with String[]");
if (args!=null) {
System.out.println(args.length);
}
}

public static void Write(String args) {
System.out.println("Static method with String");
System.out.println(args);
}

public static void Write(int args) {
System.out.println("Static method with int");
System.out.println(args);
}

public static void Write(boolean args) {
System.out.println("Static method with boolean");
System.out.println(args);
}

public static void Write(float args) {
System.out.println("Static method with float");
System.out.println(args);
}

public void WriteObj(String[] args) {
System.out.println("Instance method with String[]");
System.out.println(args);
}

public void WriteObj(String args) {
System.out.println("Instance method with String");
System.out.println(args);
}

public void WriteObj(float args) {
System.out.println("Instance method with float");
System.out.println(args);
}

public <T extends Object> T GenericsExtObj(Object a) {
message = "Generic method with Object " + a;
return (T) ("Generic method with Object " + a);
}

public <T extends String> Object GenericsExtString(T a) {
message = "Generic method " + a;
return "Generic method: " + a;
}

public void GenericsS(String a) {
message = "Method that is named Generics " + a;
System.out.println("Method that is named Generics");
}

public <T> T GenericsR(T a) {
message = "Generic method with return " + a;
System.out.println("Generic method with return");
System.out.println(a);
return a;
}

public void finalize() throws Throwable{
System.out.println("Object is destroyed by the Garbage Collector");
}

public static void foo(){}
}
13 changes: 13 additions & 0 deletions Activities/Java/TestProgram/src/uipath/java/test/GenericsType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package uipath.java.test;

public class GenericsType<T> {
private T t;

public T get() {
return this.t;
}

public void set(T t1) {
this.t = t1;
}
}
Loading

0 comments on commit 9946830

Please sign in to comment.