Search in sources :

Example 26 with AddonSpecification

use of org.openecard.addon.manifest.AddonSpecification in project open-ecard by ecsec.

the class AddonSpecificationTest method testCompareToAllEquals.

@Test
public void testCompareToAllEquals() {
    AddonSpecification spec1 = new AddonSpecification();
    spec1.setId("ABC");
    spec1.setVersion("1.0.0");
    AddonSpecification spec2 = new AddonSpecification();
    spec2.setId("ABC");
    spec2.setVersion("1.0.0");
    Assert.assertEquals(spec1.compareTo(spec2), 0);
}
Also used : AddonSpecification(org.openecard.addon.manifest.AddonSpecification) Test(org.testng.annotations.Test)

Example 27 with AddonSpecification

use of org.openecard.addon.manifest.AddonSpecification in project open-ecard by ecsec.

the class AddonSpecificationTest method testEqualsSameObjectTypeDiffAttributes.

@Test
public void testEqualsSameObjectTypeDiffAttributes() {
    AddonSpecification spec1 = new AddonSpecification();
    spec1.setId("ABC");
    spec1.setVersion("1.0.0");
    AddonSpecification spec2 = new AddonSpecification();
    spec2.setId("ABk");
    spec2.setVersion("1.0.5");
    Assert.assertFalse(spec1.equals(spec2));
}
Also used : AddonSpecification(org.openecard.addon.manifest.AddonSpecification) Test(org.testng.annotations.Test)

Example 28 with AddonSpecification

use of org.openecard.addon.manifest.AddonSpecification in project open-ecard by ecsec.

the class AddonSpecificationTest method testEqualsDifferentObjects.

@Test
public void testEqualsDifferentObjects() {
    AddonSpecification spec1 = new AddonSpecification();
    spec1.setId("ABC");
    spec1.setVersion("1.0.0");
    StringBuilder strBuilder = new StringBuilder();
    Assert.assertFalse(spec1.equals(strBuilder));
}
Also used : AddonSpecification(org.openecard.addon.manifest.AddonSpecification) Test(org.testng.annotations.Test)

Example 29 with AddonSpecification

use of org.openecard.addon.manifest.AddonSpecification in project open-ecard by ecsec.

the class AddonSpecificationTest method testCompareToVersionEquals.

@Test
public void testCompareToVersionEquals() {
    AddonSpecification spec1 = new AddonSpecification();
    spec1.setId("ABD");
    spec1.setVersion("1.0.0");
    AddonSpecification spec2 = new AddonSpecification();
    spec2.setId("ABC");
    spec2.setVersion("1.0.0");
    Assert.assertEquals(spec1.compareTo(spec2), 1);
}
Also used : AddonSpecification(org.openecard.addon.manifest.AddonSpecification) Test(org.testng.annotations.Test)

Example 30 with AddonSpecification

use of org.openecard.addon.manifest.AddonSpecification in project open-ecard by ecsec.

the class CacheTest method addIFDProtocol.

@Test
public void addIFDProtocol() {
    IFDProtocolProxy proxy = new IFDProtocolProxy(null, null);
    int initialHash = proxy.hashCode();
    AddonSpecification spec = new AddonSpecification();
    String id = "test";
    spec.setId(id);
    spec.setVersion("1.0.0");
    cache.addIFDProtocol(spec, id, proxy);
    // now get it back from the cache
    IFDProtocol proto = cache.getIFDProtocol(spec, id);
    Assert.assertEquals(proto.hashCode(), initialHash);
}
Also used : IFDProtocol(org.openecard.addon.ifd.IFDProtocol) IFDProtocolProxy(org.openecard.addon.ifd.IFDProtocolProxy) AddonSpecification(org.openecard.addon.manifest.AddonSpecification) Test(org.testng.annotations.Test)

Aggregations

AddonSpecification (org.openecard.addon.manifest.AddonSpecification)37 Test (org.testng.annotations.Test)21 AppPluginActionProxy (org.openecard.addon.bind.AppPluginActionProxy)5 IOException (java.io.IOException)4 HashSet (java.util.HashSet)4 AppExtensionAction (org.openecard.addon.bind.AppExtensionAction)4 AppExtensionActionProxy (org.openecard.addon.bind.AppExtensionActionProxy)3 AppPluginAction (org.openecard.addon.bind.AppPluginAction)3 GridBagConstraints (java.awt.GridBagConstraints)2 Insets (java.awt.Insets)2 ArrayList (java.util.ArrayList)2 TreeSet (java.util.TreeSet)2 JLabel (javax.swing.JLabel)2 JList (javax.swing.JList)2 AddonRegistry (org.openecard.addon.AddonRegistry)2 IFDProtocolProxy (org.openecard.addon.ifd.IFDProtocolProxy)2 ProtocolPluginSpecification (org.openecard.addon.manifest.ProtocolPluginSpecification)2 SALProtocolProxy (org.openecard.addon.sal.SALProtocolProxy)2 InitializeFramework (de.bund.bsi.ecard.api._1.InitializeFramework)1 ApplicationCapabilitiesType (iso.std.iso_iec._24727.tech.schema.ApplicationCapabilitiesType)1