summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bentele2021-05-25 09:12:06 +0200
committerManuel Bentele2021-05-25 09:12:06 +0200
commit2af60cedcd0daa393791f550aaf767d4f7e8edc3 (patch)
tree104724e0eff8bd23f2523a06606ca36356cb2887
parent[qemu] Add test dependency to reuse test resources from master-sync-shared (diff)
downloadmltk-2af60cedcd0daa393791f550aaf767d4f7e8edc3.tar.gz
mltk-2af60cedcd0daa393791f550aaf767d4f7e8edc3.tar.xz
mltk-2af60cedcd0daa393791f550aaf767d4f7e8edc3.zip
[qemu] Rename test classes to match naming convention of 'transformation'
-rw-r--r--core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericCpuTest.java (renamed from core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericCpuTest.java)10
-rw-r--r--core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericDiskStorageDevicesTest.java (renamed from core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericDiskStorageDevicesTest.java)20
-rw-r--r--core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericMemoryTest.java (renamed from core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericMemoryTest.java)8
-rw-r--r--core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericNameTest.java (renamed from core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericNameTest.java)14
-rw-r--r--core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericUuidTest.java (renamed from core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericUuidTest.java)10
-rw-r--r--core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationTestResources.java (renamed from core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterTestResources.java)6
-rw-r--r--core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationTestUtils.java (renamed from core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterTestUtils.java)42
7 files changed, 52 insertions, 58 deletions
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericCpuTest.java b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericCpuTest.java
index 560d4b7c..9553db08 100644
--- a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericCpuTest.java
+++ b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericCpuTest.java
@@ -11,23 +11,23 @@ import org.openslx.libvirt.domain.Domain.CpuMode;
import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgs;
import org.openslx.virtualization.configuration.transformation.TransformationException;
-public class FilterGenericCpuTest
+public class TransformationGenericCpuTest
{
@Test
@DisplayName( "Test filtering of VM CPU configuration" )
public void testFilterGenericCpu() throws TransformationException
{
final TransformationGenericCpu filter = new TransformationGenericCpu();
- final Domain config = FilterTestUtils.getDefaultDomain();
- final CommandLineArgs args = FilterTestUtils.getDefaultCmdLnArgs();
+ final Domain config = TransformationTestUtils.getDefaultDomain();
+ final CommandLineArgs args = TransformationTestUtils.getDefaultCmdLnArgs();
- assertNotEquals( Integer.parseInt( FilterTestUtils.DEFAULT_VM_NCPUS ), config.getVCpu() );
+ assertNotEquals( Integer.parseInt( TransformationTestUtils.DEFAULT_VM_NCPUS ), config.getVCpu() );
assertNotEquals( CpuMode.HOST_PASSTHROUGH, config.getCpuMode() );
assertEquals( CpuCheck.PARTIAL, config.getCpuCheck() );
filter.transform( config, args );
- assertEquals( Integer.parseInt( FilterTestUtils.DEFAULT_VM_NCPUS ), config.getVCpu() );
+ assertEquals( Integer.parseInt( TransformationTestUtils.DEFAULT_VM_NCPUS ), config.getVCpu() );
assertEquals( CpuMode.HOST_PASSTHROUGH, config.getCpuMode() );
assertEquals( CpuCheck.PARTIAL, config.getCpuCheck() );
}
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericDiskStorageDevicesTest.java b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericDiskStorageDevicesTest.java
index 5dd9e4cc..20fd2fb6 100644
--- a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericDiskStorageDevicesTest.java
+++ b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericDiskStorageDevicesTest.java
@@ -13,27 +13,27 @@ import org.openslx.libvirt.domain.device.DiskStorage;
import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgs;
import org.openslx.virtualization.configuration.transformation.TransformationException;
-public class FilterGenericDiskStorageDevicesTest
+public class TransformationGenericDiskStorageDevicesTest
{
@Test
@DisplayName( "Test filtering of VM disk storage devices configuration with specified input data" )
public void testFilterGenericDiskStorageDevices() throws TransformationException
{
final TransformationGenericDiskStorageDevices filter = new TransformationGenericDiskStorageDevices();
- final Domain config = FilterTestUtils.getDefaultDomain();
- final CommandLineArgs args = FilterTestUtils.getDefaultCmdLnArgs();
+ final Domain config = TransformationTestUtils.getDefaultDomain();
+ final CommandLineArgs args = TransformationTestUtils.getDefaultCmdLnArgs();
final ArrayList<DiskStorage> devicesBeforeFiltering = config.getDiskStorageDevices();
assertEquals( 1, devicesBeforeFiltering.size() );
assertNotEquals( StorageType.FILE, devicesBeforeFiltering.get( 0 ).getStorageType() );
- assertNotEquals( FilterTestUtils.DEFAULT_VM_HDD0, devicesBeforeFiltering.get( 0 ).getStorageSource() );
+ assertNotEquals( TransformationTestUtils.DEFAULT_VM_HDD0, devicesBeforeFiltering.get( 0 ).getStorageSource() );
filter.transform( config, args );
final ArrayList<DiskStorage> devicesAfterFiltering = config.getDiskStorageDevices();
assertEquals( 1, devicesAfterFiltering.size() );
assertEquals( StorageType.FILE, devicesAfterFiltering.get( 0 ).getStorageType() );
- assertEquals( FilterTestUtils.DEFAULT_VM_HDD0, devicesAfterFiltering.get( 0 ).getStorageSource() );
+ assertEquals( TransformationTestUtils.DEFAULT_VM_HDD0, devicesAfterFiltering.get( 0 ).getStorageSource() );
}
@Test
@@ -41,8 +41,8 @@ public class FilterGenericDiskStorageDevicesTest
public void testFilterGenericDiskStorageDevicesNoData() throws TransformationException
{
final TransformationGenericDiskStorageDevices filter = new TransformationGenericDiskStorageDevices();
- final Domain config = FilterTestUtils.getDefaultDomain();
- final CommandLineArgs args = FilterTestUtils.getEmptyCmdLnArgs();
+ final Domain config = TransformationTestUtils.getDefaultDomain();
+ final CommandLineArgs args = TransformationTestUtils.getEmptyCmdLnArgs();
final ArrayList<DiskStorage> devicesBeforeFiltering = config.getDiskStorageDevices();
assertEquals( 1, devicesBeforeFiltering.size() );
@@ -52,10 +52,4 @@ public class FilterGenericDiskStorageDevicesTest
final ArrayList<DiskStorage> devicesAfterFiltering = config.getDiskStorageDevices();
assertEquals( 0, devicesAfterFiltering.size() );
}
-
- public static void main( String[] args ) throws TransformationException
- {
- FilterGenericDiskStorageDevicesTest test = new FilterGenericDiskStorageDevicesTest();
- test.testFilterGenericDiskStorageDevicesNoData();
- }
}
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericMemoryTest.java b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericMemoryTest.java
index 2bbda865..9ef1f1d2 100644
--- a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericMemoryTest.java
+++ b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericMemoryTest.java
@@ -12,17 +12,17 @@ import org.openslx.libvirt.domain.DomainUtils;
import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgs;
import org.openslx.virtualization.configuration.transformation.TransformationException;
-public class FilterGenericMemoryTest
+public class TransformationGenericMemoryTest
{
@Test
@DisplayName( "Test filtering of VM memory configuration" )
public void testFilterGenericMemory() throws TransformationException
{
final TransformationGenericMemory filter = new TransformationGenericMemory();
- final Domain config = FilterTestUtils.getDefaultDomain();
- final CommandLineArgs args = FilterTestUtils.getDefaultCmdLnArgs();
+ final Domain config = TransformationTestUtils.getDefaultDomain();
+ final CommandLineArgs args = TransformationTestUtils.getDefaultCmdLnArgs();
- final BigInteger defaultMemory = DomainUtils.decodeMemory( FilterTestUtils.DEFAULT_VM_MEM, "MiB" );
+ final BigInteger defaultMemory = DomainUtils.decodeMemory( TransformationTestUtils.DEFAULT_VM_MEM, "MiB" );
assertNotEquals( defaultMemory.toString(), config.getMemory().toString() );
assertNotEquals( defaultMemory.toString(), config.getCurrentMemory().toString() );
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericNameTest.java b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericNameTest.java
index 188a13fa..f85af001 100644
--- a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericNameTest.java
+++ b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericNameTest.java
@@ -9,22 +9,22 @@ import org.openslx.libvirt.domain.Domain;
import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgs;
import org.openslx.virtualization.configuration.transformation.TransformationException;
-public class FilterGenericNameTest
+public class TransformationGenericNameTest
{
@Test
@DisplayName( "Test filtering of VM (display) name configuration" )
public void testFilterGenericName() throws TransformationException
{
final TransformationGenericName filter = new TransformationGenericName();
- final Domain config = FilterTestUtils.getDefaultDomain();
- final CommandLineArgs args = FilterTestUtils.getDefaultCmdLnArgs();
+ final Domain config = TransformationTestUtils.getDefaultDomain();
+ final CommandLineArgs args = TransformationTestUtils.getDefaultCmdLnArgs();
- assertNotEquals( FilterTestUtils.DEFAULT_VM_NAME, config.getName() );
- assertNotEquals( FilterTestUtils.DEFAULT_VM_DSPLNAME, config.getTitle() );
+ assertNotEquals( TransformationTestUtils.DEFAULT_VM_NAME, config.getName() );
+ assertNotEquals( TransformationTestUtils.DEFAULT_VM_DSPLNAME, config.getTitle() );
filter.transform( config, args );
- assertEquals( FilterTestUtils.DEFAULT_VM_NAME, config.getName() );
- assertEquals( FilterTestUtils.DEFAULT_VM_DSPLNAME, config.getTitle() );
+ assertEquals( TransformationTestUtils.DEFAULT_VM_NAME, config.getName() );
+ assertEquals( TransformationTestUtils.DEFAULT_VM_DSPLNAME, config.getTitle() );
}
}
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericUuidTest.java b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericUuidTest.java
index e15c1856..8b2dc69b 100644
--- a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterGenericUuidTest.java
+++ b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationGenericUuidTest.java
@@ -9,20 +9,20 @@ import org.openslx.libvirt.domain.Domain;
import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgs;
import org.openslx.virtualization.configuration.transformation.TransformationException;
-public class FilterGenericUuidTest
+public class TransformationGenericUuidTest
{
@Test
@DisplayName( "Test filtering of VM UUID configuration" )
public void testFilterGenericUuid() throws TransformationException
{
final TransformationGenericUuid filter = new TransformationGenericUuid();
- final Domain config = FilterTestUtils.getDefaultDomain();
- final CommandLineArgs args = FilterTestUtils.getDefaultCmdLnArgs();
+ final Domain config = TransformationTestUtils.getDefaultDomain();
+ final CommandLineArgs args = TransformationTestUtils.getDefaultCmdLnArgs();
- assertNotEquals( FilterTestUtils.DEFAULT_VM_UUID, config.getUuid() );
+ assertNotEquals( TransformationTestUtils.DEFAULT_VM_UUID, config.getUuid() );
filter.transform( config, args );
- assertEquals( FilterTestUtils.DEFAULT_VM_UUID, config.getUuid() );
+ assertEquals( TransformationTestUtils.DEFAULT_VM_UUID, config.getUuid() );
}
}
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterTestResources.java b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationTestResources.java
index 80fa2636..b04685f9 100644
--- a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterTestResources.java
+++ b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationTestResources.java
@@ -3,15 +3,15 @@ package org.openslx.runvirt.plugin.qemu.configuration;
import java.io.File;
import java.net.URL;
-public class FilterTestResources
+public class TransformationTestResources
{
private static final String LIBVIRT_PREFIX_PATH = File.separator + "libvirt";
private static final String LIBVIRT_PREFIX_PATH_XML = LIBVIRT_PREFIX_PATH + File.separator + "xml";
public static File getLibvirtXmlFile( String libvirtXmlFileName )
{
- String libvirtXmlPath = FilterTestResources.LIBVIRT_PREFIX_PATH_XML + File.separator + libvirtXmlFileName;
- URL libvirtXml = FilterTestResources.class.getResource( libvirtXmlPath );
+ String libvirtXmlPath = TransformationTestResources.LIBVIRT_PREFIX_PATH_XML + File.separator + libvirtXmlFileName;
+ URL libvirtXml = TransformationTestResources.class.getResource( libvirtXmlPath );
return new File( libvirtXml.getFile() );
}
}
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterTestUtils.java b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationTestUtils.java
index a308693f..132c6ba3 100644
--- a/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/FilterTestUtils.java
+++ b/core/modules/qemu/runvirt-plugin-qemu/src/test/java/org/openslx/runvirt/plugin/qemu/configuration/TransformationTestUtils.java
@@ -12,7 +12,7 @@ import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgs.CmdLnOption;
import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgsException;
import org.openslx.runvirt.plugin.qemu.cmdln.CommandLineArgsTest;
-public class FilterTestUtils
+public class TransformationTestUtils
{
// @formatter:off
public static final String DEFAULT_VM_NAME = "archlinux";
@@ -37,41 +37,41 @@ public class FilterTestUtils
private static final String[] DEFAULT_CMDLN_ARGS = {
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_NAME.getLongOption(),
- FilterTestUtils.DEFAULT_VM_NAME,
+ TransformationTestUtils.DEFAULT_VM_NAME,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_UUID.getLongOption(),
- FilterTestUtils.DEFAULT_VM_UUID,
+ TransformationTestUtils.DEFAULT_VM_UUID,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_DSPLNAME.getLongOption(),
- FilterTestUtils.DEFAULT_VM_DSPLNAME,
+ TransformationTestUtils.DEFAULT_VM_DSPLNAME,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_OS.getLongOption(),
- FilterTestUtils.DEFAULT_VM_OS,
+ TransformationTestUtils.DEFAULT_VM_OS,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_NCPUS.getLongOption(),
- FilterTestUtils.DEFAULT_VM_NCPUS,
+ TransformationTestUtils.DEFAULT_VM_NCPUS,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_MEM.getLongOption(),
- FilterTestUtils.DEFAULT_VM_MEM,
+ TransformationTestUtils.DEFAULT_VM_MEM,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_HDD0.getLongOption(),
- FilterTestUtils.DEFAULT_VM_HDD0,
+ TransformationTestUtils.DEFAULT_VM_HDD0,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_FLOPPY0.getLongOption(),
- FilterTestUtils.DEFAULT_VM_FLOPPY0,
+ TransformationTestUtils.DEFAULT_VM_FLOPPY0,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_FLOPPY1.getLongOption(),
- FilterTestUtils.DEFAULT_VM_FLOPPY1,
+ TransformationTestUtils.DEFAULT_VM_FLOPPY1,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_CDROM0.getLongOption(),
- FilterTestUtils.DEFAULT_VM_CDROM0,
+ TransformationTestUtils.DEFAULT_VM_CDROM0,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_CDROM1.getLongOption(),
- FilterTestUtils.DEFAULT_VM_CDROM1,
+ TransformationTestUtils.DEFAULT_VM_CDROM1,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_PARALLEL0.getLongOption(),
- FilterTestUtils.DEFAULT_VM_PARALLEL0,
+ TransformationTestUtils.DEFAULT_VM_PARALLEL0,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_SERIAL0.getLongOption(),
- FilterTestUtils.DEFAULT_VM_SERIAL0,
+ TransformationTestUtils.DEFAULT_VM_SERIAL0,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_MAC0.getLongOption(),
- FilterTestUtils.DEFAULT_VM_MAC0,
+ TransformationTestUtils.DEFAULT_VM_MAC0,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_FSSRC0.getLongOption(),
- FilterTestUtils.DEFAULT_VM_FSSRC0,
+ TransformationTestUtils.DEFAULT_VM_FSSRC0,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_FSTGT0.getLongOption(),
- FilterTestUtils.DEFAULT_VM_FSTGT0,
+ TransformationTestUtils.DEFAULT_VM_FSTGT0,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_FSSRC1.getLongOption(),
- FilterTestUtils.DEFAULT_VM_FSSRC1,
+ TransformationTestUtils.DEFAULT_VM_FSSRC1,
CommandLineArgsTest.CMDLN_PREFIX_OPTION_LONG + CmdLnOption.VM_FSTGT1.getLongOption(),
- FilterTestUtils.DEFAULT_VM_FSTGT1
+ TransformationTestUtils.DEFAULT_VM_FSTGT1
};
private static CommandLineArgs getCmdLnArgs( String[] args )
@@ -89,12 +89,12 @@ public class FilterTestUtils
public static CommandLineArgs getDefaultCmdLnArgs()
{
- return FilterTestUtils.getCmdLnArgs( FilterTestUtils.DEFAULT_CMDLN_ARGS );
+ return TransformationTestUtils.getCmdLnArgs( TransformationTestUtils.DEFAULT_CMDLN_ARGS );
}
public static CommandLineArgs getEmptyCmdLnArgs()
{
- return FilterTestUtils.getCmdLnArgs( new String[] {} );
+ return TransformationTestUtils.getCmdLnArgs( new String[] {} );
}
public static Domain getDefaultDomain()