Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Add tests for client.ai.utils.AiSpellParser from Diffblue Deeptest #114

Merged
merged 1 commit into from
May 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.diffblue</groupId>
<artifactId>deeptestutils</artifactId>
<version>1.1.0</version>
</dependency>
</dependencies>

<build>
Expand Down
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);
}
}
}