Search Results

Search found 8 results on 1 pages for 'jijoy'.

Page 1/1 | 1 

  • Passing information between test methods in a junit testcase

    - by Jijoy
    Hi, Currently I am creating a TestCase for one work flow and a workflow have different steps. The results of one step is important since , second step needs to know value of step1's execution. class TestCaseWorkFlow1 extends TestCase { private static String resultOfStep1 = null; public void testStep1(){ if(failed){ resultOfStep1 = "failed"; } } public void testStep2(){ if(resultOfStep1 != null ) { //First test failed. }else { } } } Currently we are using static variable to pass information between testmethods . What is the best solution for this scenario ? Please help. Thanks J

    Read the article

  • Java reflection framework and security

    - by Jijoy
    Hi , Assume I have a singleton class in an external lib to my application. But still I can create instances of that particular class using reflection. Like this Class clas = Class.forName(Private.class.getName()); for(Constructor c : clas.getDeclaredConstructors()){ c.setAccessible(true); Private p = (Private) c.newInstance(); System.out.println(p); } How can I restrict this ? . Thanks J

    Read the article

  • How are ambigous methods resolved in java ?

    - by Jijoy
    Hi, I have a question. package org.study.algos; public class Study { public static void main(String[] args) { A a = new A(); a.m1(null); } } class A { public void m1(String s) { System.out.println("String"); System.out.println(s); } public void m1(Object obj) { System.out.println("Object"); System.out.println(obj); } } Here, the output is String null Why does the JVM resolve the method to one with a String argument? Thanks in advance J

    Read the article

  • How does ambigous methods are resolved in java ?

    - by Jijoy
    Hi , I do have a question. package org.study.algos; public class Study { public static void main(String[] args) { A a = new A(); a.m1(null); } } class A { public void m1(String s) { System.out.println("String"); System.out.println(s); } public void m1(Object obj) { System.out.println("Object"); System.out.println(obj); } } Here , the output is String null Why JVM resolve the method to one with String arguement ? Thanks in advance J

    Read the article

1