* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@Mock
EnvJAXB primaryEnv;
-
+
@Mock
JAXBumar jumar;
-
+
@Mock
JAXBmar jmar;
-
+
@Mock
Env env;
-
+
TimeTaken tt,ttObjectify;
@Before
// TODO Auto-generated catch block
e.printStackTrace();
}
-
+
}
-
+
@Test
public void testNewInstanceNoException() {
JAXBDF<?> bdfObj = null;
assertTrue(retVal instanceof JU_JAXBDF);
} catch (APIException e) {
e.printStackTrace();
- }
-
+ }
+
}
-
+
@Test
public void testPrettyNoException() {
JAXBDF<?> bdfObj = null;
assertTrue(retVal instanceof JAXBDF);
} catch (APIException e) {
e.printStackTrace();
- }
+ }
}
@Test
bdfObj.serviceDestroy(null);
} catch (APIException e) {
e.printStackTrace();
- }
-
+ }
+
}
-
+
@Test
public void testNewData() {
JAXBDF<?> bdfObj = null;
assertTrue(retVal instanceof JAXBData);
} catch (APIException e) {
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testNewDataENV() {
JAXBDF<?> bdfObj = null;
assertTrue(retVal instanceof JAXBData);
} catch (APIException e) {
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testNewDataType() {
JAXBDF<JAXBumar> bdfObj = null;
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testNewDataStream() {
JAXBDF<?> bdfObj = null;
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testNewDataStreamException() {
JAXBDF<?> bdfObj = null;
} catch (JAXBException e) {
// TODO Auto-generated catch block
assertTrue(e.getMessage().contains("test"));
- }
+ }
}
-
+
@Test
public void testNewDataFromString() {
JAXBDF<?> bdfObj = null;
assertTrue(retVal instanceof JAXBData);
} catch (APIException e) {
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testStringify() {
JAXBDF<JAXBmar> bdfObj = null;
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testStringifyException() {
JAXBDF<JAXBmar> bdfObj = null;
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
+ }
}
-
+
@Test
public void testStringifyWriter() {
JAXBDF<JAXBmar> bdfObj = null;
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testStringifyWriterException() {
JAXBDF<JAXBmar> bdfObj = null;
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
+ }
}
-
+
@Test
public void testStringifyOS() {
JAXBDF<JAXBmar> bdfObj = null;
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testStringifyOsException() {
JAXBDF<JAXBmar> bdfObj = null;
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
+ }
}
-
+
@Test
public void testStringifyOptions() {
JAXBDF<JAXBmar> bdfObj = null;
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testStringifyOSOptions() {
JAXBDF<JAXBmar> bdfObj = null;
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testStringifyOsOptionsException() {
JAXBDF<JAXBmar> bdfObj = null;
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
+ }
}
@Test
public void testStringifySWOptions() {
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
- }
+ }
}
-
+
@Test
public void testStringifySWOptionsException() {
JAXBDF<JAXBmar> bdfObj = null;
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
+ }
}
-
+
@Test
public void testObjectifyEnv() {
JAXBDF<JAXBumar> bdfObj = null;
LogTarget logT = Mockito.mock(LogTarget.class);
Mockito.doReturn(logT).when(env).debug();
Mockito.doReturn(this.getClass()).when(bdfObj.jumar).unmarshal(logT, Mockito.mock(StringReader.class));
-
+
bdfObj.objectify(env, Mockito.mock(StringReader.class));
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
@Test
public void testObjectifyEnvException() {
Mockito.doReturn(logT).when(env).debug();
StringReader sr = Mockito.mock(StringReader.class);
Mockito.doThrow(new JAXBException("test")).when(bdfObj.jumar).unmarshal(logT, sr);
-
+
bdfObj.objectify(env, sr);
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
-
+
@Test
public void testObjectifyRdr() {
JAXBDF<JAXBumar> bdfObj = null;
LogTarget logT = Mockito.mock(LogTarget.class);
Mockito.doReturn(logT).when(env).debug();
Mockito.doReturn(this.getClass()).when(bdfObj.jumar).unmarshal(logT, Mockito.mock(StringReader.class));
-
+
bdfObj.objectify( Mockito.mock(StringReader.class));
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
@Test
public void testObjectifyRdrException() {
Mockito.doReturn(logT).when(envJaxb).debug();
StringReader sr = Mockito.mock(StringReader.class);
Mockito.doThrow(new JAXBException("test")).when(bdfObj.jumar).unmarshal(logT, sr);
-
+
bdfObj.objectify(sr);
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
-
+
@Test
public void testObjectifyEnvIS() {
JAXBDF<JAXBumar> bdfObj = null;
LogTarget logT = Mockito.mock(LogTarget.class);
Mockito.doReturn(logT).when(env).debug();
Mockito.doReturn(this.getClass()).when(bdfObj.jumar).unmarshal(logT, Mockito.mock(InputStream.class));
-
+
bdfObj.objectify(env, Mockito.mock(InputStream.class));
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
@Test
public void testObjectifyEnvISException() {
Mockito.doReturn(logT).when(env).debug();
InputStream sr = Mockito.mock(InputStream.class);
Mockito.doThrow(new JAXBException("test")).when(bdfObj.jumar).unmarshal(logT, sr);
-
+
bdfObj.objectify(env, sr);
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
-
+
@Test
public void testObjectifyIs() {
JAXBDF<JAXBumar> bdfObj = null;
LogTarget logT = Mockito.mock(LogTarget.class);
Mockito.doReturn(logT).when(env).debug();
Mockito.doReturn(this.getClass()).when(bdfObj.jumar).unmarshal(logT, Mockito.mock(InputStream.class));
-
+
bdfObj.objectify( Mockito.mock(InputStream.class));
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
@Test
public void testObjectifyIsException() {
Mockito.doReturn(logT).when(envJaxb).debug();
InputStream sr = Mockito.mock(InputStream.class);
Mockito.doThrow(new JAXBException("test")).when(bdfObj.jumar).unmarshal(logT, sr);
-
+
bdfObj.objectify(sr);
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
-
+
@Test
public void testObjectifyEnvStr() {
JAXBDF<JAXBumar> bdfObj = null;
LogTarget logT = Mockito.mock(LogTarget.class);
Mockito.doReturn(logT).when(env).debug();
Mockito.doReturn(this.getClass()).when(bdfObj.jumar).unmarshal(logT, "test");
-
+
bdfObj.objectify(env, "test");
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
@Test
public void testObjectifyEnvStrException() {
Mockito.doReturn(logT).when(env).debug();
InputStream sr = Mockito.mock(InputStream.class);
Mockito.doThrow(new JAXBException("test")).when(bdfObj.jumar).unmarshal(logT, "test");
-
+
bdfObj.objectify(env, "test");
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
-
+
@Test
public void testObjectifyStr() {
JAXBDF<JAXBumar> bdfObj = null;
LogTarget logT = Mockito.mock(LogTarget.class);
Mockito.doReturn(logT).when(env).debug();
Mockito.doReturn(this.getClass()).when(bdfObj.jumar).unmarshal(logT, "test");
-
+
bdfObj.objectify( "test");
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
@Test
public void testObjectifyStrException() {
Mockito.doReturn(logT).when(envJaxb).debug();
InputStream sr = Mockito.mock(InputStream.class);
Mockito.doThrow(new JAXBException("test")).when(bdfObj.jumar).unmarshal(logT, "test");
-
+
bdfObj.objectify("test");
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
} catch (JAXBException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
-
+
@Test
public void testTypeClass() {
JAXBDF<JAXBumar> bdfObj = null;
try {
EnvJAXB envJaxb = Mockito.mock(EnvJAXB.class);
bdfObj = new JAXBDF<JAXBumar>( envJaxb, new Class[] {this.getClass()});
-
+
Object obj = bdfObj.getTypeClass();
assertFalse(obj instanceof JU_JAXBDF);
} catch (APIException e) {
assertTrue(e.getMessage().contains("test"));
- }
-
+ }
+
}
}