@Test public void testCreateOutput() throws Exception { TestCase testcaseData = new TestCase("testling", "123"); testcaseData.addAction(TestAction.createSakuliTestAction( "Region", "dragAndDrop", new Object[]{ new RegionTestMock(), null }, "test recursive parsing", "docu")); List<TestAction> testActions = testcaseData.getTestActions(); assertNotNull(testActions); assertNotNull(testSuite); testSuite.addTestCase(testcaseData); assertEquals(testActions.size(), 1); final String json = testling.createOutput(); BaseTest.assertContains(json, "\"Mock for RegionImpl,"); BaseTest.assertContains(json, "test recursive parsing"); testcaseData.addAction(TestAction.createSakuliTestAction( "NullAction", "nullArg", null, null, "docu")); assertEquals(testActions.size(), 2); final String json2 = testling.createOutput(); BaseTest.assertContains(json2, "\"NullAction"); BaseTest.assertContains(json2, "nullArg"); BaseTest.assertContains(json2, "\"NullAction\",\"method\":\"nullArg\",\"args\":[],\"message\":null,"); }
public String createOutput() throws SakuliForwarderCheckedException { try { Gson gsonBuilder = new GsonBuilder() .setExclusionStrategies(new GsonExclusionStrategy()) .registerTypeAdapter(Date.class, new DateSerializer()) .registerTypeAdapter(DateTime.class, new DateTimeSerializer()) .registerTypeAdapter(Path.class, new PathSerializer(jsonProperties.getOutputJsonDir())) .registerTypeHierarchyAdapter(Throwable.class, new ThrowableSerializer()) .serializeNulls() .create(); return gsonBuilder.toJson(testSuite); } catch (Exception e) { throw new SakuliForwarderCheckedException(e, "Exception during serializing testSuite into JSON!"); } }
GsonOutputBuilder extends AbstractOutputBuilder { public String createOutput() throws SakuliForwarderCheckedException { try { Gson gsonBuilder = new GsonBuilder() .setExclusionStrategies(new GsonExclusionStrategy()) .registerTypeAdapter(Date.class, new DateSerializer()) .registerTypeAdapter(DateTime.class, new DateTimeSerializer()) .registerTypeAdapter(Path.class, new PathSerializer(jsonProperties.getOutputJsonDir())) .registerTypeHierarchyAdapter(Throwable.class, new ThrowableSerializer()) .serializeNulls() .create(); return gsonBuilder.toJson(testSuite); } catch (Exception e) { throw new SakuliForwarderCheckedException(e, "Exception during serializing testSuite into JSON!"); } } }
GsonOutputBuilder extends AbstractOutputBuilder { public String createOutput() throws SakuliForwarderCheckedException { try { Gson gsonBuilder = new GsonBuilder() .setExclusionStrategies(new GsonExclusionStrategy()) .registerTypeAdapter(Date.class, new DateSerializer()) .registerTypeAdapter(DateTime.class, new DateTimeSerializer()) .registerTypeAdapter(Path.class, new PathSerializer(jsonProperties.getOutputJsonDir())) .registerTypeHierarchyAdapter(Throwable.class, new ThrowableSerializer()) .serializeNulls() .create(); return gsonBuilder.toJson(testSuite); } catch (Exception e) { throw new SakuliForwarderCheckedException(e, "Exception during serializing testSuite into JSON!"); } }  }
GsonOutputBuilder extends AbstractOutputBuilder { public String createOutput() throws SakuliForwarderCheckedException { try { Gson gsonBuilder = new GsonBuilder() .setExclusionStrategies(new GsonExclusionStrategy()) .registerTypeAdapter(Date.class, new DateSerializer()) .registerTypeAdapter(DateTime.class, new DateTimeSerializer()) .registerTypeAdapter(Path.class, new PathSerializer(jsonProperties.getOutputJsonDir())) .registerTypeHierarchyAdapter(Throwable.class, new ThrowableSerializer()) .serializeNulls() .create(); return gsonBuilder.toJson(testSuite); } catch (Exception e) { throw new SakuliForwarderCheckedException(e, "Exception during serializing testSuite into JSON!"); } }  String createOutput(); }
GsonOutputBuilder extends AbstractOutputBuilder { public String createOutput() throws SakuliForwarderCheckedException { try { Gson gsonBuilder = new GsonBuilder() .setExclusionStrategies(new GsonExclusionStrategy()) .registerTypeAdapter(Date.class, new DateSerializer()) .registerTypeAdapter(DateTime.class, new DateTimeSerializer()) .registerTypeAdapter(Path.class, new PathSerializer(jsonProperties.getOutputJsonDir())) .registerTypeHierarchyAdapter(Throwable.class, new ThrowableSerializer()) .serializeNulls() .create(); return gsonBuilder.toJson(testSuite); } catch (Exception e) { throw new SakuliForwarderCheckedException(e, "Exception during serializing testSuite into JSON!"); } }  String createOutput();  }