-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move main methods to test methods. (#670)
* chore: move main methods to test methods. --------- Co-authored-by: Even Solbraa <[email protected]>
- Loading branch information
1 parent
947edfd
commit db50378
Showing
7 changed files
with
89 additions
and
64 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
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
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
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,16 @@ | ||
package neqsim.thermo.phase; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class PhaseTypeTest { | ||
@Test | ||
void testValues() { | ||
for (PhaseType pt : PhaseType.values()) { | ||
// System.out.println("Phase type: " + pt); | ||
|
||
Assertions.assertTrue(pt.getValue() >= 0); | ||
Assertions.assertTrue(pt.getDesc().length() > 0); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/test/java/neqsim/util/database/AspenIP21DatabaseTest.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,25 @@ | ||
package neqsim.util.database; | ||
|
||
import java.sql.ResultSet; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class AspenIP21DatabaseTest { | ||
@Disabled | ||
@Test | ||
void testMain() { | ||
boolean failed = true; | ||
AspenIP21Database database = new AspenIP21Database(); | ||
try (ResultSet dataSet = database.getResultSet("Karsto", "....'")) { | ||
while (dataSet.next()) { | ||
System.out.println("dataset " + dataSet.getString(4)); | ||
System.out.println("dataset value " + dataSet.getDouble("...")); | ||
} | ||
failed = false; | ||
} catch (Exception ex) { | ||
System.out.println("failed "); | ||
} | ||
Assertions.assertFalse(failed, "Failed getting properties from FluidDatabase"); | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
src/test/java/neqsim/util/database/NeqSimFluidDataBaseTest.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,24 @@ | ||
package neqsim.util.database; | ||
|
||
import java.sql.ResultSet; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class NeqSimFluidDataBaseTest { | ||
@Disabled | ||
@Test | ||
void testMain() { | ||
boolean failed = true; | ||
NeqSimFluidDataBase database = new NeqSimFluidDataBase(); | ||
try (ResultSet dataSet = | ||
database.getResultSet("FluidDatabase", "SELECT * FROM comp where name='water'")) { | ||
dataSet.next(); | ||
System.out.println("dataset " + dataSet.getString("molarmass")); | ||
failed = false; | ||
} catch (Exception ex) { | ||
System.out.println("failed"); | ||
} | ||
Assertions.assertFalse(failed, "Failed getting properties from FluidDatabase"); | ||
} | ||
} |