Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests #51

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
83680f4
Add Unit Tests for qunar.tc.bistoury.clientside.common.meta.Numbers
JohnLBergqvist Sep 2, 2019
d415a74
Add Unit Tests for qunar.tc.decompiler.code.Instruction
JohnLBergqvist Sep 2, 2019
c7a8de2
Add Unit Tests for qunar.tc.decompiler.code.SwitchInstruction
JohnLBergqvist Sep 2, 2019
b28acc5
Add Unit Tests for qunar.tc.decompiler.main.extern.IIdentifierRenamer…
JohnLBergqvist Sep 2, 2019
321d4ec
Add Unit Tests for qunar.tc.decompiler.modules.renamer.ConverterHelper
JohnLBergqvist Sep 2, 2019
54a1b0c
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructAnnDefaultAt…
JohnLBergqvist Sep 2, 2019
2f4050a
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructAnnotationAt…
JohnLBergqvist Sep 2, 2019
baf847e
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructAnnotationPa…
JohnLBergqvist Sep 2, 2019
3c9c9ed
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructBootstrapMet…
JohnLBergqvist Sep 2, 2019
7d8805c
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructConstantValu…
JohnLBergqvist Sep 2, 2019
45297e3
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructEnclosingMet…
JohnLBergqvist Sep 2, 2019
6cc3d84
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructExceptionsAt…
JohnLBergqvist Sep 2, 2019
0a9667b
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructGeneralAttri…
JohnLBergqvist Sep 2, 2019
0f52882
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructGenericSigna…
JohnLBergqvist Sep 2, 2019
2325717
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructInnerClasses…
JohnLBergqvist Sep 2, 2019
be245a8
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructLineNumberTa…
JohnLBergqvist Sep 2, 2019
e1ba0be
Add Unit Tests for qunar.tc.decompiler.struct.attr.StructMethodParame…
JohnLBergqvist Sep 2, 2019
aa65044
Add Unit Tests for qunar.tc.decompiler.struct.gen.VarType
JohnLBergqvist Sep 2, 2019
3b90313
Add Unit Tests for qunar.tc.decompiler.struct.gen.generics.GenericType
JohnLBergqvist Sep 2, 2019
bf8b3cb
Add Unit Tests for qunar.tc.decompiler.util.InterpreterUtil
JohnLBergqvist Sep 2, 2019
3c0ed14
Add Unit Tests for qunar.tc.bistoury.instrument.client.spring.el.Code…
JohnLBergqvist Sep 2, 2019
929d0e5
Add Unit Tests for qunar.tc.bistoury.instrument.client.spring.el.Coll…
JohnLBergqvist Sep 2, 2019
19acbdf
Add Unit Tests for qunar.tc.bistoury.instrument.client.spring.el.Nest…
JohnLBergqvist Sep 2, 2019
5112ae5
Add Unit Tests for qunar.tc.bistoury.instrument.client.spring.el.Obje…
JohnLBergqvist Sep 2, 2019
bdbf2f8
Add Unit Tests for qunar.tc.bistoury.instrument.client.spring.el.Oper…
JohnLBergqvist Sep 2, 2019
9bdd2bc
Add Unit Tests for qunar.tc.bistoury.instrument.client.spring.el.Stri…
JohnLBergqvist Sep 2, 2019
2c662ec
Add Unit Tests for qunar.tc.bistoury.serverside.agile.Base64
JohnLBergqvist Sep 2, 2019
58801ab
Add Unit Tests for qunar.tc.bistoury.serverside.agile.Strings
JohnLBergqvist Sep 2, 2019
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
4 changes: 4 additions & 0 deletions bistoury-clientside-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<groupId>qunar.tc.bistoury</groupId>
<artifactId>bistoury-common</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
package qunar.tc.bistoury.clientside.common.meta;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.Timeout;
import qunar.tc.bistoury.clientside.common.meta.Numbers;

public class NumbersTest {

@Rule public final ExpectedException thrown = ExpectedException.none();

@Rule public final Timeout globalTimeout = new Timeout(10000);

// Test written by Diffblue Cover.

@Test
public void ipNiceNumberInputNotNullOutputPositive2() {

// Arrange
final String ip = "7";

// Act
final long actual = Numbers.ipNiceNumber(ip);

// Assert result
Assert.assertEquals(7L, actual);
}

// Test written by Diffblue Cover.

@Test
public void ipNiceNumberInputNotNullOutputPositive3() {

// Arrange
final String ip = ".1";

// Act
final long actual = Numbers.ipNiceNumber(ip);

// Assert result
Assert.assertEquals(1L, actual);
}

// Test written by Diffblue Cover.

@Test
public void ipNiceNumberInputNotNullOutputZero() {

// Arrange
final String ip = "";

// Act
final long actual = Numbers.ipNiceNumber(ip);

// Assert result
Assert.assertEquals(0L, actual);
}

// Test written by Diffblue Cover.

@Test
public void ipNiceNumberInputNotNullOutputZero3() {

// Arrange
final String ip = ".";

// Act
final long actual = Numbers.ipNiceNumber(ip);

// Assert result
Assert.assertEquals(0L, actual);
}

// Test written by Diffblue Cover.
@Test
public void toDoubleInputNullOutputZero() {

// Act and Assert result
Assert.assertEquals(0.0, Numbers.toDouble(null), 0.0);
}

// Test written by Diffblue Cover.
@Test
public void toDoubleInputNullZeroOutputZero() {

// Act and Assert result
Assert.assertEquals(0.0, Numbers.toDouble(null, 0.0), 0.0);
}

// Test written by Diffblue Cover.
@Test
public void toFloatInputNotNullPositiveOutputPositive() {

// Act and Assert result
Assert.assertEquals(2.0f, Numbers.toFloat(",", 2.0f), 0.0f);
}

// Test written by Diffblue Cover.
@Test
public void toFloatInputNullOutputZero() {

// Act and Assert result
Assert.assertEquals(0.0f, Numbers.toFloat(null), 0.0f);
}

// Test written by Diffblue Cover.
@Test
public void toFloatInputNullZeroOutputZero() {

// Act and Assert result
Assert.assertEquals(0.0f, Numbers.toFloat(null, 0.0f), 0.0f);
}

// Test written by Diffblue Cover.
@Test
public void toIntInputNotNullOutputPositive() {

// Act and Assert result
Assert.assertEquals(1, Numbers.toInt("1"));
}

// Test written by Diffblue Cover.
@Test
public void toIntInputNotNullZeroOutputNegative() {

// Act and Assert result
Assert.assertEquals(-7, Numbers.toInt("-7", 0));
}

// Test written by Diffblue Cover.
@Test
public void toIntInputNullZeroOutputZero() {

// Act and Assert result
Assert.assertEquals(0, Numbers.toInt(null, 0));
}

// Test written by Diffblue Cover.
@Test
public void toLongInputNotNullZeroOutputPositive() {

// Act and Assert result
Assert.assertEquals(3L, Numbers.toLong("3", 0L));
}

// Test written by Diffblue Cover.
@Test
public void toLongInputNullOutputZero() {

// Act and Assert result
Assert.assertEquals(0L, Numbers.toLong(null));
}

// Test written by Diffblue Cover.
@Test
public void toLongInputNullZeroOutputZero() {

// Act and Assert result
Assert.assertEquals(0L, Numbers.toLong(null, 0L));
}
}
21 changes: 21 additions & 0 deletions bistoury-decompiler-fernflower/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@
<artifactId>junit-dep</artifactId>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.6</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.6</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Loading