Package org.candlepin.model

Examples of org.candlepin.model.Release


* ReleaseTest
*/
public class ReleaseTest {
    @Test
    public void testEquals() {
        Release rl = new Release("24.1");
        Release rl1 = new Release("24.1");
        Release rl2 = new Release("18.9");

        assertTrue(rl.equals(rl1));
        assertFalse(rl.equals(rl2));
        assertFalse(rl.equals("345345"));

        Release rlE = new Release("");
        Release rlE2 = new Release("");

        assertTrue(rlE.equals(rlE2));
        assertTrue(rl.equals(rl));
        assertFalse(rl.equals(rlE));
    }
View Full Code Here


        assertFalse(rl.equals(rlE));
    }

    @Test
    public void testNullEquals() {
        Release r = new Release(null);
        Release r1 = new Release("2.0");

        assertFalse(r.equals(r1));
        assertFalse(r1.equals(r));
        assertTrue(r.equals(r));
        assertTrue(r1.equals(r1));
    }
View Full Code Here

    public void nullReleaseVer() {
        Consumer consumer = getFakeConsumer();
        consumer.setReleaseVer(null);

        Consumer incoming = new Consumer();
        incoming.setReleaseVer(new Release("not null"));
        this.resource.updateConsumer(consumer.getUuid(), incoming);

        Consumer consumer2 = getFakeConsumer();
        consumer2.setReleaseVer(new Release("foo"));
        Consumer incoming2 = new Consumer();
        incoming2.setReleaseVer(null);
        this.resource.updateConsumer(consumer2.getUuid(), incoming2);

    }
View Full Code Here

    }


    private void compareConsumerRelease(String release1, String release2, Boolean verify) {
        Consumer consumer = getFakeConsumer();
        consumer.setReleaseVer(new Release(release1));

        Consumer incoming = new Consumer();
        incoming.setReleaseVer(new Release(release2));

        this.resource.updateConsumer(consumer.getUuid(), incoming);
        if (verify) {
            verify(sink).queueEvent((Event) any());
        }
View Full Code Here

    @Test
    public void testActivationKeyCreateRead() {
        ActivationKey key = new ActivationKey();
        key.setName("dd");
        key.setReleaseVer(new Release("release1"));
        key = ownerResource.createActivationKey(owner.getKey(), key);
        assertNotNull(key.getId());
        assertEquals(key.getOwner().getId(), owner.getId());
        assertEquals(key.getReleaseVer().getReleaseVer(), "release1");
        List<ActivationKey> keys = ownerResource.ownerActivationKeys(owner.getKey());
View Full Code Here

    @Test(expected = BadRequestException.class)
    public void testActivationKeyTooLongRelease() {
        ActivationKey key = new ActivationKey();
        Owner owner = createOwner();
        key.setOwner(owner);
        key.setReleaseVer(new Release(TestUtil.getStringOfSize(256)));
        key = ownerResource.createActivationKey(owner.getKey(), key);
    }
View Full Code Here

        ActivationKey key = new ActivationKey();
        Owner owner = createOwner();
        key.setOwner(owner);
        key.setName("dd");
        key.setServiceLevel("level1");
        key.setReleaseVer(new Release("release1"));
        activationKeyCurator.create(key);

        assertNotNull(key.getId());
        key = activationKeyResource.getActivationKey(key.getId());
        assertNotNull(key);
        key.setName("JarJarBinks");
        key.setServiceLevel("level2");
        key.setReleaseVer(new Release("release2"));
        key = activationKeyResource.updateActivationKey(key.getId(), key);
        key = activationKeyResource.getActivationKey(key.getId());
        assertEquals("JarJarBinks", key.getName());
        assertEquals("level2", key.getServiceLevel());
        assertEquals("release2", key.getReleaseVer().getReleaseVer());
View Full Code Here

        ActivationKey key = new ActivationKey();
        Owner owner = createOwner();
        key.setOwner(owner);
        key.setName("dd");
        key.setServiceLevel("level1");
        key.setReleaseVer(new Release("release1"));
        activationKeyCurator.create(key);

        ActivationKey key2 = new ActivationKey();
        key2.setOwner(owner);
        key2.setName("dd");
        key2.setServiceLevel("level1");
        key2.setReleaseVer(new Release(TestUtil.getStringOfSize(256)));
        key = activationKeyResource.updateActivationKey(key.getId(), key2);
    }
View Full Code Here

    public void registerWithEmptyReleaseVer() {
        Principal p = new TrustedUserPrincipal("anyuser");
        Consumer consumer = new Consumer();
        consumer.setType(system);
        consumer.setName("consumername");
        consumer.setReleaseVer(new Release(""));
        resource.create(consumer, p, USER, owner.getKey(), null);
    }
View Full Code Here

        @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid) {
        Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid);
        if (consumer.getReleaseVer() != null) {
            return consumer.getReleaseVer();
        }
        return new Release("");
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.Release

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.