AdultCensusSalaryPrediction
1 year ago
5 changed files with 7083 additions and 0 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,34 @@
|
||||
//package com.jayway.jsonpath.internal;
|
||||
//
|
||||
//import com.jayway.jsonpath.spi.json.JettisonProvider;
|
||||
//import org.junit.Before;
|
||||
//import org.junit.Test;
|
||||
//
|
||||
//import static org.junit.Assert.assertEquals;
|
||||
//import static org.junit.Assert.assertTrue;
|
||||
//
|
||||
//public class JettisonProviderTest {
|
||||
//
|
||||
// private JettisonProvider jsonProvider;
|
||||
//
|
||||
// @Before
|
||||
// public void setUp() {
|
||||
// jsonProvider = new JettisonProvider();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void parseValidJsonString() {
|
||||
// //Input json
|
||||
// String jsonString = "{\"name\":\"Vishesh\",\"age\":21}";
|
||||
//
|
||||
// // When parsing a valid JSON string
|
||||
// Object result = jsonProvider.parse(jsonString);
|
||||
//
|
||||
// assertTrue(jsonProvider.isMap(result));
|
||||
//
|
||||
// // expected values
|
||||
// assertEquals("Vishesh", jsonProvider.getMapValue(result, "name"));
|
||||
// assertEquals(21, jsonProvider.getMapValue(result, "age"));
|
||||
// }
|
||||
//
|
||||
//}
|
@ -0,0 +1,46 @@
|
||||
//package com.jayway.jsonpath.internal;
|
||||
//
|
||||
//import com.jayway.jsonpath.spi.json.JsonOrgJsonProvider;
|
||||
//import org.junit.Before;
|
||||
//import org.junit.Test;
|
||||
//
|
||||
//import java.io.ByteArrayInputStream;
|
||||
//import java.io.InputStream;
|
||||
//import java.nio.charset.StandardCharsets;
|
||||
//
|
||||
//import static org.junit.Assert.assertEquals;
|
||||
//import static org.junit.Assert.assertTrue;
|
||||
//
|
||||
//public class JsonOrgJsonProviderTest {
|
||||
// private JsonOrgJsonProvider jsonProvider;
|
||||
// @Before
|
||||
// public void setUp() {
|
||||
// jsonProvider = new JsonOrgJsonProvider();
|
||||
// }
|
||||
// @Test
|
||||
// public void parseValidJsonString() {
|
||||
// //input json
|
||||
// String jsonString = "{\"name\":\"Raj\",\"age\":31}";
|
||||
//
|
||||
// // When parsing a valid JSON string
|
||||
// Object result = jsonProvider.parse(jsonString);
|
||||
//
|
||||
// assertTrue(jsonProvider.isMap(result));
|
||||
// assertEquals("Raj", jsonProvider.getMapValue(result, "name"));
|
||||
// assertEquals(31, jsonProvider.getMapValue(result, "age"));
|
||||
// }
|
||||
// @Test
|
||||
// public void parseValidJsonInputStream() {
|
||||
//
|
||||
// String jsonString = "{\"name\":\"Raj\",\"age\":31}";
|
||||
// InputStream jsonStream = new ByteArrayInputStream(jsonString.getBytes(StandardCharsets.UTF_8));
|
||||
//
|
||||
// // When parsing valid JSON from an InputStream
|
||||
// Object result = jsonProvider.parse(jsonStream, StandardCharsets.UTF_8.name());
|
||||
//
|
||||
// assertTrue(jsonProvider.isMap(result));
|
||||
// // expected values
|
||||
// assertEquals("Raj", jsonProvider.getMapValue(result, "name"));
|
||||
// assertEquals(31, jsonProvider.getMapValue(result, "age"));
|
||||
// }
|
||||
//}
|
@ -0,0 +1,42 @@
|
||||
//package com.jayway.jsonpath.internal;
|
||||
//
|
||||
//import com.jayway.jsonpath.Configuration;
|
||||
//import com.jayway.jsonpath.TypeRef;
|
||||
//import com.jayway.jsonpath.spi.mapper.TapestryMappingProvider;
|
||||
//import org.junit.Before;
|
||||
//import org.junit.Test;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
//import static org.junit.Assert.assertNull;
|
||||
//import static org.junit.Assert.fail;
|
||||
//
|
||||
//public class TapestryMappingProviderTest {
|
||||
// private TapestryMappingProvider mappingProvider;
|
||||
// private Configuration configuration;
|
||||
// @Before
|
||||
// public void setUp() {
|
||||
// mappingProvider = new TapestryMappingProvider();
|
||||
// configuration = Configuration.defaultConfiguration();
|
||||
// }
|
||||
// @Test
|
||||
// public void mapNullSourceToNullTarget() {
|
||||
// Object source = null;
|
||||
//
|
||||
// Object result = mappingProvider.map(source, List.class, configuration);
|
||||
//
|
||||
// //result should be null
|
||||
// assertNull(result);
|
||||
// }
|
||||
// @Test
|
||||
// public void mapArrayToJsonRef() {
|
||||
// String[] source = new String[]{"Red", "Green", "Blue"};
|
||||
//
|
||||
// try {
|
||||
// Object result = mappingProvider.map(source, new TypeRef<List<String>>() {}, configuration);
|
||||
// fail("Expected UnsupportedOperationException");
|
||||
// } catch (UnsupportedOperationException e) {
|
||||
// // UnsupportedOperationException should be thrown
|
||||
// }
|
||||
// }
|
||||
//}
|
Loading…
Reference in new issue