This repository has been archived by the owner on Sep 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from DiffBlue-benchmarks/Add-client.ai.utils.…
…AiSpellParser-Tests-from-Diffblue-Deeptest Add tests for client.ai.utils.AiSpellParser from Diffblue Deeptest
- Loading branch information
Showing
2 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
172 changes: 172 additions & 0 deletions
172
symphony-client/src/test/java/org/symphonyoss/client/ai/utils/AiSpellParserTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
/* | ||
* | ||
* | ||
* Copyright 2018 Diffblue Limited | ||
* | ||
* Licensed to The Symphony Software Foundation (SSF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The SSF licenses this file | ||
* to you 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. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
*/ | ||
|
||
package org.symphonyoss.client.ai.utils; | ||
import org.junit.Assert; | ||
import org.junit.rules.ExpectedException; | ||
import org.junit.Test; | ||
import java.lang.reflect.Array; | ||
import java.lang.reflect.Constructor; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Method; | ||
import com.diffblue.deeptestutils.CompareWithFieldList; | ||
import com.diffblue.deeptestutils.Reflector; | ||
@org.junit.runner.RunWith(org.powermock.modules.junit4.PowerMockRunner.class) | ||
public class AiSpellParserTest { | ||
@org.junit.Rule | ||
public ExpectedException thrown = ExpectedException.none(); | ||
/* testedClasses: AiSpellParser */ | ||
|
||
/* | ||
* Test generated by Diffblue Deeptest. | ||
* This test case covers: | ||
* conditional line 171 branch to line 172 | ||
* org/symphonyoss/client/ai/utils/AiSpellParser.java:179: loop: 1 iterations | ||
* iteration 1 | ||
* conditional line 180 branch to line 180 | ||
* conditional line 180 branch to line 179 | ||
* conditional line 183 branch to line 183 | ||
*/ | ||
|
||
@org.junit.Test | ||
public void org_symphonyoss_client_ai_utils_AiSpellParser_isCloseTo_000_a2a15613a4edd99f() throws Throwable { | ||
|
||
boolean retval; | ||
{ | ||
/* Arrange */ | ||
String input1 = "?"; | ||
String input2 = ""; | ||
double closenessFactor = 0.0; | ||
|
||
/* Act */ | ||
Class<?> c = Reflector.forName("org.symphonyoss.client.ai.utils.AiSpellParser"); | ||
Method m = c.getDeclaredMethod("isCloseTo", Reflector.forName("java.lang.String"), Reflector.forName("java.lang.String"), Reflector.forName("double")); | ||
m.setAccessible(true); | ||
retval = (boolean) m.invoke(null, input1, input2, closenessFactor); | ||
} | ||
{ | ||
/* Assert result */ | ||
Assert.assertEquals(false, retval); | ||
} | ||
} | ||
|
||
/* | ||
* Test generated by Diffblue Deeptest. | ||
* This test case covers: | ||
* conditional line 171 branch to line 172 | ||
* org/symphonyoss/client/ai/utils/AiSpellParser.java:179: loop: 1 iterations | ||
* iteration 1 | ||
* conditional line 180 branch to line 180 | ||
* conditional line 180 branch to line 179 | ||
* conditional line 183 branch to line 183 | ||
*/ | ||
|
||
@org.junit.Test | ||
public void org_symphonyoss_client_ai_utils_AiSpellParser_isCloseTo_001_2e7b54f146d8f0cf() throws Throwable { | ||
|
||
boolean retval; | ||
{ | ||
/* Arrange */ | ||
String input1 = "?"; | ||
String input2 = ""; | ||
double closenessFactor = -0x1.0000000000001p+1 /* -2.0 */; | ||
|
||
/* Act */ | ||
Class<?> c = Reflector.forName("org.symphonyoss.client.ai.utils.AiSpellParser"); | ||
Method m = c.getDeclaredMethod("isCloseTo", Reflector.forName("java.lang.String"), Reflector.forName("java.lang.String"), Reflector.forName("double")); | ||
m.setAccessible(true); | ||
retval = (boolean) m.invoke(null, input1, input2, closenessFactor); | ||
} | ||
{ | ||
/* Assert result */ | ||
Assert.assertEquals(true, retval); | ||
} | ||
} | ||
|
||
/* | ||
* Test generated by Diffblue Deeptest. | ||
* This test case covers: | ||
* conditional line 171 branch to line 175 | ||
* org/symphonyoss/client/ai/utils/AiSpellParser.java:179: loop: 1 iterations | ||
* iteration 1 | ||
* conditional line 180 branch to line 180 | ||
* conditional line 180 branch to line 179 | ||
* conditional line 183 branch to line 183 | ||
*/ | ||
|
||
@org.junit.Test | ||
public void org_symphonyoss_client_ai_utils_AiSpellParser_isCloseTo_002_71975b80a4f1f106() throws Throwable { | ||
|
||
boolean retval; | ||
{ | ||
/* Arrange */ | ||
String input1 = ""; | ||
String input2 = "?"; | ||
double closenessFactor = -0x1.0000000000001p+1 /* -2.0 */; | ||
|
||
/* Act */ | ||
Class<?> c = Reflector.forName("org.symphonyoss.client.ai.utils.AiSpellParser"); | ||
Method m = c.getDeclaredMethod("isCloseTo", Reflector.forName("java.lang.String"), Reflector.forName("java.lang.String"), Reflector.forName("double")); | ||
m.setAccessible(true); | ||
retval = (boolean) m.invoke(null, input1, input2, closenessFactor); | ||
} | ||
{ | ||
/* Assert result */ | ||
Assert.assertEquals(true, retval); | ||
} | ||
} | ||
|
||
/* | ||
* Test generated by Diffblue Deeptest. | ||
* This test case covers: | ||
* conditional line 171 branch to line 175 | ||
* org/symphonyoss/client/ai/utils/AiSpellParser.java:179: loop: 1 iterations | ||
* iteration 1 | ||
* conditional line 180 branch to line 180 | ||
* conditional line 180 branch to line 181 | ||
* conditional line 183 branch to line 183 | ||
*/ | ||
|
||
@org.junit.Test | ||
public void org_symphonyoss_client_ai_utils_AiSpellParser_isCloseTo_003_5933843219c118fd() throws Throwable { | ||
|
||
boolean retval; | ||
{ | ||
/* Arrange */ | ||
String input1 = "?"; | ||
String input2 = "?"; | ||
double closenessFactor = -0x1.0000000000001p+8 /* -256.0 */; | ||
|
||
/* Act */ | ||
Class<?> c = Reflector.forName("org.symphonyoss.client.ai.utils.AiSpellParser"); | ||
Method m = c.getDeclaredMethod("isCloseTo", Reflector.forName("java.lang.String"), Reflector.forName("java.lang.String"), Reflector.forName("double")); | ||
m.setAccessible(true); | ||
retval = (boolean) m.invoke(null, input1, input2, closenessFactor); | ||
} | ||
{ | ||
/* Assert result */ | ||
Assert.assertEquals(true, retval); | ||
} | ||
} | ||
} |