Testing In Java
From: dnoble, 2 years ago
Overview of testing concepts, practices, and tools in Java.
SlideShare Link
Phone Phones km in km out start
075 560000 2 2.5 4.2
055 1.9 2.4 4.5
001 330330 2.1 2.5 4.5
004 712000 1.9 2.4 3.9
088 547575 2 2.4 4.2
057 382038 2 3 3
068 330404 2 2.5 4.5
051 330707 2 2.4 4.2
081 540111 2 2.5 4.8
Use StandardPayload<T> and StandardClasses for:
public static org.w3c.dom.Document getMarshalledDocument(Object value, QName name) {
if (log.isDebugEnabled())
log.debug("JAXBEventTransformer.getMarshalledDocument() value = " + value);
try {
String toenum = value.getClass().getSimpleName();
if (log.isDebugEnabled())
log.debug("JAXBEventTransformer.getMarshalledDocument() toenum = " + toenum);
StandardClasses t = null;
try {
t = StandardClasses.valueOf(toenum.toUpperCase());
} catch (java.lang.IllegalArgumentException e) {
return null;
}
if (log.isDebugEnabled())
log.debug("JAXBEventTransformer.getMarshalledDocument() t = " + t);
return t.getMarshalledDocument(value, name);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
private static Object getUnmarshalledObject(QName type, EventPayload payload) {
try {
String source = type.getLocalPart();
String toenum = source.substring(source.lastIndexOf(".") + 1);
if (log.isDebugEnabled())
log.debug("JAXBEventTransformer.getUnmarshalledObject() toenum = " + toenum);
StandardClasses t = null;
try {
t = StandardClasses.valueOf(toenum.toUpperCase());
} catch (java.lang.IllegalArgumentException e) {
return null;
}
if (log.isDebugEnabled())
log.debug("JAXBEventTransformer.getUnmarshalledObject() t = " + t);
return t.getUnmarshalledObject(type, payload);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
==================
public class StandardPayload<> {
public org.w3c.dom.Document getMarshalledDocument(Object value, QName name) {
public T getUnmarshalledObject(QName type, EventPayload payload) {
public enum StandardClasses {
StandardClasses(StandardPayload< ? > s) {
public org.w3c.dom.Document getMarshalledDocument(Object value, QName name) {
public Object getUnmarshalledObject(QName type, EventPayload payload) {
=================