id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
7dc5173a-82b0-4634-b990-ad94f4ce06e1 | public void setNextPageUrl(String nextPageUrl) {
this.nextPageUrl = nextPageUrl;
} |
27bf751a-faa6-4ca6-b71e-a55bb6de0cf6 | public int getCurrentRecordCount() {
return currentRecordCount;
} |
9de93769-f593-4e80-b16c-75db3eca8cdd | public void setCurrentRecordCount(int currentRecordCount) {
this.currentRecordCount = currentRecordCount;
} |
e183c70c-b3f3-4501-8780-af51c507e01f | public int getPageLength() {
return pageLength;
} |
01c3cd6a-a74d-41a8-a251-65c2c1d95e82 | public void setPageLength(int pageLength) {
this.pageLength = pageLength;
} |
17a2ceac-a7f6-4d6c-9ade-5c3f59874b66 | public int getPageNumber() {
return pageNumber;
} |
3b072308-af59-4f09-a63f-2bec59af4dd0 | public void setPageNumber(int pageNumber) {
this.pageNumber = pageNumber;
} |
805d603a-7c04-46db-a0aa-a1085015fb29 | public String getPrevPageUrl() {
return prevPageUrl;
} |
8a61377f-1a45-4431-9580-66da300977a2 | public void setPrevPageUrl(String prevPageUrl) {
this.prevPageUrl = prevPageUrl;
} |
e9ee138d-f1ce-4ec1-9fa1-528b925ec33d | public int getRecordCount() {
return recordCount;
} |
dbadf9c3-036a-47b7-ada1-3febe30359d2 | public void setRecordCount(int recordCount) {
this.recordCount = recordCount;
} |
b683df67-8f43-4e4b-a620-a7b0dafbe7e0 | public int getBpUnit() {
return bpUnit;
} |
112f705c-369f-43cc-8802-eaa3f64e81ec | public void setBpUnit(int bpUnit) {
this.bpUnit = bpUnit;
} |
abf572e9-5667-41cb-8088-2825ea8a03ff | @JsonProperty("APIName")
public String getApiName() {
return apiName;
} |
57bc6409-2edb-42ac-a5ce-7427212c5612 | @JsonProperty("APIName")
public void setApiName(String apiName) {
this.apiName = apiName;
} |
58ab8efc-d3fd-48c8-9938-4813aab8ecb3 | @JsonProperty("AccessToken")
public String getAccessToken() {
return accessToken;
} |
4c856ac8-67e2-4f27-adf4-c72fdd517ec4 | @JsonProperty("AccessToken")
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
} |
83d991e8-eddb-41a1-9d8a-a57cfb2c6c84 | @JsonProperty("Expires")
public String getExpires() {
return expires;
} |
bc2ef282-9e80-4e09-9fe0-9d1fa28276e9 | @JsonProperty("Expires")
public void setExpires(String expires) {
this.expires = expires;
} |
95bd56b8-ecae-472c-a4f8-8e4960afc24d | @JsonProperty("RefreshToken")
public String getRefreshToken() {
return refreshToken;
} |
639fc087-61dd-430d-944f-e8df63126a9d | @JsonProperty("RefreshToken")
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
} |
f50d8e64-7815-4d37-b59c-fadde983442f | @JsonProperty("UserID")
public String getUserId() {
return userId;
} |
fd9fade0-0ae2-481f-96f5-dd93aff1e1a3 | @JsonProperty("UserID")
public void setUserId(String userId) {
this.userId = userId;
} |
3f04230d-c193-4fc9-a9e6-f1fb3a8aa053 | @JsonProperty("client_para")
public String getClientPara() {
return clientPara;
} |
778142cc-8417-4ba8-b7e5-d6794b727dbc | @JsonProperty("client_para")
public void setClientPara(String clientPara) {
this.clientPara = clientPara;
} |
cff589ae-59b0-4e4b-99ab-2bd07d622eae | @Override
protected WebApplicationContext createServletApplicationContext() {
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
context.register(WebConfig.class);
return context;
} |
fadcf1d6-8983-4fb8-ad35-8d0d8ecc9685 | @Override
protected String[] getServletMappings() {
return new String[] { "/" };
} |
368e54f0-b9a3-426e-949b-6a7f31234fd1 | @Override
protected WebApplicationContext createRootApplicationContext() {
return null;
} |
def38c57-c62d-4d64-9ce8-0938ab4e19e6 | @Override
public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
} |
e5a702de-26b8-4db9-8d07-df8b4933546c | @Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
} |
109a5196-bd6e-44d1-850f-b14de5edfa3c | @Bean
public ViewResolver viewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setPrefix("/WEB-INF/jsp/");
viewResolver.setSuffix(".jsp");
return viewResolver;
} |
96c71481-5daf-4240-9c58-7a4a14009fe2 | @Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
configurer.enable();
} |
f07c8f4a-62ae-4367-a17d-e18c9b8313f6 | @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
} |
16d5d60d-a39b-4817-96b5-86702b310479 | @Bean
public RestTemplate restTemplate() {
return new RestTemplate();
} |
25326431-5bdd-4383-a787-f35c70f9fd0b | @Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
AccessTokenSession accessTokenSession() {
return new AccessTokenSession();
} |
2f0acb1f-14e4-40ef-b6c7-2b6f42ca638b | public BloodPressureResponse(Map<String, String> params, BloodPressure bp) {
this.draw = NumberUtils.toInt(params.get("draw"), 0);
this.data = bp.getBpDataList();
if (data == null) {
this.data = new ArrayList<BpData>();
} else {
this.recordsTotal = bp.getRecordCount();
}
} |
eaffa29b-680d-4e41-8443-0937f3c772d8 | public int getDraw() {
return draw;
} |
46be3dfa-50a2-4435-991f-4282bce0a11e | public void setDraw(int draw) {
this.draw = draw;
} |
184b5e98-9ef4-48a9-bfad-cce142be95c6 | public int getRecordsTotal() {
return recordsTotal;
} |
3eb20aa4-29d1-47d7-a7fc-b75074473c62 | public void setRecordsTotal(int recordsTotal) {
this.recordsTotal = recordsTotal;
} |
48614dfd-4eab-4927-8327-e15fc1d92ba3 | public int getRecordsFiltered() {
return recordsFiltered;
} |
1e2a4a04-b7f7-406f-9c31-41b6cc65c825 | public void setRecordsFiltered(int recordsFiltered) {
this.recordsFiltered = recordsFiltered;
} |
af0d2e2e-95b6-4631-a4e7-c4568cae354c | public String getStartTime() {
return startTime;
} |
16a6dbf7-1a38-4f45-93c7-e1a9d83d3bb7 | public void setStartTime(String startTime) {
this.startTime = startTime;
} |
c68d1230-2064-43ae-a603-d48d8425bc4f | public String getEndTime() {
return endTime;
} |
cb434a75-81ef-4c32-90e0-a27d439145e1 | public void setEndTime(String endTime) {
this.endTime = endTime;
} |
06ba58f6-1792-4600-927f-d40409c09900 | public List<BpData> getData() {
return data;
} |
c5c171aa-1017-403e-bd78-785e928ed398 | public void setData(List<BpData> data) {
this.data = data;
} |
39086605-afa4-4249-9c12-aa632b816d84 | @RequestMapping(value = "/bp", method = RequestMethod.GET)
public String mainController(@RequestParam(value = "code", required = false) String code, Model model) {
if (this.ihealthService.isValidAccessToken()) {
return "bp";
} else {
if (code != null) {
this.ihealthService.getAccessToken(code);
return "bp";
} else {
return "redirect:" + this.ihealthService.getUserAuthorizationUri();
}
}
} |
83c49f35-084b-4d92-b5df-6aeef00458fc | @RequestMapping(value = "/bp/data", method = RequestMethod.GET)
public @ResponseBody BloodPressureResponse redirectController(@RequestParam Map<String, String> params, Model model) {
String accessToken = this.ihealthService.getAccessToken();
String userId = this.ihealthService.getUserId();
DateTime startTime = toDateTime(params.get("submittime_from_id"));
DateTime endTime = toDateTime(params.get("submittime_to_id"));
BloodPressure bp = this.ihealthService.getBloodPresure(userId, accessToken, startTime, endTime, 1);
return new BloodPressureResponse(params, bp);
} |
d067c47f-76b4-44fb-b388-29d5e9fcec03 | public static DateTime toDateTime(String str) {
final String pattern = "yyyy-MM-dd";
if (!StringUtils.isNoneEmpty(str)) {
return null;
}
try {
return DateTimeFormat.forPattern(pattern).withZone(DateTimeZone.UTC).parseDateTime(str);
} catch (IllegalArgumentException | UnsupportedOperationException ex) {
return null;
}
} |
999439a3-eebd-48bc-8822-ae99a9990e34 | @Test
public void testNoClass() {
assertNull(SfApexDoc.parse("", scopes(new String[]{})));
assertNull(SfApexDoc.parse("", publicScope));
assertNull(SfApexDoc.parse("", scopes(new String[]{ "private" })));
assertNull(SfApexDoc.parse("public noclass A", publicScope));
assertNull(SfApexDoc.parse("public classless A", publicScope));
assertNull(SfApexDoc.parse("public class ", publicScope));
assertNull(SfApexDoc.parse("public class // A", publicScope));
} |
cb31c85d-10eb-44be-ab86-89e943ffd1d1 | @Test
public void testClassWithWrongScope() {
assertNull(SfApexDoc.parse("class A", scopes(new String[]{ "private" })));
assertNull(SfApexDoc.parse("class A", publicScope));
assertNull(SfApexDoc.parse("private class A", scopes(new String[]{ "public,global,protected" })));
assertNull(SfApexDoc.parse("public class A", scopes(new String[]{ "private,global,protected" })));
assertNull(SfApexDoc.parse("public interface A", scopes(new String[]{ "private" })));
} |
72f23075-05c8-430f-b4cc-3737f2f947c7 | @Test
public void testPropertyWithWrongScope() {
assertTrue(SfApexDoc.parse("public class A {\n String s", publicScope).properties.isEmpty());
assertTrue(SfApexDoc.parse("public class A {\n publicx String s", publicScope).properties.isEmpty());
assertTrue(SfApexDoc.parse("public class A {\n xpublic String s", publicScope).properties.isEmpty());
} |
9960db87-cf48-4946-9fff-fc12e2754275 | @Test
public void testMethodWithWrongScope() {
assertTrue(SfApexDoc.parse("public class A {\n String s(", publicScope).properties.isEmpty());
assertTrue(SfApexDoc.parse("public class A {\n publicx String s(", publicScope).properties.isEmpty());
assertTrue(SfApexDoc.parse("public class A {\n xpublic String s(", publicScope).properties.isEmpty());
assertTrue(SfApexDoc.parse("public class A {\n webservice String s(", publicScope).properties.isEmpty());
} |
ab8a1f76-dc92-4e42-b347-ef8dfd86fcdf | @Test
public void testClass() {
assertEquals("A", SfApexDoc.parse("PUBLIC interface A {", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" public CLASS A {", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" public class A{ ", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" public class A { ", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" public virtual class A {", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" public abstract class A {", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" public with sharing class A {", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" @future public without sharing class A {", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" public class A implements B, C extends D {", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" \n public\tclass \tA {", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" \n public \n class \n A \n{", publicScope).getName());
assertEquals("A", SfApexDoc.parse(" \n public \n class \n A implements B, C extends D\n{", publicScope).getName());
assertEquals("PUBLIC interface A", SfApexDoc.parse("PUBLIC interface A {", publicScope).getNameLine());
assertEquals("public class A", SfApexDoc.parse(" \n public\tclass \tA {", publicScope).getNameLine());
assertEquals("public class A", SfApexDoc.parse(" \n public \n class \n A \n{", publicScope).getNameLine());
assertEquals("public class A implements B, C extends D", SfApexDoc.parse(" \n public \n class \n A implements B, C extends D\n{", publicScope).getNameLine());
} |
54e0e8ed-2bc4-4637-b6fe-f29bed994c90 | @Test
public void testProperty() {
assertTrue(SfApexDoc.parse("public class A {\n PUBLIC String", publicScope).properties.isEmpty());
assertEquals("p", SfApexDoc.parse("public class A {\n PUBLIC string p;", publicScope).properties.get(0).getName());
assertEquals("p", SfApexDoc.parse("public class A {\n public string p\t=", publicScope).properties.get(0).getName());
assertEquals("s", SfApexDoc.parse("public class A {\n public Integer s=5;", publicScope).properties.get(0).getName());
assertEquals("s", SfApexDoc.parse("public class A {\n public Integer s = 5 ;", publicScope).properties.get(0).getName());
assertEquals("p", SfApexDoc.parse("public class A {\n public string p ;", publicScope).properties.get(0).getName());
assertEquals("p", SfApexDoc.parse("public class A {\n static public string p{", publicScope).properties.get(0).getName());
assertEquals("p", SfApexDoc.parse("public class A {\n public final string p ;", publicScope).properties.get(0).getName());
assertEquals("p", SfApexDoc.parse("public class A {\n @testVisible public string p; ", publicScope).properties.get(0).getName());
assertEquals("p", SfApexDoc.parse("public class A {\n \n public\tstring \tp ;", publicScope).properties.get(0).getName());
assertEquals("p", SfApexDoc.parse("public class A {\n \n public \n string \n p; ", publicScope).properties.get(0).getName());
assertEquals(2, SfApexDoc.parse("public class A {\n public String s; \n public String t;", publicScope).properties.size());
//TODO assertEquals("s", SfApexDoc.parse("public class A {\n public Integer s, t;", publicScope).properties.get(0).getName());
//TODO assertEquals(2, SfApexDoc.parse("public class A {\n public String s; public String t;", publicScope).properties.size());
assertEquals("PUBLIC string p", SfApexDoc.parse("public class A {\n PUBLIC string p;", publicScope).properties.get(0).getNameLine());
} |
4cadede6-9284-460a-bbe2-160424f2fef2 | @Test
public void testSortProperties() {
ClassModel m = SfApexDoc.parse("public class A {\n public string p2; \n public string p1;", publicScope);
assertEquals(2, m.properties.size());
assertEquals("p1", m.properties.get(0).getName());
assertEquals("p2", m.properties.get(1).getName());
} |
f8146367-67ce-4bf6-8cc1-2e86dd7b5a86 | @Test
public void testEnum() {
assertEquals("e", SfApexDoc.parse("public class A {\n PUBLIC enum e;", publicScope).properties.get(0).getName());
assertEquals("e", SfApexDoc.parse("public class A {\n public ENUM e{", publicScope).properties.get(0).getName());
assertEquals("e", SfApexDoc.parse("public class A {\n public enum e ;", publicScope).properties.get(0).getName());
assertEquals("e", SfApexDoc.parse("public class A {\n static public enum e{", publicScope).properties.get(0).getName());
assertEquals("e", SfApexDoc.parse("public class A {\n @testVisible public enum e ;", publicScope).properties.get(0).getName());
assertEquals("e", SfApexDoc.parse("public class A {\n \n public\tenum \te ;", publicScope).properties.get(0).getName());
assertEquals("e", SfApexDoc.parse("public class A {\n \n public \n enum \n e; ", publicScope).properties.get(0).getName());
} |
ef756e41-476c-4025-b074-a8d60f393ffd | @Test
public void testMethod() {
assertEquals("m", SfApexDoc.parse("public class A {\n PUBLIC string m ();", publicScope).methods.get(0).getName());
assertEquals("m", SfApexDoc.parse("public class A {\n virtual public string m\t();", publicScope).methods.get(0).getName());
assertEquals("m", SfApexDoc.parse("public class A {\npublic \t static string m();", publicScope).methods.get(0).getName());
assertEquals("m", SfApexDoc.parse("public class A {\n @future public string m();", publicScope).methods.get(0).getName());
assertEquals("m", SfApexDoc.parse("public class A {\n \n public\tstring \tm ();", publicScope).methods.get(0).getName());
assertEquals("m", SfApexDoc.parse("public class A {\n \n public \n string \n m(); ", publicScope).methods.get(0).getName());
assertEquals("m", SfApexDoc.parse("global class A {\n \n webservice \n string \n m(); ", scopes(new String[]{ "global", "webservice" })).methods.get(0).getName());
assertEquals("m", SfApexDoc.parse("global class A {\n \n webservice \n string \n m(); ", scopes(new String[]{ "global" })).methods.get(0).getName());
assertEquals("PUBLIC string m ()", SfApexDoc.parse("public class A {\n PUBLIC string m ();", publicScope).methods.get(0).getNameLine());
} |
ca2f6706-d0aa-4285-9c28-571a576384ce | @Test
public void testSortMethods() {
ClassModel m = SfApexDoc.parse("public class A {\n public string p2(); \n public string p1();", publicScope);
assertEquals(2, m.methods.size());
assertEquals("p1", m.methods.get(0).getName());
assertEquals("p2", m.methods.get(1).getName());
} |
3a2c78b5-000e-44c5-8763-83d51eeef6b4 | @Test
public void testNestedClass() {
ClassModel m = SfApexDoc.parse("public class A {\n public class B {} \n}", publicScope);
assertEquals("A", m.getName());
assertEquals("A.B", m.children.get(0).getName());
m = SfApexDoc.parse("public class A {\n public class B \n{} \n}", publicScope);
assertEquals("A", m.getName());
assertEquals("A.B", m.children.get(0).getName());
m = SfApexDoc.parse("public class A {\n public class B \n{\n} \n}", publicScope);
assertEquals("A", m.getName());
assertEquals("A.B", m.children.get(0).getName());
// ignore in-scope members of an out-of-scope nested class
m = SfApexDoc.parse("public class A {\n private class B \n{\n public int i;\n } \n}", publicScope);
assertEquals(0, m.children.size());
assertEquals(0, m.properties.size());
} |
3f70d3c4-0cff-4993-a914-86f4881ac7ec | @Test
public void testNestedClassSortProperties() {
ClassModel m = SfApexDoc.parse("public class A {\n public class B {\n public string p2; \n public string p1;\n }\n }", publicScope);
assertEquals(2, m.children.get(0).properties.size());
assertEquals("p1", m.children.get(0).properties.get(0).getName());
assertEquals("p2", m.children.get(0).properties.get(1).getName());
} |
c58f5b47-f9c4-4b76-ba88-cf9bbc6e79be | @Test
public void testNestedClassSortMethods() {
ClassModel m = SfApexDoc.parse("public class A {\n public class B {\n public string p2(); \n public string p1();\n }\n }", publicScope);
assertEquals(2, m.children.get(0).methods.size());
assertEquals("p1", m.children.get(0).methods.get(0).getName());
assertEquals("p2", m.children.get(0).methods.get(1).getName());
} |
7f4ba09e-154e-4796-98f0-dab486a4ee90 | @Test
public void testClassWithComments() {
assertCommentAndClass("comment", "A", SfApexDoc.parse("/** comment */ \n public class A{", publicScope));
assertCommentAndClass("comment", "A", SfApexDoc.parse("/** \n * comment \n */ \n \t\n public class A {", publicScope));
assertCommentAndClass("comment", "A", SfApexDoc.parse("/** \n * comment \n */ \n \t\n public class A { ", publicScope));
assertCommentAndClass("comment", "A", SfApexDoc.parse(" /** comment */ \n @future \n public \n class \n A \n{", publicScope));
} |
33323c6f-61be-4b1e-a13c-a01c7268a04e | @Test
public void testClassWithNonDocComments() {
assertCommentAndClass("", "A", SfApexDoc.parse("/* comment */ \n public class A{", publicScope));
assertCommentAndClass("", "A", SfApexDoc.parse("/* \n * comment \n */ \n \t\n public class A {", publicScope));
assertCommentAndClass("", "A", SfApexDoc.parse(" /* comment */ \n @future \n public \n class \n A \n{", publicScope));
//TODO handle comments within a line e.g. "public /*class*/ interface A"
} |
bc794902-8639-48df-816b-285262652f65 | @Test
public void testClassWithSingleLineComments() {
assertCommentAndClass("", "A", SfApexDoc.parse("// comment \n public class A{", publicScope));
assertCommentAndClass("", "A", SfApexDoc.parse("// \n * comment \n \t\n public class A {", publicScope));
assertCommentAndClass("", "A", SfApexDoc.parse(" // comment \n @future \n public \n class \n A \n{", publicScope));
} |
bd667bc0-089c-485a-9045-336f6e7d8236 | @Test
public void testPropertyWithComments() {
assertCommentClassAndProperty("comment", "A", "p", SfApexDoc.parse("public class A {\n /** comment */ \n public \n Id \n p \n {", publicScope));
} |
b3bbc61b-540d-4418-9122-998c348743b9 | @Test
public void testPropertyWithNonDocComments() {
assertCommentClassAndProperty("", "A", "p", SfApexDoc.parse("public class A {\n /* comment */ \n public \n Id \n p \n {", publicScope));
} |
3ed5a73a-e1c6-4e3f-a6e4-3a94faef0cc2 | @Test
public void testPropertyWithSingleLineComments() {
assertCommentClassAndProperty("", "A", "p", SfApexDoc.parse("public class A {\n // comment \n public \n Id \n p \n {", publicScope));
} |
d31fe660-66c4-4df4-bc07-035a707ec0fe | @Test
public void testMethodWithComments() {
String test =
"/**\n"+
"* This is the parent class for models. Model classes should contain... \n"+
"*/\n"+
"public abstract with sharing class SF_Base {\n"+
" //--------------------------------------------------------------------------\n"+
" // Properties\n"+
" /** SF Id for the current object. When changed, zObj is reset as well */\n"+
" static\n"+
"public Id id {\n"+
" }\n"+
"\n"+
" /** The object with ID = id */\n"+
" public SObject zObj \n"+
"{\n"+
" }\n"+
" \n"+
" //--------------------------------------------------------------------------\n"+
" // Constructor\n"+
" /**\n"+
" * @param theType required\n"+
" */\n"+
" public SF_Base(SObjectType theType, Id id) {\n"+
" }\n"+
"}";
ClassModel m = SfApexDoc.parse(test, publicScope);
assertEquals(2, m.properties.size());
assertEquals("static public Id id", m.properties.get(0).getNameLine());
assertEquals("public SObject zObj", m.properties.get(1).getNameLine());
Collections.sort(m.properties, new ModelComparer());
assertEquals("id", m.properties.get(0).getName());
assertEquals(1, m.methods.size());
} |
05ad0d14-9c98-4446-83f8-623292181daa | private void assertCommentAndClass(String comment, String theClass, ClassModel m) {
assertNotNull(m);
assertEquals(comment, m.getDescription());
assertEquals(theClass, m.getName());
} |
d802ae97-a54b-44ce-9e95-4a37f51495b6 | private void assertCommentClassAndProperty(String comment, String theClass, String property, ClassModel m) {
assertNotNull(m);
assertEquals(comment, m.properties.get(0).getDescription());
assertEquals(theClass, m.getName());
assertEquals(property, m.properties.get(0).getName());
} |
27ca5686-2272-4d92-8c5b-e751d136585d | private ArrayList<String> scopes(String[] s) {
return new ArrayList<String>(Arrays.asList(s));
} |
b75b6d08-aedd-4103-b135-d2df65eb0d55 | @Test (expected = NullPointerException.class)
public void testClassModelBlankLine() {
new ClassModel("", new ArrayList<String>());
} |
8a712956-0093-4d4e-aa55-5f19408e4c01 | @Test (expected = NullPointerException.class)
public void testClassModelNoClass() {
new ClassModel("junk", new ArrayList<String>());
} |
87ce4326-2d4e-423c-a655-96b30f811198 | @Test (expected = NullPointerException.class)
public void testClassModelNoClassName() {
new ClassModel("class", new ArrayList<String>());
} |
bcb67aeb-d5c7-41cb-95ed-e37c3dc468c1 | @Test (expected = NullPointerException.class)
public void testClassModelPartialClassMatch() {
new ClassModel("clas X", new ArrayList<String>());
} |
87104f6a-2327-4592-8757-6b8b2154dc1d | @Test
public void testGetName() {
ArrayList<String> comments = new ArrayList<String>();
assertEquals("a", new ClassModel(" private static int whatever class a", comments).getName());
assertEquals("b", new ClassModel(" class b { ... }", comments).getName());
assertEquals("c", new ClassModel("class c extends something", comments).getName());
assertFalse(new ClassModel(" class b { ... }", comments).isInterface);
assertEquals("d", new ClassModel(" interface d{", comments).getName());
assertTrue(new ClassModel(" interface d{", comments).isInterface);
assertEquals("e_2", new ClassModel("class e_2", comments).getName());
} |
5c9188a8-6d2f-4f5e-88b4-6adc04681735 | @Test (expected = NullPointerException.class)
public void testModelWithNullNameLine() {
new Model(null, new ArrayList<String>());
} |
d6726bae-e145-4db8-8b7b-a6699bc817e2 | @Test (expected = NullPointerException.class)
public void testUntrimmedNameLine() {
new Model(" ", new ArrayList<String>());
} |
24fb8d99-1c58-4984-86b7-6602052eff35 | @Test (expected = NullPointerException.class)
public void testNameLineWithLeadingSpace() {
new Model(" test", new ArrayList<String>());
} |
ba8dab17-1387-4338-b358-57b7d6c820a7 | @Test (expected = NullPointerException.class)
public void testNameLineWithTrailingSpace() {
new Model("test ", new ArrayList<String>());
} |
9c3d4df4-e67f-4d58-8a04-db54748d77aa | @Test (expected = NullPointerException.class)
public void testModelWithNullComments() {
new Model("", null);
} |
e8f706a7-c0be-44e0-85d3-f7c6df8c5c74 | @Test (expected = NullPointerException.class)
public void testGetNameWithoutOverride() {
new Model("", new ArrayList<String>()).getName();
} |
89fc37bf-d6b5-4371-982b-7208b1d70d88 | @Test
public void testNoLinks() {
// use a derived type since 'getName' isn't provided for the base class
MethodModel m = new MethodModel("Name1 Name_0 Name2", new ArrayList<String>());
m.addLinks();
assertEquals("no links", "Name1 <a href='link'>Name_0</a> Name2", m.getNameLine());
} |
b53de52d-c682-4f7a-ad66-ddc5b6e6b5b7 | @Test
public void testNoMatchingLinks() {
// use a derived type since 'getName' isn't provided for the base class
MethodModel m = new MethodModel("Name1 Name_0 Name2", new ArrayList<String>());
m.addType("Nam", "Link");
m.addType("Name3", "Link");
m.addLinks();
assertEquals("no links", "Name1 <a href='link'>Name_0</a> Name2", m.getNameLine());
} |
8d0b929d-fb78-4359-a96b-3fc9fdcf37b7 | @Test
public void testCaseInsensitiveLink() {
// use a derived type since 'getName' isn't provided for the base class
MethodModel m = new MethodModel("Name1 Name_0 Name2", new ArrayList<String>());
m.addType("name_0", "Link");
m.addLinks();
assertEquals("link was not applied", "Name1 <a href='link'>Name_0</a> Name2", m.getNameLine());
} |
8b0931c1-1634-43b8-ae85-f2a29075a88c | @Test
public void testClassAndSubclassLink() {
// use a derived type since 'getName' isn't provided for the base class
MethodModel m = new MethodModel("Name1 Name_0.subclass Name2", new ArrayList<String>());
m.addType("name_0.subclass", "Link");
m.addLinks();
assertEquals("link was not applied", "Name1 <a href='link'>Name_0.subclass</a> Name2", m.getNameLine());
} |
71a7b5a3-7607-456f-aacd-32799c948698 | @Test
public void testLinkInCollection() {
// use a derived type since 'getName' isn't provided for the base class
MethodModel m = new MethodModel("Set<Name1> List<Name_0> Name2[]", new ArrayList<String>());
m.addType("Name_0", "Link");
m.addLinks();
assertEquals("link was not applied", "Set<Name1> List<<a href='link'>Name_0</a>> Name2[]", m.getNameLine());
} |
8aa6bd73-f590-47cb-8b35-a4a5020cc5d3 | @Test
public void testLink() {
// use a derived type since 'getName' isn't provided for the base class
MethodModel m = new MethodModel("Name1 Name Name2", new ArrayList<String>());
m.addType("Name", "Link");
m.addLinks();
assertEquals("link was not applied", "Name1 <a href='link'>Name</a> Name2", m.getNameLine());
} |
e4885d23-7b64-40be-b500-5558f1ac65e9 | @Test (expected = NullPointerException.class)
public void testAddLinksMultipleCalls() {
// use a derived type since 'getName' isn't provided for the base class
MethodModel m = new MethodModel("", new ArrayList<String>());
m.addLinks();
m.addLinks();
} |
2c3f09b1-8bad-4f4c-95a0-f667b0fae263 | @Test
public void testNoComments() {
ArrayList<String> comments = new ArrayList<String>();
Model m = new Model("", comments);
assertBlankComment(m);
} |
10477711-55c1-42b0-8e67-c2fb1c4c9e0b | @Test
public void testBlankComment() {
ArrayList<String> comments = new ArrayList<String>();
comments.add("");
Model m = new Model("", comments);
assertBlankComment(m);
} |
9d7bff18-3b3b-404f-9335-d5474429385e | @Test
public void testEmptyComments() {
ArrayList<String> comments = new ArrayList<String>();
comments.add(" \t");
comments.add(" ");
comments.add(" * ");
comments.add(" *");
comments.add("* ");
comments.add("");
Model m = new Model("", comments);
assertBlankComment(m);
} |
99f33f53-6cc4-4104-b97b-605a3d2aa9b5 | @Test
public void testCommentWhitespace() {
ArrayList<String> comments = new ArrayList<String>();
comments.add(" \ta");
comments.add(" b ");
comments.add(" *c ");
comments.add(" *");
comments.add("* d ");
comments.add("");
comments.add("\t @see e ");
comments.add("@throws myEx ");
Model m = new Model("", comments);
assertEquals("description", "a b c d", m.getDescription());
assertEquals("see", "e", m.getSee());
assertEquals("throws", "myEx", m.getThrows().get(0));
} |
9140695a-4dc8-4575-ae2c-79ca9fc4822a | @Test
public void testCommentCaseSensitivity() {
ArrayList<String> comments = new ArrayList<String>();
comments.add("@return a");
comments.add("@AUTHOR a");
comments.add("@dATea");
Model m = new Model("", comments);
assertEquals("return", "a", m.getReturns());
assertEquals("author", "a", m.getAuthor());
assertEquals("date", "a", m.getDate());
} |
40dc0135-e0e3-4f3e-8ebe-d1ba7eb76c4c | @Test
public void testCommentInvalidKeys() {
ArrayList<String> comments = new ArrayList<String>();
comments.add("@ return b");
comments.add("@auth b");
comments.add("date b");
Model m = new Model("", comments);
assertEquals("return", "", m.getReturns());
assertEquals("author", "", m.getAuthor());
assertEquals("date", "", m.getDate());
} |
f36e30af-76c4-4dd4-9feb-57444f4d9309 | @Test
public void testMultiline() {
ArrayList<String> comments = new ArrayList<String>();
comments.add("@see Hey ");
comments.add(" * ");
comments.add(" *there ");
comments.add("\tBob ");
Model m = new Model("", comments);
assertEquals("see", "Hey there Bob", m.getSee());
assertEquals("blank description", "", m.getDescription());
} |
63009821-bbad-4acb-9ab6-ae2033100afb | @Test
public void testAllSingle() {
ArrayList<String> comments = new ArrayList<String>();
comments.add(" this is a description\t ");
comments.add("@author Me");
comments.add("@date 8/25/2013 12:07pm ");
comments.add("@see Bob\t");
comments.add("@return\tvoid");
comments.add("@param 1 a");
comments.add("@param 2 b");
comments.add("@throws x.1 first");
comments.add("@throws x.2 second");
Model m = new Model("", comments);
assertEquals("description", "this is a description", m.getDescription());
assertEquals("author", "Me", m.getAuthor());
assertEquals("date", "8/25/2013 12:07pm", m.getDate());
assertEquals("see", "Bob", m.getSee());
assertEquals("return", "void", m.getReturns());
assertEquals("param 1", "1 a", m.getParams().get(0));
assertEquals("param 2", "2 b", m.getParams().get(1));
assertEquals("throws x.1", "x.1 first", m.getThrows().get(0));
assertEquals("throws x.2", "x.2 second", m.getThrows().get(1));
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.